Could someone please point me in the right direction of how to add user editable fields into an e-commerce site. I need to have the users enter their prescription (for eye glasses) either before or after they have added a product to the cart.
There are multiple free format fields required for this, rather than using predefined Product attributes.
I'm using the excellent suite of Calguys E-commerce modules: Products, Orders, Cart, etc.
I've been trawling the forum all day and haven't found a solution yet. Even a pointer in the right direction would be excellent. Thanks
[Solved] E-commerce - how to add user editable fields
[Solved] E-commerce - how to add user editable fields
Last edited by chrisbt on Sat Dec 10, 2011 4:27 pm, edited 1 time in total.
Re: E-commerce - how to add user editable fields
I need to do a similar thing (allow the user to enter embroidery text to personalise garments). I've tried modifying the "AddToCart" template or using jQuery to change a dummy dropdown field (product attribute) to a <input type="text"> control but I get errors each time.
There must be a simpe way to do this....anyone?
There must be a simpe way to do this....anyone?
Re: E-commerce - how to add user editable fields
I've got round this problem by storing the personalised data into session cookies which I then dump into the Order Notes field at checkout.
Re: E-commerce - how to add user editable fields
Thanks for the update. I'll look to do something similar.
Re: E-commerce - how to add user editable fields
Can't you just use a custom field predefined drop down for left eye, right eye ?
Re: E-commerce - how to add user editable fields
He could have a drop down list of all prescription values e.g. +2, +1.5, +1, +0.5, 0, -0.5 etc. but I suspect he wants a free format text box like I needed.
Re: E-commerce - how to add user editable fields
Yes, is a mixture of predefined drop downs plus some free format fields. My issue is about how to store this data before the user has created a user account. It sounds like using cookies is the best option that is available this side of HTML5 unless there is any other options?
Re: E-commerce - how to add user editable fields
I've made a slight improvement to this solution.
- at the AddToCart stage I save all the user editable fields into a cookie.
- in Calguys Ecommerce Base > Supplier Settings, I append the cookie value (containing the user editable field values) onto the 'Line Item Description Template' that generates the 'summary' field for that item in the cart. Then in ViewCart I can access that data on a per item basis and format it as I wish.
- at the AddToCart stage I save all the user editable fields into a cookie.
- in Calguys Ecommerce Base > Supplier Settings, I append the cookie value (containing the user editable field values) onto the 'Line Item Description Template' that generates the 'summary' field for that item in the cart. Then in ViewCart I can access that data on a per item basis and format it as I wish.

Re: E-commerce - how to add user editable fields
Sorry, I'm just having trouble understanding where the 'summary' field is displayed or if I have it disabled how to enable it. I've put some dummy text in the 'Line Item Description Template' but can't see it appearing anywhere. Also, what code did you use to display the cookie value (I used jQuery). Many thanks, Stevechrisbt wrote:I've made a slight improvement to this solution.
- at the AddToCart stage I save all the user editable fields into a cookie.
- in Calguys Ecommerce Base > Supplier Settings, I append the cookie value (containing the user editable field values) onto the 'Line Item Description Template' that generates the 'summary' field for that item in the cart. Then in ViewCart I can access that data on a per item basis and format it as I wish.
Re: [Solved] E-commerce - how to add user editable fields
In the 'Cart - Add/Edit Viewcart Form Template' the summary field is referenced by: {$oneitem->summary}
In the 'Line Item Description Template' you can retrieve the cookie using: {$smarty.cookies.yourcookiename} (After it has been set using jquery)
Chris
In the 'Line Item Description Template' you can retrieve the cookie using: {$smarty.cookies.yourcookiename} (After it has been set using jquery)
Chris