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

#   Mandantory content in custom field on table item is not copied on renewal

##

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

Less More

- Posts: 8
- Thank you received: 1
-
-

5 years 5 months ago -  5 years 5 months ago [\#332859](#332859) by [sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")  *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#332859 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")* was created by *[sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")*

-- HikaShop version -- : 4.4.2
-- Joomla version -- : 3.1.2
-- PHP version -- : 7.4.18

We are since years a happy customer of hikashop and hikaserial ![:)](/media/kunena/emoticons/3.png ":)")
Lastly we added hikasubscription to our shop to provide some subscription services, obviously.

While configuring and testing the features we encountered a problen, that we could not solve so far:
We created a subscription plan and assigned it to a product.. The relation type is "creation then renewal".
Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.

The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.

Any idea of how to solve this?

We expect that any information (even from custom fields) gets copied to the renewal order.

Thanks in advance for your kind support and speedy help.

Sven Mitscherlich
CamModelTools

Last edit: 5 years 5 months ago by [sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzU4LWhpa2FzdWJzY3JpcHRpb24vOTAyNjMzLW1hbmRhbnRvcnktY29udGVudC1pbi1jdXN0b20tZmllbGQtb24tdGFibGUtaXRlbS1pcy1ub3QtY29waWVkLW9uLXJlbmV3YWw/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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

5 years 5 months ago [\#332877](#332877) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#332877 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")*

Hello,

What kind of "renewal" are you talking about ? An automatic (recurring) or a manual one ?

Regards,

---

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

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

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

Less More

- Posts: 8
- Thank you received: 1
-
-

5 years 5 months ago [\#332898](#332898) by [sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")  Replied by *[sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")* on topic *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#332898 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")*

At the moment we only want to use manual renewal.
During my tests this happens when I click on Renew in frontend in subscription listing.

The problem is, that the information in the field is needed to activate a temporary license for the usage of our software.

Thanks for your support.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzU4LWhpa2FzdWJzY3JpcHRpb24vOTAyNjMzLW1hbmRhbnRvcnktY29udGVudC1pbi1jdXN0b20tZmllbGQtb24tdGFibGUtaXRlbS1pcy1ub3QtY29waWVkLW9uLXJlbmV3YWw/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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

5 years 5 months ago [\#332915](#332915) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#332915 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")*

Hello,

The manual renewal do not use the original order (or its content) ; it just list the possible products which provide renewal for a subscription.
So there is not possibility of custom field management with manual renewals.

So for such configuration, you should use two products.
One for the creation (which will have your required custom field) and another for the renewal.
During the creation of the subscription, the content of your custom field should be copy into the subscription (via a custom plugin) so the information will persist there.
And the renewal will extend the subscription without changing the content of the subscription field.

Regards,

---

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

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

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

Less More

- Posts: 8
- Thank you received: 1
-
-

5 years 5 months ago [\#332929](#332929) by [sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")  Replied by *[sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")* on topic *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#332929 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")*

Thanks so far for guiding me in the right direction ![:)](/media/kunena/emoticons/3.png ":)")
Before I start to write a new plugin, I want to share my idea and questions.
Is it correct if I suppose that the event onBeforeSubscriptionUpdate gets fired while renewal (just before the reneval gets executed)?
Is it correct if I suppose thate the optimal event to get the information of my custom field is onSubscriptionActivation?

Where to store this data? In hikaserial_subscription.subscription_extradata?

If I understand the event handling right, then it might be possible to save the value of our custom field when the payment gets approved and the subscription gets activated. This would also make it possible to feed the field value to the new order created for renewal ...

If these assumptions are not correct then please give me some hints on how to implement that custom plugin. I have already read the corresponding technical documentation and tried to understand the both template plugins (acymailingsubscriber and groupsubscriber) but I have to admit that my native language is not php I speak and understand much better C# ... lol ...

Thanks again for your support
Sven Mitscherlich

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzU4LWhpa2FzdWJzY3JpcHRpb24vOTAyNjMzLW1hbmRhbnRvcnktY29udGVudC1pbi1jdXN0b20tZmllbGQtb24tdGFibGUtaXRlbS1pcy1ub3QtY29waWVkLW9uLXJlbmV3YWw/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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

5 years 5 months ago [\#332938](#332938) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#332938 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")*

Hello,

1 - Yes the trigger "onBeforeSubscriptionUpdate" is called before a subscription is modified.
From a manual modification in the backend, from a customer action, a renewal, etc.

2 - The trigger onSubscriptionActivation is triggered after an action on a subscription.
The trigger onAfterSubscriptionCreate will be better since it's before the creation of a subscription and you are sure that the subscription object is in creation state.
The activation trigger is made for all subscription modification on an active subscription (including renewals).

3 - Yes, the extradata is the best place to store extra information which will be kept in the subscription.
Extra data can be seen and modified in the backend and otherwise, be handled by plugins.
The system is flexible and allow you to store whatever you want.

4 - During the subscription creation, you have access to the order which made that creation possible, so you have access to its content, including the product and its custom field value.

The current subscription plugins are not working with custom field or products.
If you look at the HikaSerial order class, you will find the function "createOrderSubscription". That function create a subscription based on an order object. You'll see that the subscription receives an array of orders with just one order for its creation.
That object contains the full HikaShop order content, with the order products and custom fields.

I'm a C (and Asm) programmer at start ![:)](/media/kunena/emoticons/3.png ":)")

---

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

The following user(s) said Thank You: [sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")

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

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

Less More

- Posts: 8
- Thank you received: 1
-
-

5 years 5 months ago [\#332949](#332949) by [sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")  Replied by *[sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")* on topic *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#332949 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")*

Hello Jerome,
thanks for your help!! ... I think I can now start to implement my special plugin. I hope you don't mind if I continue to ask questions if any further problem comes up (hopefully not). I let you know how it works out and how far I came with my implementation.

> Jerome wrote: Hello,
> (...)
>
> I'm a C (and Asm) programmer at start ![:)](/media/kunena/emoticons/3.png ":)")
> (...)

Seems you like it the hard way ... back to the roots ![:)](/media/kunena/emoticons/3.png ":)"))

Greets
Sven

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

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

Less More

- Posts: 8
- Thank you received: 1
-
-

5 years 5 months ago [\#333015](#333015) by [sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")  Replied by *[sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")* on topic *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#333015 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")*

Hello Jerome,
... sorry, but I am a complet php noob ![:)](/media/kunena/emoticons/3.png ":)")
can you please put light on my knowledge and tell me please on how to access the order and the order_products objects within a plugin??
I tried as good as possible to find out but to no avail ... sry.

Again thanks in advance for your help
Sven

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzU4LWhpa2FzdWJzY3JpcHRpb24vOTAyNjMzLW1hbmRhbnRvcnktY29udGVudC1pbi1jdXN0b20tZmllbGQtb24tdGFibGUtaXRlbS1pcy1ub3QtY29waWVkLW9uLXJlbmV3YWw/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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

5 years 5 months ago [\#333016](#333016) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#333016 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")*

Hello,

> 4 - During the subscription creation, you have access to the order which made that creation possible, so you have access to its content, including the product and its custom field value.

If you take the onBeforeSubscriptionCreate trigger, you have the subscription object in parameter.
CF : [ www.hikashop.com/support/documentation/1...resubscriptioncreate](https://www.hikashop.com/support/documentation/125-hikaserial-developer.html#fct_onbeforesubscriptioncreate)

If you want to know the full content, the easier is to use a "var_dump" on the variable and you'll see the full content of the variable (object and sub objects).

Regards,

---

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

The following user(s) said Thank You: [sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")

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

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

Less More

- Posts: 8
- Thank you received: 1
-
-

5 years 5 months ago -  5 years 5 months ago [\#333035](#333035) by [sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")  Replied by *[sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")* on topic *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#333035 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")*

Hello Jerome,
thanks for the hint in the right direction. Now all is simple ![:)](/media/kunena/emoticons/3.png ":)") and is working like a charm!!

For the community and as a reference I share the php code of that little plugin. It is really easy to adapt it to any need.
Code:

&lt;?php /** * @author CamModelTools * @copyright (C) 2021-2021 CamModelTools. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); class plgHikaserial&lt;nameofplugin&gt; extends hikaserialPlugin { protected $type = 'ext'; protected $multiple = false; protected $name = '&lt;nameofplugin&gt;'; public function onBeforeSubscriptionCreate(&amp;$subscription, &amp;$do) { /* echo '&lt;pre&gt;'; var_dump($subscription-&gt;orders[0]-&gt;cart-&gt;products[0]-&gt;name_of_extra_field); echo '&lt;/pre&gt;'; */ $special_data = @$subscription-&gt;orders[0]-&gt;cart-&gt;products[0]-&gt;name_of_extra_field; if(!empty($special_data)) { if(empty($subscription-&gt;subscription_extradata)) $subscription-&gt;subscription_extradata = array(); $subscription-&gt;subscription_extradata['name_of_extra_field'] = $special_data; } } }

Replace **&lt;nameofplugin&gt;** with the name of the plugin; replace **name\_of\_extra\_field** with the name of your user defined field.

This boilerplate code works with user defined fields on item level.

I hope it will be of any help.
Thx
Sven

Last edit: 5 years 5 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: Little improvements

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzU4LWhpa2FzdWJzY3JpcHRpb24vOTAyNjMzLW1hbmRhbnRvcnktY29udGVudC1pbi1jdXN0b20tZmllbGQtb24tdGFibGUtaXRlbS1pcy1ub3QtY29waWVkLW9uLXJlbmV3YWw/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: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

5 years 5 months ago [\#333047](#333047) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Mandantory content in custom field on table item is not copied on renewal](/forum/58-hikasubscription/902633-mandantory-content-in-custom-field-on-table-item-is-not-copied-on-renewal#333047 "-- HikaShop version -- : 4.4.2 -- Joomla version -- : 3.1.2 -- PHP version -- : 7.4.18  We are since years a happy customer of hikashop and hikaserial :) Lastly we added hikasubscription to our shop to provide some subscription services, obviously.  While configuring and testing the features we encountered a problen, that we could not solve so far: We created a subscription plan and assigned it to a product.. The relation type is &quot;creation then renewal&quot;. Ordering a subscription of this product assignes a mandantory field (type text) to the ordered product which must be filled with licensing information by the customer.  The order and activation of this subscription works fine so far. But whenever we try to renew a subscription we face an error which states that information which is required for the product is missing. It displays the error message of our mandantory custom field.  Any idea of how to solve this?  We expect that any information (even from custom fields) gets copied to the renewal order.  Thanks in advance for your kind support and speedy help.  Sven Mitscherlich CamModelTools")*

Hello,

Thanks for the share !
I modified just a bit your code in ordre to improve the serialization of the extra data.

Please note that by using "products[0]" you're accessing the first product of the order.

Regards,

---

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

The following user(s) said Thank You: [sven.mitscherlich](/forum/user/58540-sven-mitscherlich "View sven.mitscherlich's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzU4LWhpa2FzdWJzY3JpcHRpb24vOTAyNjMzLW1hbmRhbnRvcnktY29udGVudC1pbi1jdXN0b20tZmllbGQtb24tdGFibGUtaXRlbS1pcy1ub3QtY29waWVkLW9uLXJlbmV3YWw/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.081 seconds

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