0

How to remove product picture from checkout page in opc-block-summary block enter image description here

  • You want to using css??? – Mohit Patel May 24 '20 at 2:56
  • @MohitPatel No, I would like hidden ones not to depend on CSS. so that the server does not make unnecessary requests. – Alice May 24 '20 at 10:23
  • Search the .phtml file path using template path hints and remove/comment the code showing the image. – Bhaumik Upadhyay May 24 '20 at 10:43
  • @Alice - check below answer. It works for me. – Manashvi Birla May 28 '20 at 5:00
0

In your custom module directory, create the new file checkout_index_index.xml at below location:

<your_module_dir>/view/frontend/layout/checkout_index_index.xml

In this file, add the following:

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="sidebar" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="summary" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="cart_items" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="details" xsi:type="array">
                                                            <item name="children" xsi:type="array">
                                                                <item name="thumbnail" xsi:type="array">
                                                                    <item name="componentDisabled" xsi:type="boolean">true</item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>    

Result :

enter image description here

NOTE: If you have a custom theme, you can add the file checkout_index_index.xml at below location:

app/design/frontend/{Vendor Theme}/{Theme}/Magento_Checkout/layout/checkout_index_index.xml

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.