diff --git a/plugins/woocommerce-blocks/docs/internal-developers/blockified-templates/compatibility-layer.md b/plugins/woocommerce-blocks/docs/internal-developers/blockified-templates/compatibility-layer.md index 1b89b30f1e8..43db705fc2f 100644 --- a/plugins/woocommerce-blocks/docs/internal-developers/blockified-templates/compatibility-layer.md +++ b/plugins/woocommerce-blocks/docs/internal-developers/blockified-templates/compatibility-layer.md @@ -55,7 +55,7 @@ The following table shows where the hooks are injected into the page. | woocommerce_after_main_content | Last block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | after | | woocommerce_sidebar | Last block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | after | | woocommerce_before_single_product | First block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | before | -| woocommerce_before_single_product_summary | First `core/post-excerpt` block (before `woocommerce_single_product_summary`) | before | +| woocommerce_before_single_product_summary | First block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | before | | woocommerce_single_product_summary | First `core/post-excerpt` block | before | | woocommerce_after_single_product | Last block related to the Single Product Template (Product Image Gallery, Product Details, Add to Cart Form, Product Meta, Product Price, Breadcrumbs) | after | | woocommerce_product_meta_start | Product Meta | before | diff --git a/plugins/woocommerce/changelog/50392-fix-compatibility-layer b/plugins/woocommerce/changelog/50392-fix-compatibility-layer new file mode 100644 index 00000000000..0a56565cda6 --- /dev/null +++ b/plugins/woocommerce/changelog/50392-fix-compatibility-layer @@ -0,0 +1,4 @@ +Significance: major +Type: fix + +Compatibility Layer: fix 'woocommerce_before_single_product_summary' hook position. \ No newline at end of file diff --git a/plugins/woocommerce/src/Blocks/Templates/SingleProductTemplateCompatibility.php b/plugins/woocommerce/src/Blocks/Templates/SingleProductTemplateCompatibility.php index a76f974d32b..05191bcbdbb 100644 --- a/plugins/woocommerce/src/Blocks/Templates/SingleProductTemplateCompatibility.php +++ b/plugins/woocommerce/src/Blocks/Templates/SingleProductTemplateCompatibility.php @@ -55,6 +55,7 @@ class SingleProductTemplateCompatibility extends AbstractTemplateCompatibility { * Since that there is a custom logic for the first and last block, we have to inject the hooks manually. * The first block supports the following hooks: * woocommerce_before_single_product + * woocommerce_before_single_product_summary * * The last block supports the following hooks: * woocommerce_after_single_product @@ -69,6 +70,7 @@ class SingleProductTemplateCompatibility extends AbstractTemplateCompatibility { 'before' => array( 'woocommerce_before_main_content' => $this->hook_data['woocommerce_before_main_content'], 'woocommerce_before_single_product' => $this->hook_data['woocommerce_before_single_product'], + 'woocommerce_before_single_product_summary' => $this->hook_data['woocommerce_before_single_product_summary'], ), 'after' => array(), ); @@ -195,7 +197,7 @@ class SingleProductTemplateCompatibility extends AbstractTemplateCompatibility { ), ), 'woocommerce_before_single_product_summary' => array( - 'block_names' => array( 'core/post-excerpt' ), + 'block_names' => array(), 'position' => 'before', 'hooked' => array( 'woocommerce_show_product_sale_flash' => 10,