[Resolved] Gutenenberg Pages Woocomerce Block Hook

Home Forums Support [Resolved] Gutenenberg Pages Woocomerce Block Hook

Home Forums Support Gutenenberg Pages Woocomerce Block Hook

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
  • #1108575

    Hi , Can we use a hook or filter on simple pages to show ACF .

    So i have created for each woocomerce product a custom field that is a subtitle . and i can show them on woo pages with a simple hook .

    But is this possible or any hook available for not woocomerce pages and simple pages . i have to notice that pages are created with woocomerce short code inside gutenberg editor .

    Lead Developer
    Lead Developer

    Hi there,

    I’m not too sure what you mean – you should be able to hook anything into your site, regardless of the page.

    Have you checked out the Hook Element?: https://docs.generatepress.com/article/hooks-element-overview/

    In the Display Rules you can include/exclude pages, products etc..

    Let me know 🙂


    Tom thank you for your reply ! I have tried Hook Elements and its one of the greatest things i have ever used! has helped me a million of times on my projects and clients like it !

    What i say is , i have created a field with ACF on Woocomerce products , its a like a subtitle .

    With this php code

    add_action( 'woocommerce_single_product_summary', 'display_acf_field_under_title', 6 );
    function display_acf_field_under_title() {
    echo '<span class="woo-subtitle">' . get_field('subtitle_'). '</span>';

    I can show them on woo pages .

    And with this one

    remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 );
    add_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 11 );

    I transfer Product name above Image . THis is easy .

    But i have a page created with Gutenberg and i dont know how to access and make this changes there .

    I mean i use Woocomerce Gutenberg blocks to show my categories in the page , but i cant show the ACF fields !


    I would apreciate if there is any tip on how to do this one

    Customer Support

    Hi there,

    unfortunately the Woo Guteneberg Blocks don’t use the core woo templates so don’t contain any hooks.

    Have you tried using the Woo Shortcodes instead?


    Hi David once again ! I did not think about shortcodes actually ! How is possible to call custom fields with short codes ?

    Customer Support

    Sorry I thought you were Hooking ACF fields to be displayed in the Woo templates.

    ACF has its own shortcakes:



    Yeah maybe this is the only solution , a combo of this – > https://stackoverflow.com/questions/50672469/add-a-custom-field-variable-acf-to-a-custom-woocommerce-shortcode

    and the acf shortcodes maybe , i will give it a try


    Actually the best practice for someone is to create a custom woo archive template where you can easily work on it , but now is been maded with gutenberg so i have to try it with what i have , but my advice for someone that has the same is go with custom php template .

    Customer Support

    Yeah Gutenberg does ‘mix’ things up a bit. You may want to look into ACF Blocks as well:


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