3

I'd like to remove coupon code from the last step of the checkout "Payment and Review".

I have a custom theme with checkout_index_index.xml in Magento_Checkout/layout folder.

Thank you

8

Simply adding following tag

<item name="config" xsi:type="array">
    <item name="componentDisabled" xsi:type="boolean">true</item>
</item>

So Vendor/Module/view/frontend/layout/checkout_index_index.xml looks like

<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="steps" xsi:type="array">
                                <item name="children" xsi:type="array">
                                    <item name="billing-step" xsi:type="array">
                                        <item name="component" xsi:type="string">uiComponent</item>
                                        <item name="children" xsi:type="array">
                                            <item name="payment" xsi:type="array">
                                                <item name="children" xsi:type="array">
                                                    <item name="afterMethods" xsi:type="array">
                                                        <item name="children" xsi:type="array">
                                                            <item name="discount" 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>
                    </item>
                </item>
            </argument>
        </arguments>
    </referenceBlock>
</body>

  • There's no <item name="discount" xsi:type="array"> code in my file. – Chriss Jan 29 '17 at 16:25
  • You can found this tag 'Magento/SalesRule/view/frontend/layout/checkout_index_index.xml' here. – Sohel Rana Jan 29 '17 at 16:33
1

To remove the Apply Coupon Code Field at the checkout in Magento 2.3 add:

<item name="config" xsi:type="array">
<item name="componentDisabled" xsi:type="boolean">true</item>
</item>

in the checkout_index_index.xml file

vendor/magento/module-sales-rule/view/frontend/layout/checkout_index_index.xml

under the discount item

<item name="discount" xsi:type="array">

so it looks like

<item name="discount" xsi:type="array">
<item name="config" xsi:type="array">
<item name="componentDisabled" xsi:type="boolean">true</item>
</item>

have fun!

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.