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

#   Sync coupon date with subscription – HikaShop + HikaSerial

##

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

Less More

- Posts: 6
- Thank you received: 1
-
-

1 year 6 months ago [\#367098](#367098) by [giorgio73](/forum/user/27939-giorgio73 "View giorgio73's Profile")  *[Sync coupon date with subscription – HikaShop + HikaSerial](/forum/58-hikasubscription/909410-sync-coupon-date-with-subscription---hikashop-hikaserial#367098 "-- url of the page with the problem -- :   www.app-easy.it/  -- HikaShop version -- : 4.7.5 -- HikaSerial version -- : 4.0.2 -- Joomla version -- : 4 -- PHP version -- : 8.2.28  Dear HikaShop team,  we are using HikaShop 4.7.5 and HikaSerial 4.0.2 on Joomla 4 (PHP 8.2.28) and we would like to automatically assign the discount&#95;start and discount&#95;end dates of a coupon to the subscription generated by HikaSerial.  Our product (AE-TRAINING) is linked to a subscription pack, and we sometimes use 100% discount coupons to activate it. These coupons have start and end dates configured, and we would like the subscription to reflect that duration exactly.  We are trying to develop a custom plugin inside /plugins/hikashop/, but we are not sure which event is the right one. We initially tried onAfterOrderConfirm, but the subscription seems to be created by HikaSerial right after the order confirmation, and at that point we haven’t found a way to pass the custom dates.  We also checked onAfterSerialCreate, but at that stage the subscription is already created with the default 12-month period, and overwriting it feels like a workaround, not a clean solution.  Is there a proper way to intercept the process and inject those dates into the subscription before or during its creation? Should we use subscription&#95;extradata or pass values through $element-&gt;extraData or similar?  We’d really appreciate any guidance or suggestions on how to handle this correctly within a HikaShop plugin.  Best regards, Giorgio Antrone")* was created by *[giorgio73](/forum/user/27939-giorgio73 "View giorgio73's Profile")*

-- url of the page with the problem -- : [ www.app-easy.it/](https://www.app-easy.it/)
-- HikaShop version -- : 4.7.5
-- HikaSerial version -- : 4.0.2
-- Joomla version -- : 4
-- PHP version -- : 8.2.28

Dear HikaShop team,

we are using HikaShop 4.7.5 and HikaSerial 4.0.2 on Joomla 4 (PHP 8.2.28) and we would like to automatically assign the discount_start and discount_end dates of a coupon to the subscription generated by HikaSerial.

Our product (AE-TRAINING) is linked to a subscription pack, and we sometimes use 100% discount coupons to activate it. These coupons have start and end dates configured, and we would like the subscription to reflect that duration exactly.

We are trying to develop a custom plugin inside /plugins/hikashop/, but we are not sure which event is the right one. We initially tried onAfterOrderConfirm, but the subscription seems to be created by HikaSerial right after the order confirmation, and at that point we haven’t found a way to pass the custom dates.

We also checked onAfterSerialCreate, but at that stage the subscription is already created with the default 12-month period, and overwriting it feels like a workaround, not a clean solution.

Is there a proper way to intercept the process and inject those dates into the subscription before or during its creation? Should we use subscription_extradata or pass values through $element-&gt;extraData or similar?

We’d really appreciate any guidance or suggestions on how to handle this correctly within a HikaShop plugin.

Best regards,
Giorgio Antrone

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

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

Less More

- Posts: 6
- Thank you received: 1
-
-

1 year 6 months ago [\#367104](#367104) by [giorgio73](/forum/user/27939-giorgio73 "View giorgio73's Profile")  Replied by *[giorgio73](/forum/user/27939-giorgio73 "View giorgio73's Profile")* on topic *[Sync coupon date with subscription – HikaShop + HikaSerial](/forum/58-hikasubscription/909410-sync-coupon-date-with-subscription---hikashop-hikaserial#367104 "-- url of the page with the problem -- :   www.app-easy.it/  -- HikaShop version -- : 4.7.5 -- HikaSerial version -- : 4.0.2 -- Joomla version -- : 4 -- PHP version -- : 8.2.28  Dear HikaShop team,  we are using HikaShop 4.7.5 and HikaSerial 4.0.2 on Joomla 4 (PHP 8.2.28) and we would like to automatically assign the discount&#95;start and discount&#95;end dates of a coupon to the subscription generated by HikaSerial.  Our product (AE-TRAINING) is linked to a subscription pack, and we sometimes use 100% discount coupons to activate it. These coupons have start and end dates configured, and we would like the subscription to reflect that duration exactly.  We are trying to develop a custom plugin inside /plugins/hikashop/, but we are not sure which event is the right one. We initially tried onAfterOrderConfirm, but the subscription seems to be created by HikaSerial right after the order confirmation, and at that point we haven’t found a way to pass the custom dates.  We also checked onAfterSerialCreate, but at that stage the subscription is already created with the default 12-month period, and overwriting it feels like a workaround, not a clean solution.  Is there a proper way to intercept the process and inject those dates into the subscription before or during its creation? Should we use subscription&#95;extradata or pass values through $element-&gt;extraData or similar?  We’d really appreciate any guidance or suggestions on how to handle this correctly within a HikaShop plugin.  Best regards, Giorgio Antrone")*

Update:
We’ve solved the issue by creating a custom HikaShop plugin using the onBeforeSubscriptionCreate trigger from HikaSerial. It now automatically assigns the coupon start/end dates to the subscription. Thanks!

The following user(s) said Thank You: [Jerome](/forum/user/80-jerome "View Jerome's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzU4LWhpa2FzdWJzY3JpcHRpb24vOTA5NDEwLXN5bmMtY291cG9uLWRhdGUtd2l0aC1zdWJzY3JpcHRpb24tLS1oaWthc2hvcC1oaWthc2VyaWFsP3RtcGw9bWFya2Rvd24=) 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?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

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

Time to create page: 0.057 seconds

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