Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / UPS module - let UPS determine residential or commercial???

UPS module - let UPS determine residential or commercial???

Views: 2,309

Results 1 to 2 of 2
2 Apr 2012, 9:52 PM
#1
goldbuckle avatar

goldbuckle

Zen Follower

Join Date:
Dec 2006
Location:
near Atlanta Georgia
Posts:
220
Plugin Contributions:
0

UPS module - let UPS determine residential or commercial???

Is it possible to set up the UPS shipping module to let UPS determine if the address is a residential or commercial address??? And if so can it also be set up this way in the shipping estimator? I wouldn't want a customer to estimate shipping then get to checkout and find it higher because of the address type....just saying....

3 Apr 2012, 2:45 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: UPS module - let UPS determine residential or commercial???

You could try customizing the code in UPS and change the function _upsRescom to read:

  function _upsRescom($foo) {
    global $order;
/*
    switch ($foo) {
      case 'RES': // Residential Address
        $this->_upsResComCode = '1';
        break;
      case 'COM': // Commercial Address
        $this->_upsResComCode = '0';
        break;
    }
*/

//echo 'UPS company: ' . ($order->delivery['company'] == '' ? 'No company' : 'Got a company') . ' len:' . strlen($order->delivery['company']) . '<br>';
    if ($order->delivery['company'] == '') {
        $this->_upsResComCode = '1';
    } else {
        $this->_upsResComCode = '0';
    }

  }

Now if there is a company name it will switch to commercial ...