[Skip to main content](#vessel-content)

#   Order based coupons

##

- **[khashiz](/forum/user/61259-khashiz "View khashiz's Profile")**
- [![khashiz's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/61259-khashiz "View khashiz's Profile") Topic Author
- [ Offline](/forum/user/61259-khashiz)

Less More

- Posts: 240
- Thank you received: 13
-
-

1 year 6 months ago [\#367156](#367156) by [khashiz](/forum/user/61259-khashiz "View khashiz's Profile")  *[Order based coupons](/forum/35-orders-management/909422-order-based-coupons#367156 "-- HikaShop version -- : 5.1.6 -- Joomla version -- : 5.3.0 -- PHP version -- : 8.2  Hi. i want to create an order based coupon. whenever an order is paid, an specific coupon i want to generate to put into orders notify email with limited time (for example 7 days after paymanet)  i now this is a customization but i only need some tips on how to develop it  can it be done with mass actions ?")* was created by *[khashiz](/forum/user/61259-khashiz "View khashiz's Profile")*

-- HikaShop version -- : 5.1.6
-- Joomla version -- : 5.3.0
-- PHP version -- : 8.2

Hi. i want to create an order based coupon.
whenever an order is paid, an specific coupon i want to generate to put into orders notify email with limited time (for example 7 days after paymanet)

i now this is a customization but i only need some tips on how to develop it

can it be done with mass actions ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwOTQyMi1vcmRlci1iYXNlZC1jb3Vwb25zP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

1 year 6 months ago [\#367159](#367159) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Order based coupons](/forum/35-orders-management/909422-order-based-coupons#367159 "-- HikaShop version -- : 5.1.6 -- Joomla version -- : 5.3.0 -- PHP version -- : 8.2  Hi. i want to create an order based coupon. whenever an order is paid, an specific coupon i want to generate to put into orders notify email with limited time (for example 7 days after paymanet)  i now this is a customization but i only need some tips on how to develop it  can it be done with mass actions ?")*

Hi,

You could use AcyMailing for that. It has an integration with HikaShop to automatically generate user specific coupons and send an email to the user with the coupon code after an order:
[ docs.acymailing.com/addons/joomla-add-ons/hikashop](https://docs.acymailing.com/addons/joomla-add-ons/hikashop)
That would save you a lot of time.

One alternative would be to use HikaSerial which has a coupon generator plugin:
[ www.hikashop.com/support/documentation/1...ugins-coupongen.html](https://www.hikashop.com/support/documentation/139-hikaserial-plugins-coupongen.html)
So you would add a serial pack with that coupon plugin configured to each product, and HikaSerial would then add a serial for each product of each order with the corresponding coupons generated. And the serials (coupon codes) would be included in the email sent to the customer after the payment.
However, it's less flexible than what you can do with AcyMailing, so it might not fit your purpose.

A final solution is to develop your own plugin. You would implement the onAfterOrderCreate or onAfterOrderUpdate event:
[ www.hikashop.com/support/documentation/6...l#onAfterOrderCreate](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#onAfterOrderCreate)
In there, you would check that you want to generate the coupon for the order being processed, generate the coupon with the save method of class.discount, and then trigger the sending of an email with the Joomla email API:
[ docs.joomla.org/Sending\_email\_from\_extensions](https://docs.joomla.org/Sending_email_from_extensions)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwOTQyMi1vcmRlci1iYXNlZC1jb3Vwb25zP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.040 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
