0

I'm attempting to remove the edit item link on the magento 2 checkout page. I have tried removing the block in checkout_cart_index.xml and checkout_cart_item_renderers.xml using the code below however this does not seem to work. Any help is appreciated.

<referenceBlock name="checkout.cart.item.renderers.simple.actions.edit" remove="true" />
4

In order to successfully remove the edit button for all products you need to remove the block for each product type like so:

<body>
    <referenceBlock name="checkout.cart.item.renderers.default.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.configurable.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.simple.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.virtual.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.giftcard.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.grouped.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.downloadable.actions.edit" remove="true"/>
    <referenceBlock name="checkout.cart.item.renderers.bundle.actions.edit" remove="true"/>
</body>

This can be done by extending 'public_html/vendor/magento/module-checkout/view/frontend/layout/checkout_cart_index.xml' into your theme:

public_html/app/design/frontend/[Vendor]/[theme]/Magento_Checkout/layout/checkout_cart_index.xml

1
  • this worked for me on 2.3.x – AJK May 12 '20 at 15:42
2

The suggested answers did not work for me (Magento 2.3). I ended up using this file:

app/design/frontend/[Vendor]/[theme]/Magento_Theme/layout/default.xml

The file looks like this:

    <?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page 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.item.renderers.default.actions.edit" remove="true"/>
        <referenceBlock name="checkout.cart.item.renderers.configurable.actions.edit" remove="true"/>
        <referenceBlock name="checkout.cart.item.renderers.simple.actions.edit" remove="true"/>
        <referenceBlock name="checkout.cart.item.renderers.virtual.actions.edit" remove="true"/>
        <referenceBlock name="checkout.cart.item.renderers.giftcard.actions.edit" remove="true"/>
        <referenceBlock name="checkout.cart.item.renderers.grouped.actions.edit" remove="true"/>
        <referenceBlock name="checkout.cart.item.renderers.downloadable.actions.edit" remove="true"/>
        <referenceBlock name="checkout.cart.item.renderers.bundle.actions.edit" remove="true"/>
    </body>
</page>
1

You may have to also target the default action to delete the edit link.

Inside checkout_cart_item_renderers.xml add the following code to remove the edit link:

app/design/frontend/vendor/theme/Magento_Checkout/layout/checkout_cart_item_renderers.xml

<body>
    <referenceBlock name="checkout.cart.item.renderers.default.actions.edit" remove="true" />
    <referenceBlock name="checkout.cart.item.renderers.simple.actions.edit" remove="true" />
</body>
1
  • I extended the checkout_cart_item_renderers.xml and added the two reference as stated above but nothing happens. I'm on magento 2.3. – Raphael Parent Jun 18 '19 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.