[Support request] Insert a hook after WooCommerce product content

Home Forums Support [Support request] Insert a hook after WooCommerce product content

Home Forums Support Insert a hook after WooCommerce product content

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1548195
    Mohamed

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

    #1548217
    Elvin
    Staff
    Customer Support

    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 );

    A wise man once said:
    "Have you cleared your cache?"

    #1548225
    Mohamed

    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?

    #1548251
    Elvin
    Staff
    Customer Support

    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.

    A wise man once said:
    "Have you cleared your cache?"

    #1651587
    Samuel

    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 ?

    #1651596
    Samuel

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

    Sorry for that.

    #1652447
    Elvin
    Staff
    Customer Support

    Nice one. No problem. Glad you got it sorted. 🙂

    A wise man once said:
    "Have you cleared your cache?"

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.