cancel
Showing results for 
Search instead for 
Did you mean: 

Auto-gen coupon that expires 30 days after purchase

Auto-gen coupon that expires 30 days after purchase

If a customer buys product A, I would like to offer them a coupon code that allows them to get 10% off of a complementary item, product B. But, they must use the coupon within 30 days of the purchase of product A.

 

So, as an example, a customer buys an iPhone. After the purchase, they get an email that says "come back and buy an iPhone accessory and get 10% off, expires in 30 days". We don't sell iPhones, but this is just to illustrate the requirement.

 

 

I don't see where a specific coupon code can have its own expiration date. It looks like expiration dates are set on the rule, not the coupon code.

 

What's the best way to accomplish this?

 

Thanks!

5 REPLIES 5

Re: Auto-gen coupon that expires 30 days after purchase

Hi @shanetn,

 


That is correct. There is no way in Magento by default to auto-generate a coupon code for every new order.

 

In order to implement that feature, you should create an observer for the "place order" action. Then, that observer should run a custom code in order to generate a coupon code for that specific customer that expires 30 days from that specific time.

 

 

Best regards.
Gabriel

Welcome to the Magento Forums. Remember to introduce yourself and read the Magento Forums Guidelines.

Re: Auto-gen coupon that expires 30 days after purchase

We have Community 2.1.0 and I'm trying to figure out how to set a timeframe expiration date to auto-gen coupons. Right now we have coupons being auto-generated for customers who leave a review. How do I set it in Magento that these coupons expire 30 days after they are issued? 

Re: Auto-gen coupon that expires 30 days after purchase

Hi 

 

did you manage to sort this issue? Looking into the same think now 

 

thanks 

Re: Auto-gen coupon that expires 30 days after purchase

We never found a solution or worked on a customization.

Re: Auto-gen coupon that expires 30 days after purchase

Method 1:

1. Create a rule that gives a 10% discount on product B.
2. Set the rule's expiration date to 30 days after the purchase of product A.
3. Create a coupon code for the rule.
4. When a customer purchases product A, send them an email with the coupon code.

Method 2:

1. Create a custom extension that allows you to set expiration dates on individual coupon codes.
2. Create a coupon code for the discount with an expiration date of 30 days.
3. When a customer purchases product A, send them an email with the coupon code.

Method 3:

1. Integrate Magento with a third-party marketing automation platform, such as Klaviyo or Mailchimp.
2. Create a segment of customers who have purchased product A in the last 30 days.
3. Create a campaign that sends an email to these customers with a personalized coupon code for the discount.

Which method you choose will depend on your specific needs and budget.

If you are not comfortable with coding, you can hire a Magento developer to create a custom extension for you.

If you are on a tight budget, you can use one of the free or low-cost marketing automation platforms that integrate with Magento.

I hope this helps!  baby girl security blanket