Page 3 of 3 FirstFirst 123
Results 21 to 23 of 23
  1. #21
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: UPS Residential vs. Commercial rates

    Should work. You might try something like the following in your shipping module:
    Code:
    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

  2. #22
    Join Date
    Sep 2014
    Location
    Indiana
    Posts
    91
    Plugin Contributions
    0

    Default Re: UPS Residential vs. Commercial rates

    Quote Originally Posted by sports guy View Post
    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.
    Last edited by apollowilcox; 11 Apr 2019 at 05:13 PM.

  3. #23
    Join Date
    Sep 2014
    Location
    Indiana
    Posts
    91
    Plugin Contributions
    0

    Default 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.

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Residential vs. Commercial
    By t.harrison in forum Addon Shipping Modules
    Replies: 1
    Last Post: 10 May 2012, 02:07 PM
  2. UPS module - let UPS determine residential or commercial???
    By GoldBuckle in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 3 Apr 2012, 03:45 PM
  3. UPS: Commercial vs Residential
    By asdweb in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 15 Jul 2008, 01:41 PM
  4. UPS Residential or Commercial
    By JackA in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 22 May 2008, 05:24 PM
  5. UPS XML commercial vs residential
    By hrm in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 30 Sep 2006, 02:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR