1

I tried to hide the Postcode (zipp) field in the cart in the block shipping costs but nothing is working. The name of the DIV is 'shippingAddress.postcode'.

Hide with CSS is not working and also some jquery in a block does not work.

1 Answer 1

1

Just placed this file under Magento_Checkout/layout/ in your active theme. If you want to do this with module then place it under view/frontend/layout.

checkout_cart_index.xml

<?xml version="1.0"?>
 <page layout="1column" 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.shipping">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="block-summary" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="block-shipping" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="address-fieldsets" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="postcode" 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>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

Let me know if you need further help :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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