Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 35
  1. #11
    Join Date
    May 2010
    Posts
    222
    Plugin Contributions
    0

    Default Re: Hide local delivery from those who are not local

    Thank you!

  2. #12
    Join Date
    May 2010
    Posts
    222
    Plugin Contributions
    0

    Default Re: Hide local delivery from those who are not local

    Argh, I should have asked this in my first post, but is there anyway to make sure they are in my state? For example, if I use the city of Charlotte, NC, I do not want people from Charlotte, IL using this.

  3. #13
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hide local delivery from those who are not local

    You would then need to add the state to the IF ...
    Code:
    if (strtoupper($order->delivery['state']) == 'FLORIDA' && in_array(strtoupper($order->delivery['city']), array('TORONTO', 'TAMPA'))) {
    ** EDITED TO FIX STATE REFERENCE **
    Last edited by Ajeh; 19 Aug 2010 at 01:00 AM. Reason: edited reference to state
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #14
    Join Date
    May 2010
    Posts
    222
    Plugin Contributions
    0

    Default Re: Hide local delivery from those who are not local

    Thank you for your help. I have the following code, but after entering the IF statement for state, it does not work. I tried it with "NC" and "North Carolina".

    Code:
    function quote($method = '') {
        global $order;
    
    if (strtoupper($order->delivery['delivery_state']) == 'NC' && in_array(strtoupper($order->delivery['city']), array('CHARLOTTE', 'INDIAN TRAIL', 'MATTHEWS', 'MINT HILL', 'STALLINGS'))) {
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY,
                                                       'cost' => MODULE_SHIPPING_STOREPICKUP_COST)));

  5. #15
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hide local delivery from those who are not local

    It is always a good idea to follow the bouncing ball ...

    Notice that I used:
    FLORIDA

    Two reasons for that:

    1 for testing in the IF

    2 the orders table stores the full name of the state ...

    Moral of the story ...
    Be sure to use for the IF statement the full name of the state in upper case ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #16
    Join Date
    May 2010
    Posts
    222
    Plugin Contributions
    0

    Default Re: Hide local delivery from those who are not local

    It still does not work. Here is my code:

    Code:
    function quote($method = '') {
        global $order;
    
    if (strtoupper($order->delivery['delivery_state']) == 'NORTH CAROLINA' && in_array(strtoupper($order->delivery['city']), array('CHARLOTTE', 'INDIAN TRAIL', 'MATTHEWS', 'MINT HILL', 'STALLINGS'))) {
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY,
                                                       'cost' => MODULE_SHIPPING_STOREPICKUP_COST)));
    }

  7. #17
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hide local delivery from those who are not local

    Sorry ... got carried away on the reference to the delivery state of the order ...

    Use on the IF:
    Code:
    if (strtoupper($order->delivery['state']) == 'NORTH CAROLINA' && in_array(strtoupper($order->delivery['city']), array('CHARLOTTE', 'INDIAN TRAIL', 'MATTHEWS', 'MINT HILL', 'STALLINGS'))) {
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #18
    Join Date
    May 2010
    Posts
    222
    Plugin Contributions
    0

    Default Re: Hide local delivery from those who are not local



    Thank you so much. You have been a big help!

  9. #19
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Hide local delivery from those who are not local

    No need for applause ... just throw money ...

    Thanks for the update that you now have this working ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #20
    Join Date
    Jul 2010
    Location
    Welland, ON Canada
    Posts
    46
    Plugin Contributions
    0

    Default Re: Hide local delivery from those who are not local

    Quote Originally Posted by Ajeh View Post
    You are changing the file:
    /includes/modules/shipping/storepickup.php

    I have altered the code so you can add additional cities ...

    Currently, the function quote looks like:
    Code:
      function quote($method = '') {
        global $order;
    
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY,
                                                       'cost' => MODULE_SHIPPING_STOREPICKUP_COST)));
    
        if ($this->tax_class > 0) {
          $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
        }
    
        if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
    
        return $this->quotes;
      }
      /**
    This is what the function quote should look like when done adding this change:
    Code:
      function quote($method = '') {
        global $order;
    
    if (in_array(strtoupper($order->delivery['city']), array('TORONTO', 'TAMPA'))) {
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY,
                                                       'cost' => MODULE_SHIPPING_STOREPICKUP_COST)));
    }
    
        if ($this->tax_class > 0) {
          $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
        }
    
        if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
    
        return $this->quotes;
      }
      /**
    Ajeh,

    I followed your code to the letter, and it works beautifully. I noticed that on the shipping page it changes 'Walk-in' to 'local delivery'. My question is, Is there a way I can give them "Both" options? A way to choose whether they want it delivered, or they would like to come pick it up.

    Thanks

 

 
Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. How to link local delivery with local taxes
    By germerican in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 0
    Last Post: 2 Jul 2010, 06:29 PM
  2. Local Delivery
    By Crusty Baker in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 5 Feb 2008, 01:19 AM
  3. Local Delivery
    By caradelrae in forum Addon Shipping Modules
    Replies: 4
    Last Post: 18 Oct 2006, 09:12 AM
  4. Local Delivery by ZIP?
    By TSH4Life in forum Addon Shipping Modules
    Replies: 2
    Last Post: 18 Oct 2006, 09:08 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