WordPress.org

Forums

WooCommerce - excelling eCommerce
Disable (remove) "related products" woocommerce 2.1.2 (10 posts)

  1. jcortes
    Member
    Posted 1 year ago #

    Does anyone know how I can remove the "related products" and the "additional information" tab? Any help will appreciated. Thanks.

    https://wordpress.org/plugins/woocommerce/

  2. monsterness
    Member
    Posted 1 year ago #

    Hey,

    I just did found this out this morning. Also busy working on a site.

    To remove the related products I added this to my functions.php

    remove_action( 'woocommerce_after_single_product_summary',
    'woocommerce_output_related_products', 20 );

    For the additional information tab I just had some info there because of my variations If you go to products > edit a product > properties.

    There you can uncheck: Show on product page.

    Hope this helps!
    (Ps: my shop is in dutch so tried translating it hopefully it will have these names in english)

  3. jcortes
    Member
    Posted 1 year ago #

    I really appreciate the help. The worked worked perfect to remove "related products". Do you know if there is a way to remove the "additional information" tab with code? I have about 400 products and I'm trying to avoid going one by one, I had code on woocomerce 2.0 that did the job and I would like something similar for woocomerce 2.1. Again, thank you so much.

  4. monsterness
    Member
    Posted 1 year ago #

    Hm, I'm not sure if this works maybe you can try this out:

    add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
    
    function woo_remove_product_tabs( $tabs ) {
        unset( $tabs['additional_information'] );  
    
        return $tabs;
    
    }

    This goes into your functions.php. Glad to be of help! Figuring it out piece by piece myself^^

  5. jcortes
    Member
    Posted 1 year ago #

    Worked just fine. Thanks for all your @monsterness

  6. donfre
    Member
    Posted 1 year ago #

    Thanks a million @monsterness just saved my rear big time.

  7. mimocloud
    Member
    Posted 1 year ago #

    wich funktion.php file???
    about wich directory we are talking about???

  8. Roy Ho
    Member
    Posted 1 year ago #

    @mimocloud - your theme's functions.php file. There is usually only one in the root folder of your theme.

  9. monsterness
    Member
    Posted 1 year ago #

    Hey guys, I just noticed I forgot to tell you or maybe you already know this but,

    When changing your theme always make sure you use your CHILD theme. This is so you keep your changes when upgrading your theme in the future.

    WordPress has a detailed explanation on how to do this. When putting changes in your function.php do not copy the file to your child. Just make a new function.php file in your child theme and put the code in there.

    This his how my child function.php looks

    <?php
    /**
     * Flatsome child functions and definitions
     *
     * @package flatsome
     */
    
    remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
    remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
    if ( is_home() ) {
         remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0);
         }
    remove_action( 'woocommerce_after_single_product_summary',
    'woocommerce_output_related_products', 20 );
    add_filter( 'wc_product_enable_dimensions_display', '__return_false' );
    
    add_filter('woocommerce_get_availability', 'availability_filter_func');
    
    ?>

    As you can see it only contains the code I added. The rest of the file get taken from the original theme file. Maybe you already know this but it's also for future people seeing this ! If I explained it poorly or have any questions do ask.

    Happy coding.

  10. HappyFhantum
    Member
    Posted 10 months ago #

    I was able to successfully remove the related products info at the bottom of my store pages...but I'm not able to get rid of the words, "Related Products." It's so strange. Any ideas?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.