1

How to remove up sell and cross sell product from the cart page. (you may also like block) I added below code in my app/design/frontend/Custom/Theme/Magento_Checkout/layout/checkout_cart_index.xml file but when I click view cart page I am getting 500 error.

<referenceBlock name="checkout.cart.upsell" remove="true"/>
<referenceBlock name="checkout.cart.crosssell" remove="true"/>

Please help

PЯINCƎ
  • 11,669
  • 3
  • 25
  • 80
GeorgeM
  • 109
  • 2
  • 14

1 Answers1

1

There is no Upsells in cart but Crosssells instead.

Up-Sell : offered to the customer as a pricier or higher-quality alternative to the product the customer is looking at.

Cross-Sell : "impulse-buy" products appear next to the shopping cart as cross-sells to the items already in the shopping cart.

To remove that crosssells from cart :

app/design/frontend/Custom/Theme/Magento_Checkout/layout/checkout_cart_index.xml

<?xml version="1.0"?>

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.cart.crosssell" remove="true"/>
    </body>
</page>

Don't forget to clean a cache : php bin/magento cache:clean

PЯINCƎ
  • 11,669
  • 3
  • 25
  • 80
  • Thanks for the solution, I have one more question how to remove Upsells from product details page. i added below code in the

    app/design/frontend/Tristar/custom/Magento_Catalog/layout/catalog_product_view.xml and not working

    – GeorgeM Oct 28 '18 at 13:23
  • The code looks good, run this : php bin/magento cache:clean, php bin/magento cache:flush, php bin/magento setup:static-content:deploy -f – PЯINCƎ Oct 28 '18 at 13:43
  • After i make this change i am getting 500 error – GeorgeM Oct 28 '18 at 17:58
  • Looks like this issue is related to Google Tag Manager Module comes with Magento. based on this post https://magento.stackexchange.com/questions/212572/getloadedproductcollection-on-boolean-module-google-tag-manager I disable the GTM then the page working as expected. – GeorgeM Oct 29 '18 at 13:44