close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

adding elements to the checkout form

Thread began 10/07/2015 10:47 am by Jamie | Last modified 10/15/2015 5:41 pm by Ray Borduin | 942 views | 19 replies |

Jamie

adding elements to the checkout form

Hey Ray

Have just added a couple of elements to the checkout process, one a drop down identifying which practice the customer is a customer of and the other is a check box which confirms that the customer has read the 'info about eye test'. The page can be seen here: http://clients.motley.site/friths/checkout.php

I have added 2 columns to the orders table: PracticeName and EyeTestConfirmation

Both are required elements IF the cart contains a contact lens product. If it doesn, the elements are not required

Question 1, I cant seem to get them to be required

Questi on 2, How do I go about adding both to the database as well as the confirmation email?

Thanks

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

Is there a a field in the cart you can check to identify if something is a contact lens? I imagine you have to loop through the cart and identify if a contact lens is present, and then add the "required" attribute to the fields if it is.

Form Elements added to this page should automatically be added to the persistent form. Please attach a copy of pp_confirm.php... you may need to adjust one line to maintain the new fields in the case of paypal express checkout.

Sign in to reply to this post

Jamie

pp_confirm attached

The only place that a product is referenced as a contac t lens or not is in the products table of the database (as 1 for yes and 0 for no) which is toggled on/off in the product_update.php page.... is there some way that that can be used?

Sign in to reply to this post

Ray BorduinWebAssist

Update line 25 of the pp_confirm.php page to:
$PPVals = $_SESSION["WASF_CheckoutWizard_NewFromBlank_Default"];

that way the new form elements will be carried over and can be referenced from the persistent form just like the current ones.

I'd probably add a column to the cart named "IsContact" and set it to that value from the database. That way you can just check the total of that column to determine if you make those fields required... if the total is greater than zero there is at least one contact lens.

Sign in to reply to this post

Jamie

do I update the validation code on the confirm_cart.php page to add the 2 new inputs?

i'll try the IsContact way you suggest

Thanks

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

You could, but probably the client validation is enough.

Sign in to reply to this post

Jamie

I had already add the client validation before and now updated the code as you suggested but neither field is stopping the form being submitted

Sign in to reply to this post

Ray BorduinWebAssist

url to reproduce?

Sign in to reply to this post

Jamie

Same one as in first post : http://clients.motley.site/friths/checkout.php

Sign in to reply to this post

Ray BorduinWebAssist

It looks like the checkbox is validating and not the select list. Add value="" to the first option in the select list and it should be validated too.

Sign in to reply to this post
loading

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