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

#   Possible to modify price onBeforeSubscriptionUpdate on a recurring subscription

##

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

Less More

- Posts: 88
- Thank you received: 20
-
-

4 years 3 months ago [\#343795](#343795) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  *[Possible to modify price onBeforeSubscriptionUpdate on a recurring subscription](/forum/58-hikasubscription/904829-possible-to-modify-price-onbeforesubscriptionupdate-on-a-recurring-subscription#343795 "-- HikaShop version -- : 4.6.1 -- HikaSerial version -- : 4.0.1 -- Joomla version -- : 4.1.5 -- PHP version -- : 8.0  Hi  When a recurring subscription is renewed with Hikaserial Subscription, it looks like it uses the first subscription as a &quot;master&quot; and copies the data from that. I have a special case where users are discounted if they have more than one active subscription. I can control the price using joomla user groups and create special prises for those groups in Hikashop. However, I have issues with renewal when they no longer meet the requirements for discount.  My case looks like this:  User buys first subscription. They are added to the &quot;tier 1&quot; user group. First subscription is now active. The recurring price remains the same.  User buys second subscription. User now have 2 active subscriptions. As the user is in &quot;tier 1&quot; user group, the user is discounted for the price of the second subscription. Second subscription is now active and recurring price is the discounted price.  Until now, everything is fine and works as intended.  My challenge is: User cancel the first subscription. User now have 1 active subscription and so remain in &quot;tier 1&quot; user group. But with only one active subscription, the price of the second subscription should no longer be discounted. But because user was discounted in the beginning, and that this subscription is used as a &quot;master&quot; for renewals, the price remains discounted.  I'm considering my options here.  E.g. could we have a toggle in Hikaserial subscription configuration to use plan price on every renewal instead of price of plan on purchase? Then the price of the subscription would always match the current plan and the prices set for the user groups. That would be best case scenario. Is this something you would consider?  Else, can I use onBeforeSubscriptionUpdate hook to modify the price?  Thanks")* was created by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")*

-- HikaShop version -- : 4.6.1
-- HikaSerial version -- : 4.0.1
-- Joomla version -- : 4.1.5
-- PHP version -- : 8.0

Hi

When a recurring subscription is renewed with Hikaserial Subscription, it looks like it uses the first subscription as a "master" and copies the data from that. I have a special case where users are discounted if they have more than one active subscription. I can control the price using joomla user groups and create special prises for those groups in Hikashop. However, I have issues with renewal when they no longer meet the requirements for discount.

My case looks like this:

User buys first subscription. They are added to the "tier 1" user group.
First subscription is now active. The recurring price remains the same.

User buys second subscription. User now have 2 active subscriptions. As the user is in "tier 1" user group, the user is discounted for the price of the second subscription. Second subscription is now active and recurring price is the discounted price.

Until now, everything is fine and works as intended.

My challenge is: User cancel the first subscription. User now have 1 active subscription and so remain in "tier 1" user group. But with only one active subscription, the price of the second subscription should no longer be discounted. But because user was discounted in the beginning, and that this subscription is used as a "master" for renewals, the price remains discounted.

I'm considering my options here.

E.g. could we have a toggle in Hikaserial subscription configuration to use plan price on every renewal instead of price of plan on purchase? Then the price of the subscription would always match the current plan and the prices set for the user groups. That would be best case scenario. Is this something you would consider?

Else, can I use onBeforeSubscriptionUpdate hook to modify the price?

Thanks

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

4 years 3 months ago [\#343809](#343809) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Possible to modify price onBeforeSubscriptionUpdate on a recurring subscription](/forum/58-hikasubscription/904829-possible-to-modify-price-onbeforesubscriptionupdate-on-a-recurring-subscription#343809 "-- HikaShop version -- : 4.6.1 -- HikaSerial version -- : 4.0.1 -- Joomla version -- : 4.1.5 -- PHP version -- : 8.0  Hi  When a recurring subscription is renewed with Hikaserial Subscription, it looks like it uses the first subscription as a &quot;master&quot; and copies the data from that. I have a special case where users are discounted if they have more than one active subscription. I can control the price using joomla user groups and create special prises for those groups in Hikashop. However, I have issues with renewal when they no longer meet the requirements for discount.  My case looks like this:  User buys first subscription. They are added to the &quot;tier 1&quot; user group. First subscription is now active. The recurring price remains the same.  User buys second subscription. User now have 2 active subscriptions. As the user is in &quot;tier 1&quot; user group, the user is discounted for the price of the second subscription. Second subscription is now active and recurring price is the discounted price.  Until now, everything is fine and works as intended.  My challenge is: User cancel the first subscription. User now have 1 active subscription and so remain in &quot;tier 1&quot; user group. But with only one active subscription, the price of the second subscription should no longer be discounted. But because user was discounted in the beginning, and that this subscription is used as a &quot;master&quot; for renewals, the price remains discounted.  I'm considering my options here.  E.g. could we have a toggle in Hikaserial subscription configuration to use plan price on every renewal instead of price of plan on purchase? Then the price of the subscription would always match the current plan and the prices set for the user groups. That would be best case scenario. Is this something you would consider?  Else, can I use onBeforeSubscriptionUpdate hook to modify the price?  Thanks")*

Hello,

Instead of creating a recurring system directly in HikaSerial, we preferred to include it in the HikaShop core (so other plugins/add-ons could use it too).
So the HikaSerial triggers won't help you for that specific task since HikaSerial will be called once the recurring sub-order is confirmed.

But you do have some HikaShop triggers which would help you, like :
onBeforeCreateRecurringSuborder

The recurring payment plugin you're using (bambora) is using that HikaShop API and use the special method "createRecurringSuborder" to create a new order by copying (more complicated than that) the original order.
It's what you called the "master" order.
Once that recurring order created, the payment plugin is doing its check-up and confirm the order ; that confirmation will perform the subscription renewal in HikaSerial.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzU4LWhpa2FzdWJzY3JpcHRpb24vOTA0ODI5LXBvc3NpYmxlLXRvLW1vZGlmeS1wcmljZS1vbmJlZm9yZXN1YnNjcmlwdGlvbnVwZGF0ZS1vbi1hLXJlY3VycmluZy1zdWJzY3JpcHRpb24/dG1wbD1tYXJrZG93bg==) 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.053 seconds

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