'woocommerce_after_single_product' Hook missing on Single product Page Builder

Hi.

I have a plugin that uses the 'woocommerce_after_single_product' hook.

I have built my product page in the templates section, how do I add this hook back to the page?

Comments

  • Hey,

    Please send us the WordPress dashboard and FTP access privately thru the contact form, which is on the right side at http://themeforest.net/user/muffingroup#contact and we will check what might be the reason.

    Notice!

    Please attach a link to this forum discussion.

    Sending incorrect or incomplete data will result in a longer response time.

    Therefore, please make sure that the data you are sending are complete and correct.

    Thanks

  • Hi,

    This is going to be a bit long, so please ask if it doesn't make sense.

    So the issue I am having are the hooks on the woo commerce archive pages are not working or in the wrong place, see here:

    https://www.businessbloomer.com/woocommerce-visual-hook-guide-archiveshopcat-page/


    For example, the custom muffin woocommerce templates do not have the hook for "woocommerce_before_shop_loop_item"

    This is true for the standard shortcodes like [products limit="4"] and for the muffin builder templates.

    Here are 2 pages, 1 has the shortcode and the other is using the muffin builder templates:

    Shortcode on page only:

    https://staging8.eco-move.co.uk/electric-bicycles-bristol/

    Muffin archive template:

    https://staging8.eco-move.co.uk/shop/

    --------

    If you add a function to hook to "woocommerce_before_shop_loop_item" it does not work. Example in functions.php

    add_action ( 'woocommerce_before_shop_loop_item' , 'test_function' );

    function test_function(){

    echo 'test';

    }

    Note, I had to create a hack to get this to show, on the file functions / builder / class-mfn-builder-woo-helper line:293

    I added $output .= do_action( 'woocommerce_before_shop_loop_item' );

    This worked ... but the next time I update I need to add this back.

    ---------

    Some of the hooks exist but are in the wrong place, for example:

    add_action ( 'woocommerce_after_shop_loop_item' , 'testfunction' );

    function testfunction(){

    echo 'test';

    }

    In this case, the word "test" shows above the price on the archive template page and doesn't show on the woocommerce shortcode, see picture 1 attached.

    Can you please check your woocommerce hooks to ensure they work correctly as I need to hook to my products


  • We have added the hook 'woocommerce_after_single_product' to your website. Please, check that.

    In archives built with our templates, you can choose the order.

    That is why some hooks might not work or be placed in the wrong place.

    I have passed it to the dev team, and we will discuss this functionality.


    Best regards

  • Hi thanks for adding woocommerce_after_single_product


    But the 2 hooks I am asking about are:

    woocommerce_before_shop_loop_item

    woocommerce_after_shop_loop_item


    Also, was this added to the builder AND the regular woocommerce shortcode?


    As stated, one was missing and the other only shows on template builder (in the wrong position)... many plugins and custom functions require these hooks to develop the website functionality, I need to know if this will be part of the theme updates as it is important to have the woocommerce templates follow the woocommerce development guidelines.


    Even if you update the builder to allow the user to add hooks the correct hooks still need to be added to the custom woo-template files, example:

    betheme / content / content-product.php

  • We have also added these two hooks to your website, please, check that.

    We have added it to your child theme, so it will be not lost after the update.

    When you confirm that it works as it should we will also add this to our theme in the next update.


    Best regards

  • Thank you! Nearly there:

    Works here:

    https://staging8.eco-move.co.uk/shop-electric-bicycles-bristol/

    Missing the tag woocommerce_after_shop_loop_item here

    https://staging8.eco-move.co.uk/electric-bicycles-bristol/

    I think it is because I do not have the button enabled here, are you able to add the hook outside of the optional button code so you can still hook even if you disable the button?

  • Also the hook woocommerce_after_shop_loop_item_title is missing


    I have added 3 custom functions in my functions trying to hook to the 3 hooks

  • Also your woocommerce_before_shop_loop_item is inside the A tag so it is linked, it needs to be outside the link tag

  • Yes, it is because of the option to disable the button.

    To have this hook you can set it to show the button, and later hide it with the custom CSS. Thanks to that the hook will appear, but you will not have the button.

    It is added now.

    We cannot find where you used it. Please, try to increase the priority of this action, and if this will not help, please, tell where you placed it.


    Best regards

Sign In or Register to comment.