Is there a way to save custom data inputted from a user to an order?
I'm wanting to save a "name" for a product along with a selection from a variant drop down box, the name will be inputted via a text box that a user can type in and then after the order is processed I'll be using that information to create a custom pdf. I would ideally like to be able to save it against each order rather than trying to develop a custom table to save data against.
You can add a text box to your add item box and then take that value and save it to the ExtendedDataCollection in the controller (which is basically a dictionary of string, string so you will need to come up with a key like "mysiteProductMessage" or whatever.
The extended data collections are passed from the basket, through out the checkout.
Alternatively you could add notes to the order during checkout depending on your needs.
Adding Custom fields for a product - Merchello
Hi,
Is there a way to save custom data inputted from a user to an order?
I'm wanting to save a "name" for a product along with a selection from a variant drop down box, the name will be inputted via a text box that a user can type in and then after the order is processed I'll be using that information to create a custom pdf. I would ideally like to be able to save it against each order rather than trying to develop a custom table to save data against.
Hey Michelle,
You can add a text box to your add item box and then take that value and save it to the ExtendedDataCollection in the controller (which is basically a dictionary of string, string so you will need to come up with a key like "mysiteProductMessage" or whatever.
The extended data collections are passed from the basket, through out the checkout.
Alternatively you could add notes to the order during checkout depending on your needs.
Thanks Rusty.
Managed to figure this out, forgot I had posted this ages ago, only just been approved on the forum!
Michelle
Hi Michelle,
Would you mind sharing your approach to adding custom product data?
Thanks,
--GS
Hi Greg,
Below is the code I used in the AddToBasket action:
Hope this helps
is working on a reply...