You can place PHP snippets at the bottom of your child theme functions.php file (delete "?>" if you have it there). 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.3.
Check out these free video tutorials. You can learn how to customize WooCommerce without unnecessary plugins, how to properly configure the WooCommerce plugin settings and even how to master WooCommerce troubleshooting in case of a bug!
Business Bloomer Founder
Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent 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.
43 thoughts on “WooCommerce: Remove Cross-Sells @ Cart Page”
I put the code in my functions.php but it does not work anymore.
Thanks for your feedback! So it used to work? Are you able to pinpoint what happened on the site when it stopped working e.g. a third party plugin update?
Love the code snippets you provide, I have used quite a few of them already!
Just wondering if you would know how to HIDE certain products from the catalogue but, display them as cross sells at checkout ONLY.
For example, products A,B & C are included in shops inventory but, only product A is displayed in shop’s catalogue. When product A is placed in basket, products B & C are displayed at checkout as cross sells.
Thanks in advance
Hi there thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
“I will create & install your child theme” link doesn’t work anymore. Goes to a 404.
Thank you so much, now my cart page is seems clear without distraction
Is it possible to replace the cross-sells with recently viewed?
This would remove the hassle of setting up cross-sells and at the same time ensure customers on the cart page are only viewing something they’ve already shown interest in.
Any suggestions on how this could be achieved would be very much appreciated 🙂
Hey Jon-Paul, thanks so much for your comment! Yes, this is definitely possible, but I’m afraid it’s custom work. If you’d like to get a quote, feel free to contact me here. Thanks a lot for your understanding!
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!
Code still works Rodolfo. Running WooCommerce 3.6.2 and WP 5.2 on a Storefront theme.
Thanks for this.
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.
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.
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
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
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.
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 🙂
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.
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 🙂
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!
Brilliant, thank you Nick 🙂
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?
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
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.
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
https://www.dronkiraly.hu/ (test phase yet so dont be surprised:D)
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):
I mean i don’t want it removed, i just want it to be near the shipping calculator and not below it.
Hey Dani, for this I will need the Enfold theme files or at least to access your Cart page (broken at the moment) 🙂
Its good now. Yes, sure, i made you an account(emailed to bloomer mail) Thank you:)
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 🙂
Sure, did it 🙂
Looks better 🙂 Here you go, you can do it via CSS, no need to use PHP:
O awesome, thanks alot man, you are great!!!:)
🙂 You’re welcome!
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.
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 🙂
Thank you so much for sharing your knowledge with us! These snippets are very useful!!!
And thank you so much for your comment 🙂 Keep’em coming!