close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Checkout not opening Payment Options if Shipping or Billing Country is not United States

Thread began 1/02/2018 8:37 am by joerg431091 | Last modified 1/02/2018 11:40 am by Ray Borduin | 3151 views | 8 replies |

joerg431091

Checkout not opening Payment Options if Shipping or Billing Country is not United States

Hello,

I just opened up several countries for shipping and billing options in the checkout section. My problem is that the checkout page is not changing/opening the Payment options if either the Shipping or the Billing Country is set to anything but the United States.

Any advice would be appreciated.

Thanks a lot and happy new year.

Joerg

Sign in to reply to this post

Ray BorduinWebAssist

I'd have to look at the page to debug this. There isn't enough information in the post to identify the problem. I'd at least need a url to see the code that doesn't' work. I may need FTP access if the problem is in the PHP.

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

joerg431091

Hi Ray,

Wow you are fast. Thanks a lot. I was just about to send an update.

Sorry I forgot the URL = www.navariniusa.com

I noticed that it does work if you put something into the State text field that opens up once a different country is chosen. So this information seems to be set to "required" although there is no asterisk on the state text field. Is there a way to not make the state field an requirement for countries outside the US.

Thanks again.
Joerg

Sign in to reply to this post

Ray BorduinWebAssist

If you attach a copy of the confirm_cart.php page I can show you what lines to update to make the state field not required for outside of the US.

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

joerg431091

Copy is attached. Update: Besides showing me how to make the field not required, can you also show me how to add an asterisk so I have both options in case I want to leave it required?

Thanks so much.
Joerg

Sign in to reply to this post

Ray BorduinWebAssist

You can update line 32 from:

$WAFV_Errors .= WAValidateRQ((isset($_POST["State"])?$_POST["State"]:"") . "",true,7);

to:
$WAFV_Errors .= WAValidateRQ((($_POST["Country"]=="US")?$_POST["State"]:"N/A") . "",true,7);

That will ignore the validation if the Country isn't set to US.

In order to keep the field required you would have to update the javascript file:
webassist/ecart/checkout/js/paymentoptions.js

You would comment out or remove these three lines:
var reqText = (reqIndex >= 0)?labelText.substring(reqIndex).replace(/"/g,"""):"";
stateLabel.attr("rel",reqText);
if (reqIndex >= 0) stateLabel.html(labelText.substring(0,reqIndex));

Then you would add this in its place:

newState.setAttribute("required","true");

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

joerg431091

Great. Thanks. Am I correct in that I have to do this also in line 42 accordingly?

Such as:
$WAFV_Errors .= WAValidateRQ((isset($_POST["State_2"])?$_POST["State_2"]:"") . "",true,16);

into:
$WAFV_Errors .= WAValidateRQ((($_POST["Country"]=="US")?$_POST["State_2"]:"N/A") . "",true,16);

Sign in to reply to this post

Ray BorduinWebAssist

Yes, but it should use Country_2 like:
$WAFV_Errors .= WAValidateRQ((($_POST["Country_2"]=="US")?$_POST["State_2"]:"N/A") . "",true,16);

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

joerg431091

Perfect as always!!!

Thanks so much and all the best for 2018!!!!

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