Results 1 to 3 of 3
  1. #1
    Join Date
    May 2010
    Posts
    2
    Plugin Contributions
    0

    Default Validate registration based on postal code?

    Hi There,

    Sorry if this is somewhere else, but I have been searching and unable to find an answer.

    Is there a way to validate registration based on postal code? I know you can set up zones, but they are really large areas and my company does delivery within a very local area. We don't sell anywhere else and I would rather restrict registration based on a set number of postal code.

    thanks in advance for any help you can provide.

    Cheers
    Sandra

    www.glutenfreegeneralstore.ca

  2. #2
    Join Date
    Mar 2011
    Posts
    24
    Plugin Contributions
    0

    Default Re: Validate registration based on postal code

    Hello,

    I am also looking for something like this. Is there a answer?

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,870
    Plugin Contributions
    96

    Default Re: Validate registration based on postal code?

    You can edit/create /includes/modules/YOUR_TEMPLATE/create_account.php to implement this functionality. Look for the following code fragment:

    Code:
      if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
        $error = true;
        $messageStack->add('create_account', ENTRY_POST_CODE_ERROR);
      }
    and change it to:

    Code:
      if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
        $error = true;
        $messageStack->add('create_account', ENTRY_POST_CODE_ERROR);
      } else {
        if (!defined(ENTRY_POST_CODE_NO_DELIVER)) {
          define('ENTRY_POST_CODE_NO_DELIVER', "Sorry, we are not accepting accounts in your zip-code at this time.");
        }
        if (!defined(ENTRY_POSTCODE_LIST)) {
          define('ENTRY_POSTCODE_LIST', 'comma-separated list of zip-codes, no spaces');
        }
        if (!in_array($postcode,explode(',', ENTRY_POSTCODE_LIST))) {
          $error = true;
          $messageStack->add('create_account', ENTRY_POST_CODE_NO_DELIVER);
        }
      }
    Just set the ENTRY_POSTCODE_LIST variable to contain the list of zip-codes that your store supports ... and make sure that you make it clear to potential customers that you only support accounts for customers in those zip-codes!

 

 

Similar Threads

  1. Free Shipping Based on Postal Code Zone?
    By wintercard in forum Addon Shipping Modules
    Replies: 20
    Last Post: 22 Jun 2011, 02:25 PM
  2. Zone Shipping Price based on Postal Code
    By lioncity in forum General Questions
    Replies: 2
    Last Post: 10 Oct 2009, 03:43 PM
  3. Help with Product availability by Zip Code or Postal Code
    By enigma777 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Jun 2008, 10:07 PM
  4. Restrict Customer Registration Based on Zip Code
    By sghill in forum Managing Customers and Orders
    Replies: 4
    Last Post: 29 Mar 2008, 06:23 PM
  5. Where is the file/code to validate a coupon?
    By marcio in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 2
    Last Post: 29 Feb 2008, 10:15 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg