Howdy folks,
Since the first execution of coupon codes in 1887 by Asa Griggs Candler to promote his company, Coca Cola. These simple coupon code marketing strategy became a game-changer for the Coca Cola Company and transformed it into “the most popular soft drink”. According to one survey, 68% of visitors will leave your store if you dont offer any coupon code or promotional offers. That’s the reason why the majority of companies are now focusing more on promoting their online sales rather than offline sales, and also focusing on increasing digital coupons. Today’s digital coupons are the best ways to generate revenue from your eCommerce site. eCommerce Digital coupons also work like as the traditional coupons work. They are basically aimed at getting customers by offering discounts and festive offers. Thus offering coupons to your customers can help your eCommerce store to grow rapidly. And Magento 2 is already equipped with this facility of providing coupon code to your customers.
While frontend customer checkout, your customer can easily apply coupon code before placing an order. But if you see this feature, it is available as a collapsed tab that sometimes can not be noticed easily. Because of that even if having coupon code your customer unable to find the option to apply while checkout and abandoned their cart. Instead, programmatically keep this collapsed tab open highlights coupon code box, and your customer can easily find and use code.
To do the same, you have to set the discount collapsible widget to true and you need to override two template files by creating a custom extension.
To do the same first we need to create a “checkout_cart_index.xml” file inside your custom extension using below code.
app/code/VENDOR/EXTENSION/view/frontend/layout/

Now you need to create one more file “coupon.phtml” at this path using following code.
app/code/VENDOR/EXTENSION/view/frontend/templates/cart/

That’s it. If you see the above “coupon.phtml” template file, we have modfified code from
to
After doing this, this custom extension will keep your coupon code box open without collapsing.
Lastly, if you found this blog helpful, don’t forget to share it with your colleagues and Magento Friends and Let us know if you are facing any issue while implementing this code.
Happy Coding!

[Total: 8   Average: 5/5]