Sync coupon date with subscription – HikaShop + HikaSerial

  • Posts: 6
  • Thank you received: 1
4 days 4 hours ago #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_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->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 or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 1
3 days 14 hours ago #367104

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

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.053 seconds
Powered by Kunena Forum