I want to remove delete item button from cart page.

I am using below xml code to remove this but not working:-



<?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">
        <referenceBlock name="checkout.cart.item.renderers.default.actions.remove" remove="true"/>
        <referenceBlock name="checkout.cart.item.renderers.simple.actions.remove" remove="true"/>


Please help me to do this using xml and if my approach is not correct what is the right way to do this.

  • even when you try to directly remove that block from this file /vendor/magento/module-checkout/view/frontend/layout/checkout_cart_item_renderers.xml, it doesn't work. – Partab Saifuddin Zakir Dec 5 '19 at 16:58
  • your xml code is totally correct and also theme path is correct. i tried in my setup and successfully removed delete item button. – Naresh Rupareliya Dec 5 '19 at 17:45
  • @Naresh but It not working at my end, any help or suggestion, I am using 2.2.6 – Purushotam Sharma Dec 6 '19 at 6:44
  • also checked with 2.2.9 and working good there – Naresh Rupareliya Dec 6 '19 at 6:58

Override magento\module-checkout\view\frontend\templates\cart\item\default.phtml file in your theme at app\design\frontend\VENDOR\THEME_NAME\Magento_Checkout\templates\cart\item\default.phtml

Arround at line no 113 you will find following code

<tr class="item-actions">
    <td colspan="100">
        <div class="actions-toolbar">
            <?= /* @escapeNotVerified */ $block->getActions($_item) ?>

Remove or customize this code as per your requirement (Removing this code will remove delete button)

Note :- This code is working perfectly in magento 2.2.6

| improve this answer | |

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.