close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Preventing certain cities/countries from ordering

Thread begun 4/27/2010 10:10 am by toby379423 | Last modified 5/20/2010 10:25 pm by Jimmy Wu | 4846 views | 17 replies |

toby379423

Preventing certain cities/countries from ordering

Hi there,

Is there a way thru PowerStore (2) to prevent certain cities/states/countries from placing orders? Maybe using a zip code or something similar to block someone from finalizing an order? I know it's a strange request but something a client would like to do.

Thx

Sign in to reply to this post

Jimmy Wu

There is no built in functionality for this, but if you had Validation Toolkit or Form Builder, you can apply validation to check if the user has entered these cities, countries or states and prevent the order from going through.

Sign in to reply to this post

toby379423

As a matter of fact, I have Validation toolkit, is it pretty easy to do? I haven't used it in a while, is there a tutorial or something to guide me through the process?

Sign in to reply to this post

Jimmy Wu

What you can do is to apply client side validations to the different fields. You would want to add Restrict Content validation to it. The interface for adding the Restrict Content validation should be pretty easy to figure out.

Sign in to reply to this post

toby379423

Thanks for the info, it was quite easy to do but when I tested it out, nothing happened, the cities & zip codes don't show any errors while ordering and I am still able to go through the whole ordering precess. I added the Restrict Content behavior on the checkout.php page and chose onBlur. Is there something I'm missing?

checkout.php

Sign in to reply to this post

Jimmy Wu

Are you setting it up using client validation or server validation? I would recommend using the any form post as the trigger so that the values of the form will have been posted and can be validated.

Sign in to reply to this post

toby379423

I've set it up as client validation.

Forgive me but I'm not sure how to do it, but how would I go about using the any form post as the trigger?

Sign in to reply to this post

Jimmy Wu

Ah, sorry, that was only for if you were using Server Validations.

If you are applying the client validations through the behavior panel, you will have to add the Show Validation Errors at the end or the errors won't be displayed and the page will be submitted even with the errors.

Sign in to reply to this post

toby379423

Still not showing up...

Here's what I have on the checkout page (this is for the city entry on the form for the checkout page):

<span id="sprytextfield11" onfocus="WAAlertErrors('','We do not to ship to this region',true,false,false);return document.MM_returnValue">
<input name="city" type="text" id="city" onblur="if (document.getElementById('cityServerValidation')) document.getElementById('cityServerValidation').style.display='none';WAValidateRT(document.forms[1].city,document.forms[1].city.value,'- We do not ship to this region',' Jacksonville |, Tallahassee |, Indianapolis |, Cincinnati |, Memphis |',document.forms[1].city,0,true)" value="<?php echo((isset($_GET['valid']))?(ValidatedField("confirm","city")):$row_WAATKusers['UserCity']); ?>" />
<span class="textfieldRequiredMsg">Please enter the city where your statement is sent.</span></span>

I chose "onBlur" to restrict content and "onFocus" to show validation errors. I'm not sure exactly how to do this correctly, as this obviously isn't set up correctly. Could you possibly give a step-by-step guide to doing this?

Sign in to reply to this post

Jimmy Wu

If you put the WAAlertErrors call on the onfocus, the call will be made before the onblur of the form elements. You would want to put it in one of the events that happens after the onblur of the form element. You could even put the WAAlertErrors call right after the validation calls like this:

<input name="city" type="text" id="city" onblur="if (document.getElementById('cityServerValidation')) document.getElementById('cityServerValidation').st yle.display='none';WAValidateRT(document.forms[1].city,document.forms[1].city.value,'- We do not ship to this region',' Jacksonville |, Tallahassee |, Indianapolis |, Cincinnati |, Memphis |',document.forms[1].city,0,true)" value="<?php echo((isset($_GET['valid']))?(ValidatedField("confirm","city")):$row_WAATKus ers['UserCity']);WAAlertErrors('','We do not to ship to this region',true,false,false); ?>" />

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