If you have ever needed to debug UPS shipping prices then this may come in handy. I will show you how to log the xml request you send to UPS to generate rate quotes, and also log the response from ups.

  1. Enable Logging in the admin
  2. Copy /app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php             to      /app/code/local/Mage/Usa/Model/Shipping/Carrier/Ups.php
  3. Now make the following edits to the file you just created.

Edit the following code in _getCgiQuotes method

        //Comment out original code
        //return $this->_parseCgiResponse($responseBody);

        //Log Request
        $result = $this->_parseCgiResponse($responseBody);
        foreach($result ->getRatesByCarrier($this->_code) as $upsRate){
        	if($upsRate instanceof Mage_Shipping_Model_Rate_Result_Error){
        		$timeCode = time();
		        Mage::log($params, null, 'ups-request-'.$timeCode.'.log');
		        Mage::log($response, null, 'ups-response-'.$timeCode.'.log');
		        Mage::log($responseBody, null, 'ups-response-body-'.$timeCode.'.log');
        	}
        }
        return $result ;
        //END Changes