Working on similar problem here:
http://h a bitathaven.com/cart
Want my shipping to be if weight 1lb or greater -> display Zones Table Rate
If weight = 0lbs default to Request Freight Quote
I have the zonetable.php working fine, displays on over 1lb, hides on 0lbs.
My problem is telling the Request Freight Quote to disable on 1lb or greater.
Here is the section of code from includes/modules/shipping/rfq.php I have noted my custom code, does it look right? Did I put custom code in proper place? Help!
Thanks
Code:
// class constructor
function rfq() {
global $order, $db;
$this->code = 'rfq';
$this->title = MODULE_SHIPPING_RFQ_TEXT_TITLE;
$this->description = MODULE_SHIPPING_RFQ_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_RFQ_SORT_ORDER;
$this->icon = DIR_WS_ICONS . 'shipping_rfq.gif';
$this->enabled = ((MODULE_SHIPPING_RFQ_STATUS == 'True') ? true : false);
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_RFQ_ZONE > 0) ) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id <> '" . MODULE_SHIPPING_RQF_ZONE . "' and zone_country_id <> '" . $order->delivery['country']['id'] . "' order by zone_id");
while (!$check ->EOF) {
/* MY CUSTOM CODE START XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
global $cart;
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->show_weight() >= 1) {
$this->enabled = false;
}
/* MY CUSTOM CODE FINISH XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX*/
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) {
$this->enabled = false;
}
}
}