- Posts: 33
- Thank you received: 0
How to collect information when serial is consumed
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?
Please Log in or Create an account to join the conversation.
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 & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
The easier is to use the trigger "onBeforeSerialConsume", something like that
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
You do a great job and are greatly appreciated.
Please Log in or Create an account to join the conversation.
(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 & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
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 or Create an account to join the conversation.
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
When you submit data for the serial consumption, the extra data should have that "form"The webservice is compatible with html POST request.
So you can make a post request to the url:
index.php?option=com_hikaserial&ctrl=serial&task=consume
And give the rest of the parameters by POST ( hikaserial[serial_data] / hikaserial[format] / hikaserial[serial_extra_data][] )
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Thanks very much for your help. Together we have solved my problem. You are wonderful!
Please Log in or Create an account to join the conversation.