Site logo

Archived topic

Insert a hook after WooCommerce product content

6 replies · Started by Mohamed on November 25, 2020

Viewing posts 1–7 of 7

What is the best hook to insert a HTML code after the product description directly before related products or any other content?

Hi,

WooCommerce is a third party plugin and customizing it is out of our scope.

But to help you out, try this PHP snippet:

add_action( 'woocommerce_after_single_product_summary', function(){
// your HTML code here
}, 12 );

Thanks, and I know "WooCommerce is a third party plugin and customizing it is out of your scope."
But I'm talking about the "gp_elements" Hooks!!
What is the best GP hook to insert any code after product description?

What is the best GP hook to insert any code after product description?

The part of the single product page you want to place your code on doesn't use any GeneratePress Hooks.

The product tabs, upsells and related products are all hooked to woocommerce_after_single_product_summary which is sorted by adding a priority value on their add_action parameters.

Hello @Elvin, I have same issue, trying to use the "block" element to display a "WooCommerce review per category" block just before the related product part on specific product pages.

Is there a way to do it ?

Is it possible to add this hook somewhere and call it from GP block element ?

Oh ! I found that the hook "woocommerce-after-single-product-summary" did perfectly the job !

Sorry for that.

Nice one. No problem. Glad you got it sorted. :)

This archived topic is closed to new replies.