Magento – Multiple Actions for Single Coupon Code

Hello,

Recently in one of my project we had a requirements to supports multiple actions for single coupon code. For example if my my cart total is between 500 to 1000, the coupon should give flat 50 off discount and if total is more than 1000, coupon should give flat 100 off discount. But coupon code should be same.

We all know that magento only allows unique coupon code and each coupon will have only once action. So how to do this? I have explained it in this blog.  Please note that this solution needs changes in magento database. So only use it if you database very well.

So while looking to solve this issue. I found out that, in magento database there is a unique key defined for coupon code. So to solve this problem we have to remove that unique key.

So open your Magento database and run following SQL command.

ALTER TABLE salesrule_coupon DROP INDEX UNQ_SALESRULE_COUPON_CODE;

This will drop unique key index.

Now go back to magento admin panel and clear the cache and create two different shopping cart rules with different discounts and keep the coupon code same and it will work.

Hope this helps you.

This entry was posted in eCommerce, Magento, Magento Admin on by .

About Hiren Dave

Hiren Dave is a software engineer, blogger and consultant with over 9 years of professional experience. He writes code in number of languages. Hiren has a passion for developing web apps, mobile apps and writing books and blog articles about programming. He has a solid experience of startups as he manages products for few startups. He is also passionate about researching and learning new technologies and trends. He has also authored a book Instant Sencha Touch, published by Packt and creator of Video Course "Beginning Laravel" for Packt

Leave a Reply

Your email address will not be published. Required fields are marked *