Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Mar 2011
    Posts
    78
    Plugin Contributions
    0

    Default Zone shipping - Can I disable purchase of certain items based on a shipping zone?

    Store is UK based.

    I have 2 products which due to their size and/or weight cannot ship internationally by standard Royal Mail services and so I must get courier quotes for those items. Technically they could ship by RM or Parcelforce however the cost would be extremely high and would lose me customers. Providing third party courier quotes is the preferred option.

    When customers from Europe select one of these products, the shipping rates shown states
    Available Shipping Methods Zone Rates (Shipping rate cannot be determined at this time - please contact for a shipping quote) Rates £0.00
    This is as expected (I edited the files so this message would show).
    However, they can still continue the checkout process and pay, using both Paypal Express and the regular checkout.
    This of course causes confusion and upset customers when I contact them for additional funds.

    Is there a way that I can ensure that international customers cannot complete checkout when these two products are in the cart so they must contact me for a quote?
    (I have been contemplating the Ceon Advanced Shipping module however I don't know if that module can do this either)

    I am using Zone Rates for shipping, Calculation Method Weight
    Zone 1 - GB
    Zone 2 - Europe
    I have set my Zone Table weights for Zone 2 so that these products are heavier than any designated weight/charge.

    I offer free shipping on items of £20 and over in the UK. Both these products are over £20
    admin/modules/order total/shipping/
    Free Shipping For Orders Over £19.99
    Provide Free Shipping For Orders Made national

    I previously used Request International Quote modules but as the majority of my products can ship by regular mail this is really not required and puts international customers of small items off. The modules are still installed but disabled.

    Any help would be most appreciated.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Zone shipping - Can I disable purchase of certain items based on a shipping zone?

    As far as disabling a particular shipping module, regardless of products ...

    With all shipping and payment modules, you can set up a Zone Definition and use that as a restriction tool to allow any particular module to only work if the customer is inside that zone.

    So, if you go to Admin->Locations/Taxes->Zone Definitions, and create a zone there (create the zone, then click the Details button and assign countries and/or states/provinces/etc associated with that specific country for which you want the module to work), and then go into your shipping module and set the Shipping Zone pulldown to use that defined zone, then that shipping module will only work if the customer's shipping address falls inside that zone definition's defined region.
    If their address falls outside that region, then that shipping module won't give any quotes back at all, and thus they won't see a "0.00" option such as you mentioned, thus minimizing the confusion you were talking about.

    Caution: don't confuse the word "zone" as used inside the module with how it's used in the Zone Definitions screen. The Zones shipping module defines shipping zones differently than the storewide zone definitions I talked about above.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2011
    Posts
    78
    Plugin Contributions
    0

    Default Re: Zone shipping - Can I disable purchase of certain items based on a shipping zone?

    Thanks for the reply.

    I have defined a zone for Europe in Admin->Locations/Taxes->Zone Definitions
    However I do not have a Shipping Zone Pulldown in the Zone Rates module - I have manually added the countries in the Zone 2 Countries box.
    (I will be adding 2 more zones for the rest of the world when I have fixed this issue)
    Any countries not included in the Zone 2 Countries box receive no shipping quote, and if logged in cannot progress further. (I have yet to test with a non-registered/logged in customer using Paypal Express button for a country outside the defined zones.)

    I want to exclude the ability for international customers to checkout and pay when either of 2 specific items are in the cart (both items are in their own category).
    I want them to be able to checkout when their cart has anything but the 2 specific items as I have set my Zone Table weights accordingly - weights/prices up to 1.98lb are defined. Both items are over 2lbs.

    At the moment they can check out and pay 0.00 shipping when these items are in their cart.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Zone shipping - Can I disable purchase of certain items based on a shipping zone?

    My prior post wasn't addressing the idea of isolating any of this to particular products. Merely to restricting based on address.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

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

    Default Re: Zone shipping - Can I disable purchase of certain items based on a shipping zone?

    You could customize the code for:
    /includes/modules/shipping/zones.php

    and check the content in the cart and the Zone being used by changing the code:
    Code:
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => $shipping_method,
                                                         'cost' => $shipping_cost)));
    to be:
    Code:
    // check cart for Zone 2
    $chk_cat = 0;
    $chk_cat += $_SESSION['cart']->in_cart_check('products_id','115');
    $chk_cat += $_SESSION['cart']->in_cart_check('products_id','112');
    echo '$dest_zone: ' . $dest_zone . ' $chk_cat: ' . $chk_cat . '<br>';
    if ($dest_zone == 2 and $chk_cat > 0) {
      echo '<br>Products blocked in cart! ' . $chk_cat . '<br>';
    } else {
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
                                'methods' => array(array('id' => $this->code,
                                                         'title' => $shipping_method,
                                                         'cost' => $shipping_cost)));
    }
    
          if ($this->tax_class > 0) {
    Now, Zone 2 will not display if products_id 115 or 112 are in the cart ...

    If you need additional Products, just add another line, with the products_id:
    Code:
    $chk_cat += $_SESSION['cart']->in_cart_check('products_id','XXX');
    
    where XXX is the products_id ...
    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. #6
    Join Date
    Mar 2011
    Posts
    78
    Plugin Contributions
    0

    Default Re: Zone shipping - Can I disable purchase of certain items based on a shipping zone?

    Thanks - that looks like what I'm after.
    Could I set it for categories rather than product ids?

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

    Default Re: Zone shipping - Can I disable purchase of certain items based on a shipping zone?

    If you are using categories_id that are the master_categories_id then you can use:
    Code:
    $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','XXX');
    where XXX is the master_categories_id of the Products ...
    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. #8
    Join Date
    Mar 2011
    Posts
    78
    Plugin Contributions
    0

    Default Re: Zone shipping - Can I disable purchase of certain items based on a shipping zone?

    Many thanks, I shall give it a try.

  9. #9
    Join Date
    Jul 2017
    Location
    West Midlands, UK
    Posts
    19
    Plugin Contributions
    0

    Default Re: Zone shipping - Can I disable purchase of certain items based on a shipping zone?

    Hi,
    We have been using Zen Cart for several years and now wish to sell into Europe. Some of our products are only available for delivery within the UK.

    I have tried the code suggested by Ajeh but the error message appears at the top of the tpl_checkout_shipping page and affects the display of the header.

    Would it be possible to reference the variable $chk_cat in the tpl_checkout_shipping page around line 73?

    Below is an example of what I have tried to add to the tpl_checkout_shipping page but I can’t get the desired results:

    <?php if ($chk_cat > 0) { ?>
    <div id="checkoutShippingContentChoose" class="important"><?php echo TEXT_ZONES_PRODUCTSRESTRICTED; ?></div>
    <?php } ?>

    The suggested code from post #5 is working very well at restricting certain products from being delivered overseas, it is just where the error message displays which I would like to change. Any advice would be much appreciated.
    Zen Cart Version: 1.5.5 upgraded from 1.3.9
    --
    Many thanks
    Richard

  10. #10
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Zone shipping - Can I disable purchase of certain items based on a shipping zone?

    A way I can see this possible is through the use of a $_SESSION variable. The echo that is identified in post 5 pushes content to the page before other processing which is somewhat what is causing the alignment problem. But, if a session variable were used, then the "error" could be stored and then on the applicable page(s) the result displayed as desired.

    So at the point where the $cat_id is set to zero, add an additional line either above or below like:
    Code:
    unset($_SESSION['restricted_cat']);
    Then where the "error" message is echoed, instead use:
    Code:
    $_SESSION['restricted_cat'] = {error_message};
    Where {error_message} is whatever text is there currently as part of the echo. This could also be used to store "data" that is to be retrieved on the other end like an array of the product/categories, or whatever.

    Then wherever it is desired to be displayed, your if statement would be:
    Code:
    if (isset($_SESSION['restricted_cat']) {
    And you could then echo whatever you want to echo based on that condition.

    Further, in this process, if the cart contents change, the message should also be updated/reflect the condition.

    Just a thought.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. How can disable the checkbox for the shipping zone ?
    By dmagic in forum General Questions
    Replies: 4
    Last Post: 31 Mar 2014, 04:31 PM
  2. 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
  3. 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
  4. with zone shipping rates can certain states be excluded?
    By Gerk in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 8 Jun 2006, 06:06 PM

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