-
AuthorPosts
-
October 26, 2020 at 7:29 pm #1255813
Hi,
I’ve been looking at removing the related products shown at the bottom of a product page when using Woocommerce.
Searching on the support forum here, I can see several threads covering this, such as: https://kriesi.at/support/topic/removing-the-related-products-section/
However, before I searched here, I was looking at the CSS and adding.product_column_4 {display: none;}
seems to work for me.
Is there a recommended preferred approach to fixing this? Is the CSS method OK or should I revert to a functions.php solution?
Thanks!October 26, 2020 at 11:33 pm #1255924Hey xavbroadcast,
Please try in your child theme functions.php:
remove_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_output_related_products', 20);
If you need further assistance please let us know.
Best regards,
VictoriaOctober 28, 2020 at 10:50 am #1256313Hi Victoria,
Thanks, I have tried this after removing the CSS I had added but it doesn’t seem to work.
I’ve provided login details in the private section.
Also, is there any reason why the functions.php method would be preferred to the CSS which I tried which seems to work? I don’t mind whichever I use, but if there’s a technical reason to prefer one approach over the other, it would be good to know.Regards,
XavOctober 28, 2020 at 8:56 pm #1256493Hi Xav,
Credentials did not work for me. Could you please update the credentials?
It’s better to do it in the php code, the server will have to work less and the browser too :) They will not have to gather the data and render that part.
Best regards,
VictoriaOctober 28, 2020 at 10:17 pm #1256527Details below Victoria.
Thank you!October 29, 2020 at 11:04 pm #1256908Hi xavbroadcast,
Can you please make that account admin? We cannot investigate anything like this.
Best regards,
VictoriaOctober 29, 2020 at 11:26 pm #1256916Apologies. Admin now!
October 29, 2020 at 11:58 pm #1256934Hi xavbroadcast,
I added the code for you:
add_action( 'wp_head', 'remove_my_wc_action' ); function remove_my_wc_action () { remove_action( 'woocommerce_after_single_product_summary', 'avia_woocommerce_output_related_products', 20); }
Please check.
Best regards,
VictoriaOctober 30, 2020 at 12:08 pm #1257024Many thanks Victoria, all good now, I feel silly realising the function hadn’t been defined!
October 30, 2020 at 6:10 pm #1257088Hey xavbroadcast!
No, it’s not that :) It’s removing the action way earlier that helped.
Anyway, glad we got it working for you! :)
If you need further assistance please let us know.
Regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.