News:

Support the VirtueMart project and become a member

Main Menu

Shipping Response displays all zeros for all shipping options (Now with FIX)

Started by sacramentojoe, September 21, 2008, 04:16:29 AM

Previous topic - Next topic

sacramentojoe

I just ran into a problem with the latest version of Joomla and VM 1.1.2, where a certain request to the shipping api, is showing zeros for the dollar amount to my users. My users think they are getting $150 worth of over night shipping for free.. BAD..

Here is my request in XML form:

<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber>XXX</AccessLicenseNumber>
<UserId>XXX</UserId>
<Password>XXX</Password>
</AccessRequest>
<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
<Request>
<TransactionReference>
<CustomerContext>Shipping Estimate</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<RequestAction>rate</RequestAction>
<RequestOption>shop</RequestOption>
</Request>
<PickupType>
<Code>01</Code>
</PickupType>
<Shipment>
<Shipper>
<Address>
<PostalCode>95662</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</Shipper>
<ShipTo>
<Address>
<PostalCode>95742</PostalCode>
<CountryCode>US</CountryCode>
<ResidentialAddressIndicator/>
</Address>
</ShipTo>
<ShipFrom>
<Address>
<PostalCode>95662</PostalCode>
<CountryCode>US</CountryCode>
</Address>
</ShipFrom>
<Package>
<PackagingType>
<Code>00</Code>
</PackagingType>
<PackageWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>80.25</Weight>
</PackageWeight>
</Package>
</Shipment>


Here is the response that comes back from UPS.
Any help would be greatly appreciated, Thank you.
<ratingserviceselectionresponse>
<response>
<transactionreference>
<customercontext>Shipping Estimate</customercontext>
<xpciversion>1.0001</xpciversion>
</transactionreference>
<responsestatuscode>1</responsestatuscode>
<responsestatusdescription>Success</responsestatusdescription>
</response>
<ratedshipment>
<service>
<code>03</code>
</service>
<ratedshipmentwarning>Additional Handling has automatically been set on Package 1.</ratedshipmentwarning>
<ratedshipmentwarning>Your invoice may vary from the displayed reference rates</ratedshipmentwarning>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>26.39</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>32.89</monetaryvalue>
</totalcharges>
<guaranteeddaystodelivery></guaranteeddaystodelivery>
<scheduleddeliverytime></scheduleddeliverytime>
<ratedpackage>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>26.39</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>32.89</monetaryvalue>
</totalcharges>
<weight>80.2</weight>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
</ratedpackage>
</ratedshipment>
<ratedshipment>
<service>
<code>12</code>
</service>
<ratedshipmentwarning>Additional Handling has automatically been set on Package 1.</ratedshipmentwarning>
<ratedshipmentwarning>Your invoice may vary from the displayed reference rates</ratedshipmentwarning>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>60.79</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>67.29</monetaryvalue>
</totalcharges>
<guaranteeddaystodelivery>3</guaranteeddaystodelivery>
<scheduleddeliverytime></scheduleddeliverytime>
<ratedpackage>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>60.79</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>67.29</monetaryvalue>
</totalcharges>
<weight>80.2</weight>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
</ratedpackage>
</ratedshipment>
<ratedshipment>
<service>
<code>02</code>
</service>
<ratedshipmentwarning>Additional Handling has automatically been set on Package 1.</ratedshipmentwarning>
<ratedshipmentwarning>Your invoice may vary from the displayed reference rates</ratedshipmentwarning>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>80.77</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>87.27</monetaryvalue>
</totalcharges>
<guaranteeddaystodelivery>2</guaranteeddaystodelivery>
<scheduleddeliverytime></scheduleddeliverytime>
<ratedpackage>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>80.77</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>87.27</monetaryvalue>
</totalcharges>
<weight>80.2</weight>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
</ratedpackage>
</ratedshipment>
<ratedshipment>
<service>
<code>13</code>
</service>
<ratedshipmentwarning>Additional Handling has automatically been set on Package 1.</ratedshipmentwarning>
<ratedshipmentwarning>Your invoice may vary from the displayed reference rates</ratedshipmentwarning>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>128.99</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>135.49</monetaryvalue>
</totalcharges>
<guaranteeddaystodelivery>1</guaranteeddaystodelivery>
<scheduleddeliverytime></scheduleddeliverytime>
<ratedpackage>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>128.99</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>135.49</monetaryvalue>
</totalcharges>
<weight>80.2</weight>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
</ratedpackage>
</ratedshipment>
<ratedshipment>
<service>
<code>14</code>
</service>
<ratedshipmentwarning>Additional Handling has automatically been set on Package 1.</ratedshipmentwarning>
<ratedshipmentwarning>Your invoice may vary from the displayed reference rates</ratedshipmentwarning>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>190.38</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>196.88</monetaryvalue>
</totalcharges>
<guaranteeddaystodelivery>1</guaranteeddaystodelivery>
<scheduleddeliverytime>8:30 A.M.</scheduleddeliverytime>
<ratedpackage>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>190.38</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>196.88</monetaryvalue>
</totalcharges>
<weight>80.2</weight>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
</ratedpackage>
</ratedshipment>
<ratedshipment>
<service>
<code>01</code>
</service>
<ratedshipmentwarning>Additional Handling has automatically been set on Package 1.</ratedshipmentwarning>
<ratedshipmentwarning>Your invoice may vary from the displayed reference rates</ratedshipmentwarning>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>152.05</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>158.55</monetaryvalue>
</totalcharges>
<guaranteeddaystodelivery>1</guaranteeddaystodelivery>
<scheduleddeliverytime>10:30 A.M.</scheduleddeliverytime>
<ratedpackage>
<transportationcharges>
<currencycode>USD</currencycode>
<monetaryvalue>152.05</monetaryvalue>
</transportationcharges>
<serviceoptionscharges>
<currencycode>USD</currencycode>
<monetaryvalue>6.50</monetaryvalue>
</serviceoptionscharges>
<totalcharges>
<currencycode>USD</currencycode>
<monetaryvalue>158.55</monetaryvalue>
</totalcharges>
<weight>80.2</weight>
<billingweight>
<unitofmeasurement>
<code>LBS</code>
</unitofmeasurement>
<weight>81.0</weight>
</billingweight>
</ratedpackage>
</ratedshipment>
</ratingserviceselectionresponse>

sacramentojoe

I found the problem, working on a fix as we speak.
In the ups.php file while rate list is being parsed, the code only expects one RatedShipmentWarning element and in this case, there are two.
I'll post a fix once I'm done.

sacramentojoe

OK, this was an easy fix, after I read the domit lite api documentation.
In the ups.php file, I changed the following:

for ($i = 0; $i < $rate_list->getLength(); $i++) {
$currNode =& $rate_list->item($i);

to read as

for ($i = 0; $i < $rate_list->getLength(); $i++) {
$currNode =& $rate_list->item($i);
//place holder for RatedShipmentWarning tags
$ratedShipmentWarnings = $currNode->getElementsByTagName("RatedShipmentWarning");


I basically added a variable to hold the number of RatedShipmentWarning elements.

I also changed this code:

if( $currNode->childNodes[$e]->nodeName == 'RatedShipmentWarning') {
$e++;
}

to read

if( $currNode->childNodes[$e]->nodeName == 'RatedShipmentWarning') {
$e += $ratedShipmentWarnings->getLength();
}


This allows us to increment the $e , element counter variable, to include an infinite number of RatedShipmentWarning messages.

I'm not sure if this is already a known error / bug, but I didn't find anything when I searched the forums. Hopefully this will help out the next person who runs into this issue.

Joe

SA_Chick

Do you know if this fixes the rates for items that are over 80lbs? Seem to be having issues like everyone else. Was wondering why shipping was calculating so low.
~*~Jodi M. aka SA_Chick~*~
www.SourceAutomotive.biz
Running: Joomla 1.0.15 & Virtuemart 1.1.2

lowmips

This is exactly what I fixed in my UPS2.0 module yesterday. I modified the parse code to check each element's name before performing an action on it, instead of assuming a fixed number of elements (well, for the most part. I assumed the XML node children had a fixed number of elements).  See my UPSv2.0 post for details/download if interested.
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

SA_Chick

Plan on installing this as soon as my backup is done downloading, and I will give you a holler after some testing.

Thanks a billion!
~*~Jodi M. aka SA_Chick~*~
www.SourceAutomotive.biz
Running: Joomla 1.0.15 & Virtuemart 1.1.2

quickturn

Quote from: sacramentojoe on September 21, 2008, 21:16:10 PM
OK, this was an easy fix, after I read the domit lite api documentation.
In the ups.php file, I changed the following:

for ($i = 0; $i < $rate_list->getLength(); $i++) {
$currNode =& $rate_list->item($i);

to read as

for ($i = 0; $i < $rate_list->getLength(); $i++) {
$currNode =& $rate_list->item($i);
//place holder for RatedShipmentWarning tags
$ratedShipmentWarnings = $currNode->getElementsByTagName("RatedShipmentWarning");

I basically added a variable to hold the number of RatedShipmentWarning elements.
I also changed this code:

if( $currNode->childNodes[$e]->nodeName == 'RatedShipmentWarning') {
$e++;
}

to read

if( $currNode->childNodes[$e]->nodeName == 'RatedShipmentWarning') {
$e += $ratedShipmentWarnings->getLength();
}

This allows us to increment the $e , element counter variable, to include an infinite number of RatedShipmentWarning messages.
I'm not sure if this is already a known error / bug, but I didn't find anything when I searched the forums. Hopefully this will help out the next person who runs into this issue.
Joe

MAJOR MAJOR MAJOR thank you for this.

zigsdesign

Thank you, This fix also worded for me. It was not a weight related issue. I only had the problem when customers chose Alaska as the shipping destination. It would skip one of the UPS shipping methods and would then only display the handling fee for the rest.
Best Regards,

Chris Ellerbroek
Zigs Design

ctf

I thought the code change worked for me.  and it did fix the problem of the UPS handling fee showing up as the shipping charge when the order weight went over 70lbs.  But now i have another issue.  It won't charge over a certain amount - for example no matter how many items i add when shipping to an example address, the UPS shipping will NOT go over $89.87.  Is it stopping calculating after a certain weight? 

I sell clothing lots, so a 100 pc. lot may be (3) 70lb boxes.  So for the weight I put 210.    i'm not sure at what weight it no longer adds.


ihale

SAME problem, no matter how many i purchase, 2 or 100, the ups rate doesn't change. please help!!!!!!!!!!!!!

thanks.

theengel