close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to add dynamic fields to cart and checkout?

Thread began 7/09/2020 11:56 pm by jurinski334466 | Last modified 7/14/2020 9:25 am by Ray Borduin | 633 views | 5 replies |

jurinski334466

How to add dynamic fields to cart and checkout?

Hi Ray,

I am trying to add editable name and email address fields to the cart based on the quantity of the item ordered. Users register for a course by adding a class to the cart. Often the person doing the registering is not the person actually attending the class. To avoid confusion and work spent identifying the actual attendee, I want to collect the name and email of the attendee at registration so I can send course materials, reminders, certificates etc. to the correct person. It would also be helpful to register more than one person per class at a time.

What I am trying to do is have each class in the cart show name and email fields that match the quantity ordered. I was thinking that the information would then be saved in a session variable and inserted using multiple inserts to an order/class/attendee table in the db when PayPal returns the payment confirmation and the orderdetails are inserted into the db. I don't know whether this is a feasible way to do this or whether there is a better way to do this. If you can recommend a saner way, I'd be happy to do that.

Per information gleaned from the tutorials and this forum, I have tried to do adding custom fields with the AddToCart Buttons. I tried to add additional fields using php using both includes and show/hide behavior in the cart. I had some success using javascript, but was unable to successfully tie the quantity field to the created rows. The javascript disabled the cart buttons and also didn't repeat successfully for each item in the cart. I thought it would be easier for the correct number of input fields to load when the cart loaded rather than rely on the user to add and complete the correct number of fields. But maybe it is easier to tie the quantity ordered to the rows of attendees using validation?

I am tripping over my own ignorance, so any help and advice you can offer toward making this work will be much appreciated!

Sign in to reply to this post

Ray BorduinWebAssist

It just isn't that easy to pull off what you are trying to do.

I think the easiest solution would be to add an email address and name column to your shopping cart. Then only allow them to add one attendee at a time and give them the name and email field to fill out in the add to cart form.

To allow a quantity field and dynamically show the correct number of fields would require some hand coding in either php or javascript. I could help with that in a premier support ticket if you want to go down that route.

Sign in to reply to this post
Did this help? Tips are appreciated...

jurinski334466

Thanks, Ray! That was somewhat of the conclusion I was coming to. Putting all the pieces together is a lot harder than it appears.

I'm not sure what you mean by this:
"I think the easiest solution would be to add an email address and name column to your shopping cart. Then only allow them to add one attendee at a time and give them the name and email field to fill out in the add to cart form."

Do you mean let the customer add more that one name and email to each order or one name and email to many individual orders? If you meant add more than one name and email to each order, what and where is the best way to do that?

I did add name and email columns to the add to cart buttons and to the cart, but I am not sure how to allow more than one name and email to be added per order.
Is there a setting in the ecart Object where I can set the cart up to accept multiple orders of the same class individually where the customer can then enter a different name for each order? Do I delete all the quantity fields?

It is not clear to me where in the process to I should add the updateable name and email text fields. Which page do the fields go on? On the registration page as part of the course description, so the fields must be filled in before the add to cart button is pressed? In the cart? Is the add to cart form you mentioned the form that places the button on the product page or are you referring to something else?

Sorry to be so dense...

Sign in to reply to this post

Ray BorduinWebAssist

I could help you with this in a 1 hour premier support ticket. Just call me using the number at the bottom of the site on Monday and I can set up screen sharing to walk you through what needs to be done.

Sign in to reply to this post
Did this help? Tips are appreciated...

jurinski334466

Thanks Ray! That will be perfect. I'll give you a call Monday morning.

Sign in to reply to this post

Ray BorduinWebAssist

I may have missed your call on Monday? Feel free to call at any time and we can schedule that appointment.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...