Page 1 of 1

[Solved] E-commerce - how to add user editable fields

Posted: Thu Aug 25, 2011 4:34 pm
by chrisbt
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

Re: E-commerce - how to add user editable fields

Posted: Mon Sep 12, 2011 4:50 pm
by flatcap1
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?

Re: E-commerce - how to add user editable fields

Posted: Sat Sep 24, 2011 10:03 pm
by flatcap1
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

Posted: Mon Sep 26, 2011 9:14 am
by chrisbt
Thanks for the update. I'll look to do something similar.

Re: E-commerce - how to add user editable fields

Posted: Mon Sep 26, 2011 4:31 pm
by applejack
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

Posted: Mon Sep 26, 2011 4:55 pm
by flatcap1
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

Posted: Mon Sep 26, 2011 5:55 pm
by chrisbt
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

Posted: Sat Dec 10, 2011 4:27 pm
by chrisbt
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: E-commerce - how to add user editable fields

Posted: Mon Dec 12, 2011 12:46 pm
by flatcap1
chrisbt 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. :)
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, Steve

Re: [Solved] E-commerce - how to add user editable fields

Posted: Mon Dec 12, 2011 1:43 pm
by chrisbt
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