-
AuthorPosts
-
June 19, 2018 at 7:08 pm #974870
Hi, I was looking for the same issue as here:
https://kriesi.at/support/topic/removing-the-related-products-section/I tried the code in my functions.php in the child theme, but it doesn’t work. I only want to remove the “Related Products” from the the single product pages.
I’m also using the “WooCommerce Bookings” plugin.
Best regards,
DirkJune 19, 2018 at 7:37 pm #974882Hi Dirk!
Please try to add this code to the child theme functions.php:
/** * Remove related products output */ remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
reference: https://docs.woocommerce.com/document/remove-related-posts-output/
Regards,
PeterJune 19, 2018 at 7:48 pm #974895Hi Peter,
I already tried this, it doesn’t work – similar to the other thread, that’s why I’m asking.
Also Victoria’s code didn’t work…Best regards,
DirkJune 19, 2018 at 10:06 pm #975003Hi,
We will help you hide it with CSS, but disable the HTACCESS. We cant click back and forth to go through it.
Best regards,
BasilisJune 20, 2018 at 8:31 am #975152Hi Basilis,
hiding it per CSS is not an option. What about customizing Victoria’s solution?
We are still developing the project and I can’t remove htaccess at this time, furthermore you also got our WordPress credentials.
Best regards,
DirkJune 20, 2018 at 12:51 pm #975254Hi Dirk,
Here is the code you can put in your funtions.php
add_action('woocommerce_after_single_product_summary', 'remove_related_products', 10); function remove_related_products { if ( is_product() ){ remove_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_output_related_products', 20); } }
If you need further assistance please let us know.
Best regards,
VictoriaJune 20, 2018 at 1:12 pm #975274Hi Victoria,
thanks for helping.
I get a white page, when I upload my functions.php
There might be a little code bug?Best regards,
DirkJune 20, 2018 at 2:05 pm #975303Hi Dirk,
Sorry about that, I forgot to change one action name:
add_action('woocommerce_single_product_summary', 'remove_related_products', 10); function remove_related_products { if ( is_product() ){ remove_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_output_related_products', 20); } }
This should do the trick.
Best regards,
VictoriaJune 20, 2018 at 2:15 pm #975314Hi Victoria,
no – white page again :(
My editor says there’s a code error in the line where the function starts?Best regards,
DirkJune 20, 2018 at 6:43 pm #975416Hey!
Please try this code instead:add_action('init', 'avia_remove_related_products', 10); function avia_remove_related_products() { remove_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_output_related_products', 20); }
Cheers!
PeterJune 21, 2018 at 6:52 am #975667Hey,
thanks a lot for helping!
Yes, only the brackets () were missing.It works fine, problem solved :)
@ Victoria: Thanks for customizing your code :)Best regards and have a nice day,
DirkJune 21, 2018 at 9:15 am #975700Hi Dirk,
Glad that it’s resolved. :)
Feel free to comeback if you need further assistance.
Thanks for using Enfold and have a great day!Best regards,
Nikko -
AuthorPosts
- The topic ‘Remove WooCommerce "Related Products" from shop page’ is closed to new replies.