🔥 Just Launched! Werra Premium Template for HyväSee it in Action

How to Move Apply Coupon to Sidebar in Magento 2 Checkout Page

By Sanjay JethvaUpdated on Mar 18, 2025 3 min read

The default Magento 2 checkout, though it is well developed, cannot be enough for every business requirements. There is always a room for improvement in checkout page to change its visual appeal and the flow.

So, whether it is for business requirements or improvements, you would want to try new things in Magento 2 checkout page.

One such example is to move apply coupon to side bar in Magento 2 checkout page.

Instead of offering the “apply coupon” in the payment section, the below solution lets you implement it in the shipping section as shown below:

How to Move Apply Coupon to Sidebar in Magento 2 Checkout Page

Rearranging the apply coupon can be easily done with this programmatic method:

Steps to Move Apply Coupon to Side Bar in Magento 2 Checkout Page:

1. Create registration.php file in app\code\[Vendor]\[Namespace]\

<?php
\Magento\Framework\Component\ComponentRegistrar::register(\Magento\Framework\Component\ComponentRegistrar::MODULE,
'[Vendor]_[Namespace]',
    __DIR__
);

2. Create module.xml file in app\code\[Vendor]\[Namespace]\etc

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="[Vendor]_[Namespace]" setup_version="1.0.0"/>
</config>

3. Create checkout_index_index.xml file in app\code\[Vendor]\[Namespace]\view\frontend\layout

<?xml version="1.0"?>
<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="discount" xsi:type="array">
                                                    <item name="component" xsi:type="string">Magento_SalesRule/js/view/payment/discount</item>
                                                    <item name="children" xsi:type="array">
                                                        <item name="errors" xsi:type="array">
                                                            <item name="sortOrder" xsi:type="string">0</item>
                                                            <item name="component" xsi:type="string">Magento_SalesRule/js/view/payment/discount-messages</item>
                                                            <item name="displayArea" xsi:type="string">messages</item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

That’s it.

Follow the above steps and you can offer the “Apply Coupon” button in the shipping section itself on the checkout page.

Please let me know if you have any doubts about the implementation. I’d be happy to help. Also, I would like to know how this solution helped you improve the checkout functionality in Magento 2 store.

I’d be grateful if you help me share this post to fellow developers via social media.

Thank you.

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.