Zen Cart Logo
Forums / Addon Shipping Modules / FedEx shipper and free shipping

FedEx shipper and free shipping

Views: 2,789

Results 21 to 22 of 22
10 Sep 2013, 7:05 PM
#21
ajeh avatar

ajeh

Oba-san

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

FedEx shipper and free shipping

possibly ... in PM would be best

11 Sep 2013, 2:51 PM
#22
ajeh avatar

ajeh

Oba-san

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

Re: FedEx shipper and free shipping

Two things should be done ...

1 get the latest FedEx version from numinix.com so that you are current

2 customize the file:
/includes/classes/shipping.php

with the code in RED to manage your Always Free Shipping products:

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

[B]// Always Free Shipping added back except for US 48 plus DC zone_id = 21
// 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;
        }
// eof: allow 1 zone only for Always Free Shipping
// Always Free Shipping added back except for US 48 plus DC zone_id = 21
[/B]
    $this->abort_legacy_calculations = FALSE;

Then, where I am using zone_id 21, you use your zone_id number for your US 48 zone ...

Now what will happen is:

Only Always Free Shipping Product in Cart
A. US 48 sees ONLY Free Shipping
B. Anyone outside the US 48 plus DC sees ONLY the FedEx based on the weight of the Always Free Shipping Product

Always Free Shipping Product in the Cart and a Regular Product
A. US 48 sees ONLY the FedEx but the weight is only for regular Products NOT marked Always Free Shipping
B. Anyone outside the US 48 plus DC sees ONLY the FedEx based on the weight of the Always Free Shipping Product AND the weight of the Regular Products