WooCommerce: Remove Cross-Sells @ Cart Page

A client wanted to completely remove the area on the Cart page where “cross-sells” show. This is helpful if you have dozens of products with cross-sells and you don’t want to go and edit each single page ๐Ÿ™‚

WooCommerce: remove cross-sells on the Cart page
WooCommerce: remove cross-sells on the Cart page

Remove Cross-Sells @ Cart Page – WooCommerce Snippet

Add the following snippet in your current theme’s function.php file. I strongly recommend to do this edits on a child theme – if you know what that is feel free to check my “I will create & install your child theme” service.


// Remove cross-sells at cart

remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );

Where to add this snippet?

You can place PHP snippets at the bottom of your child theme functions.php file (before "?>" if you have it). CSS, on the other hand, goes in your child theme style.css file. Make sure you know what you are doing when editing such files - if you need more guidance, please take a look at my free video tutorial "Where to Place WooCommerce Customization?"

Does this snippet (still) work?

Please let me know in the comments if everything worked as expected. I would be happy to revise the snippet if you report otherwise (please provide screenshots). I have tested this code with Storefront theme, the WooCommerce version listed above and a WordPress-friendly hosting on PHP 7+.

If you think this code saved you time & money, please join other Business Bloomer supporters and avail of 365 days of WooCommerce benefits. Thank you in advance :)

Need Help with WooCommerce Customization?

Check out these free video tutorials!

  • how-to-edit-woocommerce-with-php-snippets
  • woocommerce-hooks-add_action-list-visual
  • woocommerce-customize-single-product-page-PHP

Rodolfo Melogli

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as a WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

33 thoughts on “WooCommerce: Remove Cross-Sells @ Cart Page

  1. Thanks so much for the code. I have the Maxstore Pro Theme and it worked perfectly for me. I don’t mind having the cross sells on the product pages but to have it on the cart was forcing customers to scroll to much. They are at the check out page for a reason and i don’t want to distract them from clicking the “proceed to check out” button. This code you gave us is exactly what i needed!

    1. Awesome!

  2. Code still works Rodolfo. Running WooCommerce 3.6.2 and WP 5.2 on a Storefront theme.

    Thanks for this.

    1. Great!

  3. Hi Rodolfo, How can I hide product from shop but show it in cart as cross-sell. I need to unset other shipping methods than homedelivery if you choose pooltable installation and it seems to be fairly hard to do with woocommerce product addons. If I would make installation as products and only cross-sell those it would be easy to unsett shipping methods.

    1. I found a dirty way of doing it by creating a new category, excluding that category from shop
      then unset other shipping methods if that category is in cart and cross-sell it.

  4. Thanks for sharing… what a great resource this page is. I learned a lot. Any idea on how one can change the view of the cross-sells from list to grid? The rest of my site uses list, but it takes up way too much room on the cart page.
    Thanks for any insight you can offer

    1. Hello Randall, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here via the blog comments. Thanks a lot for your understanding! ~R

  5. Hi,

    You seem like a nice guy! ๐Ÿ™‚ Thanks for the snippet, but unfortunately it doesn’t work for me.
    I tried to put it on all places, and I also used the snippets you put in the comments but those doesn’t work either.

    I just want to have everything removed haha.

    Tom

    1. Hey Tom, thanks for your comment! It could be you’re using a custom theme and this default cross-sells code won’t work. Try for a second with a different theme and see if that works ๐Ÿ™‚

  6. Hi Rodolfo,

    Thanks so much for all the great examples! One issue I have is that the above code does not remove the default instance of the cross sells. It does correctly add the new instance at the bottom of the page, but now I have two separate cross sell boxes on the cart page…not ideal.

    Any thoughts what I can do to remove the default one?

    I’ve tried a CSS solution, but that removes both instances.

    Thanks!

    1. Hey Nick, thanks for your comment! It could be that you need to call the remove_action later on (after it has been added) – or that your theme is overriding the cross-sells and therefore you need to tweak the code accordingly. Hope this helps ๐Ÿ™‚

  7. Excellent – I recently migrated to WordPress/Wwoocommerce cart and this is one of the handful of little things that I needed to change. I thought it would be tricky but your blog made it simple and (best of all) it just worked first time. Nice tip!
    Cheers, Nick

    1. Brilliant, thank you Nick ๐Ÿ™‚

  8. Hi, thanks for your article, I’m wondering how I can add a single cross sell to all my products without going through each product separately and changing them in the WordPress admin. Do you know of a way to do this in bulk?
    Thanks

    1. Hey CK, thanks so much for your comment! Yes, this is possible – but unfortunately this is custom work and I cannot provide a complementary solution here on the blog. Thanks a lot for your understanding! ~R

  9. Hello Rodolfo!
    My problem is my cart layout doesn’t look like yours on the picture. But i would like it to be just like it-right now my cross-sells are under ths hipping calculator so it is kinda not seen by anyone. I would like it to be next to the calculator either on the right or left side.
    Thanks,
    Daniel

    1. Hey Dani! Thanks for your comment ๐Ÿ™‚ What theme are you using and can you also give us a link to your website? This would help! ~R

      1. Hey!
        http://www.dronkiraly.hu/ (test phase yet so dont be surprised:D)

        1. Thank you ๐Ÿ™‚ I will need to take a look at the Enfold theme files in order to give you a PHP fix. For now, you can use this (not ideal, but it works):

          
          // Enfold Theme CSS to Remove Cart Cross-Sells
          
          .woocommerce-cart .cross-sells {
          display: none !important
          }
          
          
          1. I mean i don’t want it removed, i just want it to be near the shipping calculator and not below it.
            Thanks,
            Daniel

            1. Hey Dani, for this I will need the Enfold theme files or at least to access your Cart page (broken at the moment) ๐Ÿ™‚

          2. Its good now. Yes, sure, i made you an account(emailed to bloomer mail) Thank you:)

            1. You’re trying to override cart.php there but it’s not necessary. You’ve probably broken a few things in the code as well ๐Ÿ™‚ Remove the Cart.php override and then I’ll see what I can do ๐Ÿ™‚

          3. Sure, did it ๐Ÿ™‚

            1. Looks better ๐Ÿ™‚ Here you go, you can do it via CSS, no need to use PHP:

              
              .cart-collaterals {
                  width: 50%;
                  float: right;
                  display: block;
              }
              
              .cart-collaterals .cart_totals {
              float:none;
              width: 100%
              }
              
              .cross-sells .cross-sells {
                  float: left;
                  width: 50%;
                  display: block;
                  padding-top: 0;
                  margin-top: 0;
                  border: 0;
              }
              
              
          4. O awesome, thanks alot man, you are great!!!:)

            1. ๐Ÿ™‚ You’re welcome!

  10. Hi Rodolfo As I have only recently relaunched my website http://www.brownbinrescue.ie as mobile optimised and powered by Woo I will want to see as many of these trusted snippets you selflessly share with us all. My site has a Related Product route which I think is much better than the above presentation which yes would drive a customer mad.

    Thanks Rodolfo
    Denis.

    1. Thank you Denis for the feedback – much appreciated! I love when you say “trusted snippets you selflessly share with us all”, I was never given such a compliment! It may become my new tagline ๐Ÿ™‚

  11. Thank you so much for sharing your knowledge with us! These snippets are very useful!!!

    1. And thank you so much for your comment ๐Ÿ™‚ Keep’em coming!

Questions? Feedback? Support? Leave your Comment Now!
_____

If you are writing code, please wrap it between: [php]code_here[/php]. Failure to complying with this (as well as going off topic) will result in comment deletion. You should expect a reply in about a week - this is a popular blog but I need to get paid work done first. Please consider joining #BloomerArmada to ask me 1-to-1 WooCommerce questions. Thank you :)

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.