Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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!

    #1255924

    Hey 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,
    Victoria

    #1256313

    Hi 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,
    Xav

    #1256493

    Hi 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,
    Victoria

    #1256527

    Details below Victoria.
    Thank you!

    #1256908

    Hi xavbroadcast,

    Can you please make that account admin? We cannot investigate anything like this.

    Best regards,
    Victoria

    #1256916

    Apologies. Admin now!

    #1256934

    Hi 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,
    Victoria

    #1257024

    Many thanks Victoria, all good now, I feel silly realising the function hadn’t been defined!

    #1257088

    Hey 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

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