Once you know the Zone Definition id number, you can replace the 21 that I use with your value ...
Edit the file:
/includes/classes/shipping.php
and add the code in RED:
Code:
function calculate_boxes_weight_and_tare() {
global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
// 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
if (is_array($this->modules)) {
Then customize your Flat Rate flat clone ...
I am using the Flat Rate flat module so just adapt the code to your Flat Rate clone with the code in RED:
Code:
// disable only when entire cart is free shipping
// if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
// }
Code:
// class methods
function quote($method = '') {
global $order;
global $shipping_weight;
//echo 'Flat $shipping_weight: ' . $shipping_weight . ' $total_weight: ' . $total_weight . '<br>';
if ($shipping_weight > 0) {
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
'cost' => MODULE_SHIPPING_FLAT_COST + $chk_weight_charge)));
}
if ($this->tax_class > 0) {
On the FREE SHIPPING! freeshipper add your Zone for the US to that module ...
See if this makes it work for you ...
Bookmarks