close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Digital products registration form at checkout

Thread began 5/07/2013 12:05 pm by danielsebas | Last modified 5/07/2013 12:16 pm by danielsebas | 414 views | 2 replies |

danielsebas

Digital products registration form at checkout

Hi my store is selling digital music, https:www.danielsanchezmusica.com I have some digital music for free, but when people go to checkout the option for registering as a new user is able with all the form for billing information, since the store is configured for simple registration and the product is free, I will like to supress from the checkout page the the billing info form. I managed to do it like this (please tell me if there is a better way to do it):

In the checkout_form.php file I put the billing information form between this conditional :

<?php if ($WA_Store_Cart->GrandTotal() > 0) { // show if product is not free ?>

<?php } // end conditional show if product is not free ?>

then at the bottom of the page I used the same conditional for the spry validation:

<?php if ($WA_Store_Cart->GrandTotal() > 0) { // show if product is not free ?>
var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "none", {validateOn:["blur"]});
var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "none", {validateOn:["blur"]});
var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "none", {validateOn:["blur"], maxChars:20, minChars:7});
var sprytextfield9 = new Spry.Widget.ValidationTextField("sprytextfield9", "none", {validateOn:["blur"], minChars:7, maxChars:20, isRequired:false});
var sprytextfield10 = new Spry.Widget.ValidationTextField("sprytextfield10", "none", {validateOn:["blur"]});
var sprytextfield11 = new Spry.Widget.ValidationTextField("sprytextfield11", "none", {validateOn:["blur"]});
var sprytextfield12 = new Spry.Widget.ValidationTextField("sprytextfield12", "none", {validateOn:["blur"], minChars:1, maxChars:10});
var spryselect3 = new Spry.Widget.ValidationSelect("spryselect3", {validateOn:["blur"]});
<?php } // end conditional show if product is not free ?>

Then in the process_transaction.php file I used this conditional to stop the server validation on line 183:

if ($WA_Store_Cart->GrandTotal() > 0) { // show if product is not free
$WAFV_Errors .= WAValidateRQ(((isset($_POST["firstname"]))?$_POST["firstname"]:"") . "",true,12);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["lastname"]))?$_POST["lastname"]:"") . "",true,13);
$WAFV_Errors .= WAValidatePN(((isset($_POST["phone"]))?$_POST["phone"]:"") . "",false,true,true,14);
$WAFV_Errors .= WAValidatePN(((isset($_POST["fax"]))?$_POST["fax"]:"") . "",false,true,false,15);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["street1"]))?$_POST["street1"]:"") . "",true,16);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["city"]))?$_POST["city"]:"") . "",true,17);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["postcode"]))?$_POST["postcode"]:"") . "",false,19);
$WAFV_Errors .= WAValidateRQ(((isset($_POST["country"]))?$_POST["country"]:"") . "",true,20);
} // end conditional show if product is not free

Is there a better and simplest way to do it?
Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

That is the correct way to do this.

Sign in to reply to this post

danielsebas

Thank you Jason for your quick reply!

Sign in to reply to this post

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