How to Remove Cross-Sell Products Block
This tutorial will show you how to remove cross-sell products block that appears on the cart page in WooCommerce themes.
You should perform the following steps in order to remove it:
- Open the functions.php file located under the “wp-content/themes/theme_name” folder. Add the following code to the very end of the file:
Note, in case you are using a child theme you should make the changes to the functions.php file located under child theme folder. Usually, child theme folder name has “-child” suffix.
- In case the cross-sell products block still persists, please, open the “wp-content/themes/theme_name/inc/woocommerce-hooks.php” file. Find the following line of code:
- Near this line, you will see the line like the one below, which should be removed or commented out:
Note, in case you are using a child theme, you should copy the woocommerce-hooks.php file to the child theme folder preserving nested folders structure.
- Save the file, your cross-sell products block is removed. Refresh your cart page and see it in action!