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

#   How to collect information when serial is consumed

##

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

Less More

- Posts: 33
- Thank you received: 0
-
-

11 years 8 months ago -  11 years 8 months ago [\#194759](#194759) by [suew](/forum/user/32859-suew "View suew's Profile")  *[How to collect information when serial is consumed](/forum/15-general-talk-about-hikaserial/875675-how-to-collect-information-when-serial-is-consumed#194759 "How to collect required data from customer when they consume a serial supplied on a voucher? What I want to do is require the customer to enter some information after they have entered their serial number. Can this be done through custom fields?  I have used custom item fields and categories so that this information is collected when a certain product is ordered online.  The problem is that I want to require the customer to also enter and consume the consume voucher serial number which was supplied at an earlier time.  Is this possible?")* was created by *[suew](/forum/user/32859-suew "View suew's Profile")*

How to collect required data from customer when they consume a serial supplied on a voucher?
What I want to do is require the customer to enter some information after they have entered their serial number.
Can this be done through custom fields?

I have used custom item fields and categories so that this information is collected when a certain product is ordered online.

The problem is that I want to require the customer to also enter and consume the consume voucher serial number which was supplied at an earlier time.

Is this possible?

Last edit: 11 years 8 months ago by [suew](/forum/user/32859-suew "View suew's Profile"). Reason: additional explanation

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

11 years 8 months ago [\#194792](#194792) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How to collect information when serial is consumed](/forum/15-general-talk-about-hikaserial/875675-how-to-collect-information-when-serial-is-consumed#194792 "How to collect required data from customer when they consume a serial supplied on a voucher? What I want to do is require the customer to enter some information after they have entered their serial number. Can this be done through custom fields?  I have used custom item fields and categories so that this information is collected when a certain product is ordered online.  The problem is that I want to require the customer to also enter and consume the consume voucher serial number which was supplied at an earlier time.  Is this possible?")*

Hi,

When you consume a serial, you can send some data which would be store in the serial "extra data".
If you want the fields be required, the best is to have a consume plugin which will refuse the serial to be consume if the extra data field is empty.

Some of the HikaSerial plugins already do things like that, like the "point consumer" plugin which refuse the consumption of a serial which could alter the "points" value that the "point generator" store in the extra data.
In your case, the filtering is the opposite but the way to add the feature is the same.

After that, to add the input in the consume page, the best is to use some view override. So the fields will be display in the consume menu and consume module.

Let me know if you need more details about a specific point.

Regards,

---

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

The following user(s) said Thank You: [suew](/forum/user/32859-suew "View suew's Profile")

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

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

Less More

- Posts: 33
- Thank you received: 0
-
-

11 years 8 months ago [\#195624](#195624) by [suew](/forum/user/32859-suew "View suew's Profile")  Replied by *[suew](/forum/user/32859-suew "View suew's Profile")* on topic *[How to collect information when serial is consumed](/forum/15-general-talk-about-hikaserial/875675-how-to-collect-information-when-serial-is-consumed#195624 "How to collect required data from customer when they consume a serial supplied on a voucher? What I want to do is require the customer to enter some information after they have entered their serial number. Can this be done through custom fields?  I have used custom item fields and categories so that this information is collected when a certain product is ordered online.  The problem is that I want to require the customer to also enter and consume the consume voucher serial number which was supplied at an earlier time.  Is this possible?")*

Hi Jerome,

Thanks for your excellent reply. I basically understand what you are suggesting but am not sure how to go about creating the new consumer plugin to refuse to consume the serial if the extra data field is empty. I have read the developer information "How to create a HikaSerial plugin but not quite sure how to do it. Can you provide a bit more explanation.

Many thanks,
Sue

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

11 years 8 months ago -  11 years 8 months ago [\#195691](#195691) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How to collect information when serial is consumed](/forum/15-general-talk-about-hikaserial/875675-how-to-collect-information-when-serial-is-consumed#195691 "How to collect required data from customer when they consume a serial supplied on a voucher? What I want to do is require the customer to enter some information after they have entered their serial number. Can this be done through custom fields?  I have used custom item fields and categories so that this information is collected when a certain product is ordered online.  The problem is that I want to require the customer to also enter and consume the consume voucher serial number which was supplied at an earlier time.  Is this possible?")*

Hi,

The easier is to use the trigger "onBeforeSerialConsume", something like that Code:

public function onBeforeSerialConsume(&amp;$serial, $user_id, &amp;$do, &amp;$extra_data) { // We check the required extra data if(empty($extra_data) &#124;&#124; empty($extra_data['required_value'])) { // abort the consumption $do = false; $app = JFactory::getApplication(); $app-&gt;enqueueMessage('message to indicate that the field is missing'); } }

Regards,

---

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

Last edit: 11 years 8 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: fix code

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

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

Less More

- Posts: 33
- Thank you received: 0
-
-

11 years 8 months ago [\#195724](#195724) by [suew](/forum/user/32859-suew "View suew's Profile")  Replied by *[suew](/forum/user/32859-suew "View suew's Profile")* on topic *[How to collect information when serial is consumed](/forum/15-general-talk-about-hikaserial/875675-how-to-collect-information-when-serial-is-consumed#195724 "How to collect required data from customer when they consume a serial supplied on a voucher? What I want to do is require the customer to enter some information after they have entered their serial number. Can this be done through custom fields?  I have used custom item fields and categories so that this information is collected when a certain product is ordered online.  The problem is that I want to require the customer to also enter and consume the consume voucher serial number which was supplied at an earlier time.  Is this possible?")*

Thanks Jerome. I will give it a try.
You do a great job and are greatly appreciated.

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

11 years 8 months ago [\#195725](#195725) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How to collect information when serial is consumed](/forum/15-general-talk-about-hikaserial/875675-how-to-collect-information-when-serial-is-consumed#195725 "How to collect required data from customer when they consume a serial supplied on a voucher? What I want to do is require the customer to enter some information after they have entered their serial number. Can this be done through custom fields?  I have used custom item fields and categories so that this information is collected when a certain product is ordered online.  The problem is that I want to require the customer to also enter and consume the consume voucher serial number which was supplied at an earlier time.  Is this possible?")*

Thanks ![:)](/media/kunena/emoticons/3.png ":)")

(I just realized that there was a little mistake in my code so I edited my previous message to fix it).

---

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

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

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

Less More

- Posts: 33
- Thank you received: 0
-
-

11 years 7 months ago [\#196342](#196342) by [suew](/forum/user/32859-suew "View suew's Profile")  Replied by *[suew](/forum/user/32859-suew "View suew's Profile")* on topic *[How to collect information when serial is consumed](/forum/15-general-talk-about-hikaserial/875675-how-to-collect-information-when-serial-is-consumed#196342 "How to collect required data from customer when they consume a serial supplied on a voucher? What I want to do is require the customer to enter some information after they have entered their serial number. Can this be done through custom fields?  I have used custom item fields and categories so that this information is collected when a certain product is ordered online.  The problem is that I want to require the customer to also enter and consume the consume voucher serial number which was supplied at an earlier time.  Is this possible?")*

Hi Jerome. Hope all is well in your world.

I have done a view override of the consume page and included the extra data fields to collect information from the customer.
These are showing on the front end but the data is not being saved to the extra serial data fields. Can you give me some hints about how to correct this?

Thank for all you do.

Sue

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

11 years 7 months ago -  11 years 7 months ago [\#196380](#196380) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How to collect information when serial is consumed](/forum/15-general-talk-about-hikaserial/875675-how-to-collect-information-when-serial-is-consumed#196380 "How to collect required data from customer when they consume a serial supplied on a voucher? What I want to do is require the customer to enter some information after they have entered their serial number. Can this be done through custom fields?  I have used custom item fields and categories so that this information is collected when a certain product is ordered online.  The problem is that I want to require the customer to also enter and consume the consume voucher serial number which was supplied at an earlier time.  Is this possible?")*

Hi,

Would it be possible to have more details about how you set the extra data fields in your form ?

In our documentation (which would require some improvements), there is a little part which give information about the serial extra data during the consumption :
[ www.hikashop.com/support/documentation/1...onsume-features.html](http://www.hikashop.com/support/documentation/138-consume-features.html)

> The webservice is compatible with html POST request.
> So you can make a post request to the url:
> index.php?option=com\_hikaserial&amp;ctrl=serial&amp;task=consume
> And give the rest of the parameters by POST ( hikaserial\[serial\_data\] / hikaserial\[format\] / hikaserial\[serial\_extra\_data\]\[\] )

When you submit data for the serial consumption, the extra data should have that "form" Code:

&lt;input type="text" value="" name="hikaserial[serial_extra_data][my_extra_data_field]" /&gt;

Regards,

---

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

Last edit: 11 years 7 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: replace code with quote

The following user(s) said Thank You: [suew](/forum/user/32859-suew "View suew's Profile")

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

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

Less More

- Posts: 33
- Thank you received: 0
-
-

11 years 7 months ago [\#196399](#196399) by [suew](/forum/user/32859-suew "View suew's Profile")  Replied by *[suew](/forum/user/32859-suew "View suew's Profile")* on topic *[How to collect information when serial is consumed](/forum/15-general-talk-about-hikaserial/875675-how-to-collect-information-when-serial-is-consumed#196399 "How to collect required data from customer when they consume a serial supplied on a voucher? What I want to do is require the customer to enter some information after they have entered their serial number. Can this be done through custom fields?  I have used custom item fields and categories so that this information is collected when a certain product is ordered online.  The problem is that I want to require the customer to also enter and consume the consume voucher serial number which was supplied at an earlier time.  Is this possible?")*

Hi Jerome,

Thanks very much for your help. Together we have solved my problem. You are wonderful!

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

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