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

    #974882

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

    #974895

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

    #975003

    Hi,

    We will help you hide it with CSS, but disable the HTACCESS. We cant click back and forth to go through it.

    Best regards,
    Basilis

    #975152

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

    #975254

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

    #975274

    Hi Victoria,

    thanks for helping.

    I get a white page, when I upload my functions.php
    There might be a little code bug?

    Best regards,
    Dirk

    #975303

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

    #975314

    Hi Victoria,

    no – white page again :(
    My editor says there’s a code error in the line where the function starts?

    Best regards,
    Dirk

    #975416

    Hey!
    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!
    Peter

    #975667

    Hey,

    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,
    Dirk

    #975700

    Hi 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

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Remove WooCommerce "Related Products" from shop page’ is closed to new replies.