A product marked as Always Free Shipping is for everyone, regardless of the Zone set on the FREE SHIPPING! freeshipper unless you add code to manage that ...
I just ran through setting up v1.5.3 to have this work for Always Free Shipping to work for 1 Zone and show the other shipping modules at the same time with the following code changes ...
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;
[B]
// bof: allow 1 zone only for Always Free Shipping
// add zone to FREE SHIPPING! freeshipper
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
[/B]
$this->abort_legacy_calculations = FALSE;
$this->notify('NOTIFY_SHIPPING_MODULE_PRE_CALCULATE_BOXES_AND_TARE');
if ($this->abort_legacy_calculations) return;
For UPS shipping, edit the file:
/includes/modules/shipping/ups.php
and add the code in RED:
[B] // disable only when entire cart is free shipping
// bof: disabled for Always Free Shipping 1 zone to always show additional methods
//[/B] if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
[B]//[/B] }
[B]// eof: disabled for Always Free Shipping 1 zone to always show additional methods
[/B]
Make a Zone for the US 48 State and DC and add it to the FREE SHIPPING! freeshipper shipping module ...
Make sure that the code for:
[B] $valid_zone_id = 21;
[/B]
matches the value of your Zone that you added ...
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!