Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Configuring the Zen Cart Admin / Built-in Shipping and Payment Modules / exclude non continental united states zones from free shipping.

exclude non continental united states zones from free shipping.

Started by gloerick on 3 Mar 2012, 5:14 PM · Views: 8,564

Results 21 to 40 of 104
4 Mar 2012, 12:30 AM
#21
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #21 by ajeh

I have the amazing eye on what these things are ... :lamo:

Actually I was pretty sure you used the example on how to build the US 48 and that uses the id 21 ... :cool:

Give me a few to work out the code ...

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 Mar 2012, 12:32 AM
#22
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #22 by gloerick

could not have done it with out the sample :-)
have NO CLUE in the programming "mayby basic alterations"
but otherwise, lost.

and OK, THANK YOU SOOOOOO MUCH !!!!

4 Mar 2012, 12:49 AM
#23
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #23 by ajeh

First, edit the file:
/includes/classes/shipping.php

and add the code in RED:

  function calculate_boxes_weight_and_tare() {
    global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;

// bof: allow 1 zone only for Always Free Shipping
    global $db, $order, $cart;
        $valid_zone_id = 21;
        $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 = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while (!$check->EOF) {
          if ($check->fields['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
          $check->MoveNext();
        }

        if ($check_flag == false) {
          $total_weight += $_SESSION['cart']->free_shipping_weight;
        }
// bof: allow 1 zone only for Always Free Shipping

    if (is_array($this->modules)) {

Now let's test how this is working to see what, if any, other adjustments are needed ...

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 Mar 2012, 12:55 AM
#24
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #24 by gloerick

added, and just FYI below this new code is

// bof: add back weight for Canada, Alaska and Hawaii
global $order, $cart; if ($order->delivery['country']['id'] == 38 || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Alaska') || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Hawaii')) { $total_weight += $_SESSION['cart']->free_shipping_weight; }
// eof: add back weight for Canada, Alaska and Hawaii
 
 
if (is_array($this->modules)) {

4 Mar 2012, 12:58 AM
#25
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #25 by gloerick

added and removed some food and another non free shipping in and out of the cart it seemed ok and with only the food now the shipping is empty again.

4 Mar 2012, 12:58 AM
#26
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #26 by ajeh

Change that code you found to:

/*

// bof: add back weight for Canada, Alaska and Hawaii
global $order, $cart; 
if ($order->delivery['country']['id'] == 38 || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Alaska') || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Hawaii')) { 
  $total_weight += $_SESSION['cart']->free_shipping_weight; 
}
// eof: add back weight for Canada, Alaska and Hawaii 
*/

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 Mar 2012, 1:00 AM
#27
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #27 by gloerick

done..

shipping empty for food with free shipping, you can refresh your cart, I think we are both in it.

4 Mar 2012, 1:03 AM
#28
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #28 by ajeh

Can you also make sure that you have the January 22, 2012 USPS shipping module installed?
http://www.zen-cart.com/forum/showthread.php?t=191406

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 Mar 2012, 1:10 AM
#29
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #29 by gloerick

ok, I did as I had to call them and setup new ID but I just did it again just in case. I just moved the entire includes and had it over write everything it wanted.

United States Postal Service

You will need to have registered a Web Tools account with USPS at their website to use this module.

USPS expects you to use pounds as weight measure for your products.
Enable USPS Shipping
True

Enter the USPS Web Tools User ID
928*******

Which server to use
production

Quote Sort Order
Unsorted

Handling Fee - US
0

Handling Fee - International
0

Handling Per Order or Per Box
Box

Decimal Settings
3

Tax Class
--none--

Tax Basis
Shipping

Shipping Zone
--none--

Sort Order
10

All Packages are Machinable
False

USPS Options
Display weight, Display transit time

Domestic Shipping Methods
PRIORITY, PARCEL

International Shipping Methods
Priority Mail International, Priority Mail Int Flat Rate Small Box, Priority Mail Int Flat Rate Med Box, Priority Mail Int Flat Rate Lrg Box

Debug Mode
Off

4 Mar 2012, 1:12 AM
#30
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #30 by ajeh

NOTE: if using a Sort Order on 1 or more Shipping Module, you should use a unique Sort Order on ALL shipping modules ...

Next, you need to edit the file:
/includes/modules/shipping/usps.php

and add the code in RED above the line in black:

// bof: allow 1 zone only for Always Free Shipping
    global $db, $order, $cart;

        $valid_zone_id = 21;
        $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 = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while (!$check->EOF) {
          if ($check->fields['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
          $check->MoveNext();
        }

        if ($check_flag == true) {
          $this->enabled = false;
        } else {
          $this->enabled = true;
        }
// eof: allow 1 zone only for Always Free Shipping

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_USPS_ZONE > 0) ) {

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 Mar 2012, 1:18 AM
#31
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #31 by gloerick

done and sort order is 10,20,30,40,50
free, USPS, fedex ground, UPS, fedex express

still EMTPY on free items

free shipping still yellow ?

4 Mar 2012, 1:30 AM
#32
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #32 by ajeh

The yellow icon is because of the Zone that you need set on the FREE SHIPPING freeshipper shipping module ...

Check your file:
/includes/shipping/usps.php

and make sure you have the code in RED:

// check if all keys are in configuration table
      if (IS_ADMIN_FLAG) {
        $chk_sql = $db->Execute("select * from " . TABLE_CONFIGURATION . " where configuration_key like 'MODULE\_SHIPPING\_USPS\_%' ");
        $chk_keys = $this->keys();
        if (sizeof($chk_keys) != $chk_sql->RecordCount()) {
          $this->title = $this->title . '<span class="alert">' . ' - Missing Keys you should reinstall!' . '</span>';
        }
      }
    }

// bof: allow 1 zone only for Always Free Shipping
    global $db, $order, $cart;

        $valid_zone_id = 21;
        $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 = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while (!$check->EOF) {
          if ($check->fields['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
          $check->MoveNext();
        }

        if ($check_flag == true) {
          $this->enabled = false;
        } else {
          $this->enabled = true;
        }
// eof: allow 1 zone only for Always Free Shipping

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_USPS_ZONE > 0) ) {

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 Mar 2012, 1:32 AM
#33
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #33 by gloerick

re check and re added and saved, no change ?

4 Mar 2012, 1:34 AM
#34
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #34 by ajeh

Check the file:
/includes/classes/shipping.php

You should have the code in RED:

  function calculate_boxes_weight_and_tare() {
    global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;

// bof: allow 1 zone only for Always Free Shipping
    global $db, $order, $cart;
        $valid_zone_id = 21;
        $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 = '" . $order->delivery['country']['id'] . "' order by zone_id");
        while (!$check->EOF) {
          if ($check->fields['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
          $check->MoveNext();
        }

        if ($check_flag == false) {
          $total_weight += $_SESSION['cart']->free_shipping_weight;
        }
// bof: allow 1 zone only for Always Free Shipping

    if (is_array($this->modules)) {

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 Mar 2012, 1:38 AM
#35
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #35 by gloerick

yes, here is section as it is saved.

global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
 
 
 
// bof: allow 1 zone only for Always Free Shipping global $db, $order, $cart; $valid_zone_id = 21; $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 = '" . $order->delivery['country']['id'] . "' order by zone_id"); while (!$check->EOF) { if ($check->fields['zone_id'] < 1) { $check_flag = true; break; } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } $check->MoveNext(); } if ($check_flag == false) { $total_weight += $_SESSION['cart']->free_shipping_weight; } // bof: allow 1 zone only for Always Free Shipping
 
 
 
/* // bof: add back weight for Canada, Alaska and Hawaii global $order, $cart; if ($order->delivery['country']['id'] == 38 || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Alaska') || ($order->delivery['country']['id'] == 223 && $order->delivery['state'] == 'Hawaii')) { $total_weight += $_SESSION['cart']->free_shipping_weight; } // eof: add back weight for Canada, Alaska and Hawaii */
 
 
 
if (is_array($this->modules)) {

4 Mar 2012, 1:44 AM
#36
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #36 by ajeh

Does you code look just like it does here in the forum or does it look nice and neat like my code in RED ...

Also can you PM me your USPS Web Tools User 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!]
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 Mar 2012, 1:45 AM
#37
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #37 by gloerick

like you see it, that is how it copys from the page,
and will do on the PM, might it be simpler to teamviewer in ?
or MSN messenger in ?

4 Mar 2012, 1:48 AM
#38
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #38 by ajeh

Use these files for your:
/includes/classes/shipping.php

/includes/modules/shipping/usps.php

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 Mar 2012, 1:54 AM
#39
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #39 by gloerick

will do, also redid the copy and paste, put it in notepad 1st came out nice so I recopied again and put it in the file and saved, no change, loading your zips now.

4 Mar 2012, 1:56 AM
#40
gloerick avatar

gloerick

Zen Follower

Join Date:
Feb 2006
Location:
Boise, ID
Posts:
330
Plugin Contributions:
0

Post #40 by gloerick

done, and WOW, I refreshed and the rate came up.
testing a few mixed carts non mixed, states and locations