Totally Zenned
- Join Date:
- Feb 2012
- Location:
- mostly harmless
- Posts:
- 1,818
- Plugin Contributions:
- 4
UPS Residential vs. Commercial rates
Should work. You might try something like the following in your shipping module:
function _upsRescom($foo) {
global $order, $db;
$result = $db->Execute(
'SELECT `c`.`customers_extrafield` FROM `' . TABLE_ADDRESS_BOOK '` AS `ab` '.
'LEFT JOIN `' . TABLE_CUSTOMERS . '` AS `c` ON `ab`.`customers_id`=`c`.`customers_id` ' .
'WHERE `ab`.`address_book_id`=\'' . (int)$_SESSION['sendto'] . '\''
);
if(!$result ->EOF) {
// Check the contents of the extra field and set $foo = RES or COM as appropriate
// You may want to only change $foo if things match exactly, in case somewhere
// the extrafield is used for a different purpose and contains different data.
// $result->fields['customers_extrafield'] will contain the result of the db query
}
switch ($foo) {
case 'RES': // Residential Address
$this->_upsResComCode = '1';
break;
case 'COM': // Commercial Address
$this->_upsResComCode = '0';
break;
}
}
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker