Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Where does Magento parse the string returned from UPS? 
 
TechBundle
Member
 
Avatar
Total Posts:  51
Joined:  2008-03-26
 

Where is the code where Magento parses the string returned from the UPS qcostcgi.cgi? I cannot find it anywhere.

Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
TechBundle
Member
 
Avatar
Total Posts:  51
Joined:  2008-03-26
 

The string is parsed in /app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php

The problem we were having is that the customer was not being charged for the rural delivery fees charged by UPS.

If you query UPS, it returns values for both a subtotal and a total. Magento is pulling the subtotal, which does not include fees added by UPS such as rural delivery fees.

We changed the following code in the above-mentioned file, function _parseCgiResponse:

case 3: case 4:
                        if (
in_array($r[1]$allowedMethods)) {
                            $costArr[$r[1]] 
$r[8];
                            
$priceArr[$r[1]] $this->getMethodPrice($r[8]$r[1]);
                        
}
                        
break;

We changed it to the following, just replacing the $r[8] values with $r[10]:

case 3: case 4:
                        if (
in_array($r[1]$allowedMethods)) {
                            $costArr[$r[1]] 
$r[10];
                            
$priceArr[$r[1]] $this->getMethodPrice($r[10]$r[1]);
                        
}
                        
break;

Our client’s website now charges their customers for the rural delivery fee.

 
Magento Community Magento Community
Magento Community
Magento Community
 
alistek
Sr. Member
 
Total Posts:  293
Joined:  2008-04-02
Normal, IL
 

Good job with that, I was actually looking for you but I was braindead too and couldn’t find it.  Didn’t think to look under Usa.  Anyways, good job that I think is a very useful tweak.  Perhaps a Wiki entry would be good for that.

-Adam

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top