-
AuthorPosts
-
May 6, 2022 at 4:01 pm #1350813
Update: problem solved!
Normally, this snippet should be sufficient to stop ‘related products’ from showing on the Single product page:
remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20);Unfortunately, this snippet has absolutely no effect.
I searched around and saw that many before me were running into this issue. Finally via Stack Overflow (https://stackoverflow.com/questions/42215193/remove-action-on-related-products-is-not-working-with-woocommerce-hook) I found a snippet that does work, provided theme 2021 is used.
function remove_woo_relate_products(){
remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_output_related_products’, 20);
remove_action( ‘woocommerce_after_single_product_summary’, ‘woocommerce_upsell_display’, 15 );
remove_action( ‘woocommerce_after_single_product_summary’, ‘storefront_upsell_display’, 15 );
}
add_action(‘init’, ‘remove_woo_relate_products’, 10);If I then switch to Enfold I see the related products on the product page again.
I know I can use CSS to make the related products ‘not visible’, but I don’t want them to load at all to keep the page as light as possible.
How can I achieve this?
https://www.dropbox.com/s/g642jfalv3rvzpv/Schermafbeelding%202022-05-06%20om%2015.41.23.png?dl=0Thanks in advance!
Ita-
This topic was modified 3 years, 5 months ago by
ifranl.
May 7, 2022 at 9:24 am #1350839Found this topic what solved my problem!
https://kriesi.at/support/topic/remove-woocommerce-related-products-from-shop-page/
Have a nice weekend!
May 7, 2022 at 9:47 am #1350843 -
This topic was modified 3 years, 5 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.
