Forums / Built-in Shipping and Payment Modules / UPS Residential vs. Commercial rates

UPS Residential vs. Commercial rates

Started by tcsdcc on 8 Mar 2007, 1:42 PM · Views: 22,613

Results 21 to 23 of 23
11 Mar 2013, 2:36 PM
#21
lhungil avatar

lhungil

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

11 Apr 2019, 4:09 PM
#22
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Re: UPS Residential vs. Commercial rates

sports guy:

As you can see UPS does not charge the proper amount according to residential or business...

To re-open this old wound... It is now 2019 and UPS XML is a great method to retrieve our negotiated rates from UPS. But i cannot understand why it cannot send back the appropriate rate based on whether the address is commercial or residential. This status is clearly known at label printing time (Worldship or Shipstation or UPS.COM), so why can't it be known up front when the address is initially entered and shipping costs are requested? Get rid of the blanket COM/RES choice that we, as adminstrators, have to make within the shipping mod, and just let the address drive it. Seems so logical to non-coders like me! Is there any hope that this will happen?

Our website customer base is an even mix of commercial and residential, so this is a recurring frustration. Either we overcharge (and possibly lose business from) the commercial customers, or end up upside down on the shipping charges for the RES customers.

7 Feb 2022, 8:11 PM
#23
apollowilcox avatar

apollowilcox

Zen Follower

Join Date:
Sep 2014
Location:
Indiana
Posts:
123
Plugin Contributions:
0

Re: UPS Residential vs. Commercial rates

As a follow-up to my own rant from April 2019, we were able to solve this, with the help of another ZC user/ hobby coder. Our modified UPSXML plug-in determines the Residential/ Commercial status based on the customer's shipping address, sends that to UPS (rather than sending the 'across the board' selection in the plug-in admin), retrieves the appropriate R or C rate, then applies any markup fee that was set in the plug-in admin. Since installing this in December, our published shipping rates are consistently reasonable for all customers (R and C). This makes us look much more competitive/ reasonable while avoiding losing money on shipments. PM me if you're interested in this.