Results 1 to 10 of 15

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    142
    Plugin Contributions
    0

    Default Hide Zone Shipping from Group

    Hi,

    I am trying to hide Zone Shipping from a certain group. I have done this for another shipping module by entering this code:

    Code:
    // do not show to customers_group_pricing 32
          $chk_group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
          if ($chk_group_query->fields['customers_group_pricing'] == 32) {
            $this->enabled = false;
          }
    I am pretty sure that the code will remain the same for the zone module; however, I don't know where in the file I should put the code... everywhere I have tried just breaks the shipping page and prevents it from loading.

    Any help is appreciated.

    Thanks!

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

    Default Re: Hide Zone Shipping from Group

    Put the code under:
    Code:
          // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
            $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
          }
    But add to it, under the line:
    Code:
    // do not show to customers_group_pricing 32
    the line:
    Code:
    global $db;
    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!]
    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!

  3. #3
    Join Date
    Dec 2010
    Posts
    142
    Plugin Contributions
    0

    Default Re: Hide Zone Shipping from Group

    excellent! worked like a charm. thanks so much!

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

    Default Re: Hide Zone Shipping from Group

    Thanks for the update that this was able to work for you ...
    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!]
    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!

  5. #5
    Join Date
    Mar 2005
    Location
    UK
    Posts
    38
    Plugin Contributions
    0

    Default Re: Hide Zone Shipping from Group

    Sorry to add to this thread but I'm trying to do something similar but rather than hiding from a Group I need to hide from a destination country. Reason is I have two zones shipping modules and want one to manage UK shipping and the other International. (Usual sledgehammer to crack a nut approach but there is method in my madness). Problem is they both appear all the time.

    I need similar code to above but can't work out the expression to compare the country code. Simplified version is as follows:

    // do not show to destination country UK
    $value = expression to return 2 digit iso country code
    if ($value <> UK) {
    $this->enabled = false;
    }

    I have played around with $dest_country = $order->delivery['country']['iso_code_2']; but can't seem to get it working. If anyone can point me in the right direction it would be appreciated.

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

    Default Re: Hide Zone Shipping from Group

    What shipping modules are you trying to use for this?
    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!]
    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!

 

 

Similar Threads

  1. hide zone rates shipping altogether if not available for country
    By vandiermen in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 23 Oct 2012, 07:00 PM
  2. Hide certain products from a group of users
    By mohammedsk in forum Basic Configuration
    Replies: 4
    Last Post: 29 Dec 2009, 06:31 AM
  3. Zone shipping charging rate from zone 3 to zone 1
    By John Zwikstra in forum Built-in Shipping and Payment Modules
    Replies: 21
    Last Post: 28 Dec 2009, 01:10 PM
  4. Zone shipping charging rate from zone 3 to zone 1
    By John Zwikstra in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 6 Aug 2009, 04:32 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