WooCommerce Remove Cross-Sells On Cart Page

Pre-Requisites

There are no pre-requisites in order for you to be able to implement this solution.

How To Implement This Solution?

Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.

About this Solution

To remove the cross-sell products which show in the cart, it’s a quick and simple one liner. Typically, cross-sells only show in the cart (using a default theme that is) so removing them here wouldn’t really make sense. However, in some contexts, you may wish to remove cross-sells from the cart if you’re displaying them elsewhere like on the product page. You may be using cross-sells for a different purpose like specific related products therefore showing them as cross-sells in the cart wouldn’t really make much sense. Hiding these using CSS would work but it’s not as efficient as actually ‘unsetting’ them using PHP. This way, the cross-sells aren’t hidden as such – they just aren’t there in the first place.

				
					/**
* Snippet Name:     Remove cross-sells on the cart page.
* Snippet Author:   ecommercehints.com
*/

remove_action( 'woocommerce_cart_collaterals', 'woocommerce_cross_sell_display' );
				
			

Snippet Benefits

  • Consolidate your cart page and remove distracting, alternative products.
  • Focus your users’ attention on proceeding to cart to become a paying customer rather than hanging around the product pages.
WooCommerce Conversion Rate Optimisation (CRO) eBook
100 WooCommerce Conversion Rate Optimisation Tips

Leave a Reply

If you are going to write code in the comments, please wrap it between code tags.

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

Other Recent Guides

Subscribe To Emails

Get exclusive WooCommerce tips that I only share with email subscribers

Join hundreds of other subscribers