Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Best way to setup shipping

    You could try this ...

    Edit the file:
    /includes/modules/pages/login/header_php.php

    and add the code in RED:
    Code:
            $_SESSION['customer_zone_id'] = $check_country->fields['entry_zone_id'];
    
    // bof: check customer zone for valid zone to order some products
            $valid_zone_id = 37; // enter value of valid zone
            $valid_zone = true;
            $check_flag = false;
            $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . $valid_zone_id . "' and zone_country_id = '" . $check_country->fields['entry_country_id'] . "' order by zone_id");
            while (!$check->EOF) {
              if ($check->fields['zone_id'] < 1) {
                $check_flag = true;
                break;
              } elseif ($check->fields['zone_id'] == $check_country->fields['entry_zone_id']) {
                $check_flag = true;
                break;
              }
              $check->MoveNext();
            }
    
            if ($check_flag == false) {
              $valid_zone = $check_flag;
            }
            $_SESSION['ship_to_customer_valid_zone'] = $valid_zone;
    // eof: check customer zone for valid zone to order some products
    
    Change the setting for the:
    $valid_zone_id =37;

    to the zone id for you Zone Definition for the 37...


    Edit the file:
    /includes/functions/functions_general.php

    and find the:
    function zen_get_buy_now_button

    then add the code in RED:

    Code:
        $button_check = $db->Execute("select product_is_call, products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    
    // check Product for valid zone
    define('TEXT_CALL_FOR_PRICE2', 'Call for Price shipping');
    define('TEXT_LOGIN_TO_SHOP_BUTTON_REPLACE2', 'Login for validation');
    // master_categories_id are delimited in $chk_products_us_only
    $chk_products_us_only = in_array(zen_get_products_category_id($product_id), explode(",", '10, 12'));
    echo '$products_id: ' . $product_id . ' $master: ' . zen_get_products_category_id($product_id) . ' $chk_products_us_only: ' . $chk_products_us_only . ' good: ' . $_SESSION['ship_to_customer_valid_zone'] . '<br>';
        switch (true) {
    change the master_categories_id from 10, 12 to be the master_categories_id that you need on:
    $chk_products_us_only = in_array(zen_get_products_category_id($product_id), explode(",", '10, 12'));

    Code:
        case (zen_get_products_allow_add_to_cart($product_id) == 'N'):
          return $additional_link;
          break;
    // check Product for valid zone
        case ((!$_SESSION['ship_to_customer_valid_zone'] && $chk_products_us_only)):
          if ($_SESSION['customer_id'] > 0) {
            $return_button = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE2 . '</a>';
          } else {
            $return_button = '<a href="' . zen_href_link(FILENAME_LOGIN, '', 'SSL') . '">' .  TEXT_LOGIN_TO_SHOP_BUTTON_REPLACE2 . '</a>';
          }
          break;
        case ($button_check->fields['product_is_call'] == '1'):
          $return_button = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . TEXT_CALL_FOR_PRICE . '</a>';
          break;
    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!

  2. #12
    Join Date
    Mar 2011
    Posts
    24
    Plugin Contributions
    0

    Default Re: Best way to setup shipping

    $valid_zone_id needs to be the id for the zone definition I made for the united states?

    Right now it just shows "Please call for Price Shipping" for every country including the US.

    It is marking the categories as call to ship though

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

    Default Re: Best way to setup shipping

    Go to your Admin and go to the Locations / Taxes ... Zones Definitions ... and click on your Zone Definition for the US and click on DETAILS ...

    What do you have set on the DETAILS for this Zone Definition? If you want 50 States plus DC you should see 51 zones added to it ...

    In the URL, what is the zID= showing? That is what you should be setting the $valid_zone_id to be ...
    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!

  4. #14
    Join Date
    Mar 2011
    Posts
    24
    Plugin Contributions
    0

    Default Re: Best way to setup shipping

    Sorry for the hiatus.
    It is working! I typed the wrong ID in.

    Thank you very much!

    One more question if you don't mind answering.

    I am using the perweightunit shipping module with handling, like said earlier in this thread. One thing I realized though is that not all products need an extra $70 tacked on for orders to canada. Some orders are and extra $10 or $52 or $83. Is it possible to have this kind of pricing per product? An example of shipping,
    Item A:
    USA - $40, Canada - $70
    Item B:
    USA - $70, Canada - $70
    Item C:
    USA - $24, Canada - $52
    Item D:
    USA - $30, Canada - $83

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

    Default Re: Best way to setup shipping

    How are you identifying which shipping module gets which of the 3 charges? Or, is there a different charge for each Product or Category or what?
    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!

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v151 BEST WAY shipping
    By Steve Katz in forum General Questions
    Replies: 5
    Last Post: 9 Jun 2014, 11:05 PM
  2. Best Way Shipping
    By sloojoe in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 15 Dec 2009, 07:14 PM
  3. How do I setup a single drop shipper in China? (best way)
    By nerdovision in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 26 Jan 2009, 06:41 PM
  4. Best Way Shipping
    By Crashdowngurl in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 21 Apr 2008, 05:48 AM

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