1

I want to remove or hide the shipping in order summary like in the picture below, because it will always free shipping. How can i remove it? enter image description here

3
  • If you are using custom theme, one option is to hide it in your custom theme. just hide it using css. – Korbin Nov 13 '17 at 7:29
  • No i dont use custom theme. – Edwin Widhiyanto Nov 13 '17 at 7:37
  • then according to magento docs you should create a a new theme inheriting from Magento Blank or Luma. This is the simplest way available. devdocs.magento.com/guides/v2.0/frontend-dev-guide/css-guide/… Editing the core magento theme is not a good idea, since you changes will be overwritten by update – Korbin Nov 13 '17 at 7:41
0

Please check the path and use below code. This may help you.

vendor/magento/theme-frontend-blank/Magento_Checkout/layout/checkout_cart_index.xml
<referenceBlock name="shipping-information" display="false" />
1
  • The shipping method is still there, it's not work. – Edwin Widhiyanto Nov 13 '17 at 11:08
0

This price and Shipping carrier name is coming from JS file and not the PHTML file. you can find JS file at below location

/vendor/magento/module-checkout/view/frontend/web/js/view/summary/shipping.js

0

Disable shipping UI component thru XML layout file

override the XML file in your custom theme and disable the shipping component.

app/design/frontend/ThemeVendor/Theme/Magento_Checkout/layout/checkout_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          layout="1column" 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="totals" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <!--Remove fields-->
                                                            <item name="shipping" xsi:type="array">
                                                                <item name="config" xsi:type="array">
                                                                    <item name="componentDisabled" xsi:type="boolean">true</item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </argument>
                </arguments>
            </referenceBlock>
        </body>
    </page>

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.