Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Store Pickup by Delivery Postcode

    Problem:

    You have the Store Pickup shipping module enabled. Your store is located in the South East of Queensland. A customer from Cairns places an order with you and selects Store Pickup at checkout to *save* postage. Cairns is located in the same state but is about 1700 km north of your store location. It is unlikely that the customer hops in a plane or drives 18-19 hours to your store to *save* the shipping charges.....

    This has happened to me a few times on one of my stores.


    Solution:

    You limit the Store Pickup shipping module to postcodes surrounding your physical store location. If the customer's delivery address is not within the set limits then the Store Pickup option does not appear on the Checkout Shipping page.

    To achieve this you

    1. uninstall the Store Pickup module in admin
    2. backup the includes/modules/shipping/storepickup.php file
    3. modify the includes/modules/shipping/storepickup.php file (see below)
    4. upload the modified file
    5. re-install the Store Pickup module in admin

    The modified module now lets you enter an array of delivery postcodes you wish to allow usage of the Store Pickup option. Just enter the allowed postcodes separated by commas (no spaces) eg. 7000,7001,7005 - save and done.


    The Hack:


    (I have this working on ZC 1.3.9 and ZC 1.5.1)

    Open includes/modules/shipping/storepickup.php

    Find this:

    Code:
          if ($check_flag == false) { 
            $this->enabled = false; 
          } 
        } 
      } 
      /** 
       * Obtain quote from shipping system/calculations 
       *
    and amend to this:

    Code:
          if ($check_flag == false) { 
            $this->enabled = false; 
          } 
          // bof postcodes allowed 
          if (in_array($order->delivery['postcode'],explode(",", MODULE_SHIPPING_STOREPICKUP_POSTCODE))) { 
            $this->enabled = true; 
          } else { 
        $this->enabled = false; 
          } 
          // eof postcodes allowed 
        } 
      } 
      /** 
       * Obtain quote from shipping system/calculations 
       *
    then find:

    Code:
      /** 
       * Install the shipping module and its configuration settings 
       * 
       */ 
      function install() { 
        global $db; 
        $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Store Pickup Shipping', 'MODULE_SHIPPING_STOREPICKUP_STATUS', 'True', 'Do you want to offer In Store rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
    and amend to this:

    Code:
      /** 
       * Install the shipping module and its configuration settings 
       * 
       */ 
      function install() { 
        global $db; 
        $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Store Pickup Shipping', 'MODULE_SHIPPING_STOREPICKUP_STATUS', 'True', 'Do you want to offer In Store rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())"); 
        $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Postcodes Allowed', 'MODULE_SHIPPING_STOREPICKUP_POSTCODE', '1000', 'Enter the delivery postcodes allowed to use this shipping method.<br /><br />Enter the allowed postcodes as a comma delimited list - do not use spaces (eg 7000,7001,7005,7010).<br /><br />In this example <b>only</b> orders with delivery postcodes 7000,7001,7005 and 7010 are allowed to use the Store Pickup shipping option.<br /><br />', '6', '0', now())");
    lastly - at the end of the file - change this:

    Code:
       * @return array 
       */ 
      function keys() { 
        return array('MODULE_SHIPPING_STOREPICKUP_STATUS', 'MODULE_SHIPPING_STOREPICKUP_COST', 'MODULE_SHIPPING_STOREPICKUP_TAX_CLASS', 'MODULE_SHIPPING_STOREPICKUP_TAX_BASIS', 'MODULE_SHIPPING_STOREPICKUP_ZONE', 'MODULE_SHIPPING_STOREPICKUP_SORT_ORDER'); 
      } 
    } 
    ?>
    to this:

    Code:
       * @return array 
       */ 
      function keys() { 
        return array('MODULE_SHIPPING_STOREPICKUP_STATUS', 'MODULE_SHIPPING_STOREPICKUP_POSTCODE', 'MODULE_SHIPPING_STOREPICKUP_COST', 'MODULE_SHIPPING_STOREPICKUP_TAX_CLASS', 'MODULE_SHIPPING_STOREPICKUP_TAX_BASIS', 'MODULE_SHIPPING_STOREPICKUP_ZONE', 'MODULE_SHIPPING_STOREPICKUP_SORT_ORDER'); 
      } 
    } 
    ?>

    Enjoy

    Cheers/Frank

  2. #2
    Join Date
    Jun 2013
    Location
    Sydney
    Posts
    25
    Plugin Contributions
    0

    Default Re: Store Pickup by Delivery Postcode

    Hi, do you know if it is possible to do a similar thing with the standard shipping module? We are planning to do only local (10-20 postcodes around Sydney) delivery for the first few months of our store being up.

  3. #3
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Store Pickup by Delivery Postcode

    Quote Originally Posted by rayo View Post
    Hi, do you know if it is possible to do a similar thing with the standard shipping module? We are planning to do only local (10-20 postcodes around Sydney) delivery for the first few months of our store being up.
    Should be possible with some custom coding - or setting up zones for individual postcodes.

    The store pickup payment modules is a *very* simple module, zone rates are a bit more complicated.

    I need to mull over this...

  4. #4
    Join Date
    Jun 2013
    Location
    Sydney
    Posts
    25
    Plugin Contributions
    0

    Default Re: Store Pickup by Delivery Postcode

    Or would it be easier to only offer local pick up but 'mask' it as 'local delivery' ie change the text it displays as. Or would I be heading down a dark tunnel with that approach ):

    I am no PHP coder (if that was not already obvious)

  5. #5
    Join Date
    Nov 2007
    Location
    Sunny Coast, Australia
    Posts
    3,379
    Plugin Contributions
    9

    Default Re: Store Pickup by Delivery Postcode

    Quote Originally Posted by rayo View Post
    Or would it be easier to only offer local pick up but 'mask' it as 'local delivery' ie change the text it displays as. Or would I be heading down a dark tunnel with that approach ):

    I am no PHP coder (if that was not already obvious)
    The easiest way would be to clone the Store Pickup module, call it something like 'Local Delivery' and then offer this as the only available shipping method.

    If you are not a coder you may want to look into employing someone who is au-fait with Zen Cart installations.

    Cheers / Frank

  6. #6
    Join Date
    Jun 2013
    Location
    Sydney
    Posts
    25
    Plugin Contributions
    0

    Default Re: Store Pickup by Delivery Postcode

    Thanks, I will give it a go.

 

 

Similar Threads

  1. Pizza - Store Pickup or Delivery
    By liderbug in forum General Questions
    Replies: 19
    Last Post: 16 Mar 2011, 07:42 PM
  2. Change 'store pickup' to Free local Delivery
    By worshamdesigns in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 3 Dec 2010, 07:40 AM
  3. Delivery postcode
    By evil turinp in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 8 Nov 2010, 08:26 PM
  4. Step 3 of checkout with In-store pickup shows delivery address??
    By jasonhoward64 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 10 May 2010, 10:24 AM
  5. Store Pickup Or Free Delivery
    By waterloo in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 26 Feb 2008, 05:58 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR