close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

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 jurinski334466 | 417 views | 5 replies


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!

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





Ease of use


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...