VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Shipping VM 1.1 => UPS VM 1 => Topic started by: jerepops on February 18, 2011, 19:03:16 PM

Title: UPS International shows no price *FIX*
Post by: jerepops on February 18, 2011, 19:03:16 PM
Already saw 2 threads with this problem. I ran into this problem yesterday and was able to figure it out. Here is the fix. Hope it helps someone.

Open the file ups.php in administrator/components/com_virtuemart/classes/shipping

Change line 232 from:
if( $currNode->childNodes[$e]->nodeName == 'RatedShipmentWarning') {

to:

while( $currNode->childNodes[$e]->nodeName == 'RatedShipmentWarning') {

the problem is ups sometimes returns more then one 'RatedShipmentWarning' so you need to loop through all of them.  The "if" satement just goes through one occurrence, so if more then one was returned then the shipping price would get mapped wrong.  The  "while" statement will continue to loop through the warnings until there are no more.

and boom goes the dyanmite!