2023-05-04 13:00:15 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Title: Product Hero
|
|
|
|
* Slug: woocommerce-blocks/product-hero
|
|
|
|
* Categories: WooCommerce
|
|
|
|
*/
|
2023-06-28 12:34:51 +00:00
|
|
|
|
|
|
|
$query = new \WC_Product_Query(
|
|
|
|
array(
|
|
|
|
'limit' => 1,
|
|
|
|
'return' => 'ids',
|
|
|
|
'status' => array( 'publish' ),
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
$products = $query->get_products();
|
|
|
|
$product_id = $products ? $products[0] : null;
|
2023-05-04 13:00:15 +00:00
|
|
|
?>
|
2023-06-28 12:34:51 +00:00
|
|
|
|
|
|
|
<!-- wp:woocommerce/single-product {"productId":<?php echo esc_attr( $product_id ); ?>,"align":"wide"} -->
|
|
|
|
<div class="wp-block-woocommerce-single-product alignwide">
|
2023-07-19 09:14:11 +00:00
|
|
|
<!-- wp:columns -->
|
|
|
|
<div class="wp-block-columns">
|
|
|
|
<!-- wp:column {"width":"40%","style":{"spacing":{"padding":{"top":"0","right":"0","bottom":"0","left":"0"}}},"verticalAlignment":"center"} -->
|
|
|
|
<div class="wp-block-column is-vertically-aligned-center" style="padding-top:0;padding-right:0;padding-bottom:0;padding-left:0;flex-basis:40%">
|
2023-07-03 09:33:44 +00:00
|
|
|
<!-- wp:woocommerce/product-image {"showSaleBadge":false,"isDescendentOfSingleProductBlock":true,"height":"300px"} /-->
|
2023-06-28 12:34:51 +00:00
|
|
|
</div>
|
2023-05-04 13:00:15 +00:00
|
|
|
<!-- /wp:column -->
|
|
|
|
|
2023-07-19 09:14:11 +00:00
|
|
|
<!-- wp:column {"verticalAlignment":"center"} -->
|
|
|
|
<div class="wp-block-column is-vertically-aligned-center">
|
|
|
|
<!-- wp:post-title {"textAlign":"","isLink":true,"style":{"spacing":{"margin":{"top":"0","right":"0","bottom":"0","left":"0"}}},"__woocommerceNamespace":"woocommerce/product-query/product-title"} /-->
|
2023-05-04 13:00:15 +00:00
|
|
|
|
2023-07-19 09:14:11 +00:00
|
|
|
<!-- wp:woocommerce/product-price {"isDescendentOfSingleProductBlock":true} /-->
|
2023-05-04 13:00:15 +00:00
|
|
|
|
2023-07-19 09:14:11 +00:00
|
|
|
<!-- wp:woocommerce/product-button -->
|
|
|
|
<div class="wp-block-woocommerce-product-button is-loading"></div>
|
2023-06-28 12:34:51 +00:00
|
|
|
<!-- /wp:woocommerce/product-button -->
|
2023-05-04 13:00:15 +00:00
|
|
|
|
2023-07-19 09:14:11 +00:00
|
|
|
<!-- wp:post-excerpt {"__woocommerceNamespace":"woocommerce/product-query/product-summary"} /-->
|
2023-05-12 13:05:36 +00:00
|
|
|
</div>
|
|
|
|
<!-- /wp:column -->
|
|
|
|
</div>
|
2023-06-28 12:34:51 +00:00
|
|
|
<!-- /wp:columns -->
|
|
|
|
</div>
|
|
|
|
<!-- /wp:woocommerce/single-product -->
|