Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,674
    Plugin Contributions
    0

    Default Registration only in local area only.

    At this time I am only want customer that is in my local area. How can I set up when customers can register only in my area/town? Until further notice.

    Thanks

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,937
    Plugin Contributions
    96

    Default Re: Registration only in local area only.

    How will you determine if the customer is "local"? Using their postcode and/or city?

  3. #3
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,674
    Plugin Contributions
    0

    Default Re: Registration only in local area only.

    Yes, that is what I want to do. But right now. I just want to sell my items only in my local area for right now.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,937
    Plugin Contributions
    96

    Default Re: Registration only in local area only.

    Since you're using Zen Cart v1.5.4, you can start by going to your admin's Tools->Install SQL Patches and run this script which will disable all countries except the USA:
    Code:
    UPDATE countries SET status = 0 WHERE countries_id != 223;
    That will disallow accounts from being created and purchases being made for countries other than the United States.

  5. #5
    Join Date
    Aug 2007
    Location
    Amarillo, Tx
    Posts
    1,674
    Plugin Contributions
    0

    Default Re: Registration only in local area only.

    Yes, I know that part. I will be doing is in Texas and my Town is Amarillo and Canyon. So what is the best way to do this?

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,937
    Plugin Contributions
    96

    Default Re: Registration only in local area only.

    You'll need to make a template-override version of the create_account.php module. If you don't already have the file /includes/modules/YOUR_TEMPLATE/create_account.php, copy /includes/modules/create_account.php to /includes/modules/YOUR_TEMPLATE/create_account.php.

    Look for this section (towards the middle of the file) and add the code in red to check for the state being Texas and the city being either Amarillo or Canyon:
    Code:
      if ( !($zone_name == 'Texas' && (strtolower ($city) == 'amarillo' || strtolower ($city) == 'canyon') ) ) {
        $error = true;
        $messageStack->add('create_account', "We're sorry, but we are only accepting accounts in Amarillo and Canyon at the moment.");
      }
      if ($error == true) {
        // hook notifier class
        $zco_notifier->notify('NOTIFY_FAILURE_DURING_CREATE_ACCOUNT');
      } elseif ($antiSpam != '') {
        $zco_notifier->notify('NOTIFY_SPAM_DETECTED_DURING_CREATE_ACCOUNT');
        $messageStack->add_session('header', (defined('ERROR_CREATE_ACCOUNT_SPAM_DETECTED') ? ERROR_CREATE_ACCOUNT_SPAM_DETECTED : 'Thank you, your account request has been submitted for review.'), 'success');
        zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
      } else {
        $sql_data_array = array('customers_firstname' => $firstname,
                                'customers_lastname' => $lastname,
                                'customers_email_address' => $email_address,
                                'customers_nick' => $nick,
                                'customers_telephone' => $telephone,
                                'customers_fax' => $fax,
                                'customers_newsletter' => (int)$newsletter,
                                'customers_email_format' => $email_format,
                                'customers_default_address_id' => 0,
                                'customers_password' => zen_encrypt_password($password),
                                'customers_authorization' => (int)CUSTOMERS_APPROVAL_AUTHORIZATION
        );

 

 

Similar Threads

  1. v153 Local Pickup Only Mod
    By wmorris in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 7 Jul 2014, 02:58 PM
  2. UK local custom only
    By Limey in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 3 Jan 2012, 09:47 PM
  3. Name/Email/Password *only* Registration
    By Solidarity in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 23 Oct 2008, 11:18 PM
  4. local delivery only, free for over $50
    By lodestar in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 17 Jan 2008, 10:33 PM
  5. Prices after registration only
    By mgbyte in forum Basic Configuration
    Replies: 1
    Last Post: 1 Nov 2007, 04:26 PM

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