There are no pre-requisites in order for you to be able to implement this solution.
Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.
Need support with the snippet? We’re Here to Help You, Contact Us!
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.
Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.