Magento 2 – How to Remove Summary from Shopping Cart

magento2shopping-cart

As the title says, how can I remove the summary to the right of the shopping cart in Magento 2?

I was hoping for a solution using XML Layout, but any solution will do (other than hiding it once its got to the client with CSS or Javascript).

Best Answer

Be careful with some answers on here, do not edit Magento's core files such as the blank theme! Always extend or overwrite them.

Extending the blank theme

To make your change without editing Magento's core files you will need to extend the blank theme. To do this create the following file:

app/design/frontend/**PACKAGE-NAME**/**THEME-NAME**/Magento_Checkout/layout/checkout_cart_index.xml

Removing the block

In here add the following code to remove the block:

<?xml version="1.0" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="cart.summary" remove="true" />
    </body>
</page>

Luma summary - cart page

Extra info

The original code responsible for rendering this block can be found in vendor/magento/theme-frontend-blank/Magento_Checkout/layout/checkout_cart_index.xml

I wouldn't advise removing the summary unless you're going to add some of the functionality back, it would make for a bad user experience especially as it removes the checkout button and extra pricing info.

Related Topic