News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

UPS: “Undefined variable: shipment"

Started by OrangeLoon, February 06, 2011, 22:51:25 PM

Previous topic - Next topic

OrangeLoon

All,  This is my first implementation of VirtualMart and I am having an error with the UPS module:
"Undefined variable: shipment in administrator\components\com_virtuemart\classes\shipping\ups.php on line 308".

Line 308 is (out of the box):
if (!$shipment ) {
   //$vmLogger->err( "Error processing the Request to UPS.com" );
   /*$vmLogger->err( "We could not find a UPS shipping rate.
   Please make sure you have entered a valid shipping address.
   Or choose a rate below." );
   // Switch to StandardShipping on Error !!!
   require_once( CLASSPATH . 'shipping/standard_shipping.php' );
          $shipping = new standard_shipping();
          $shipping->list_rates( $d );*/
          return;
          }

I realize that the error is being displayed because of my error setting; however, the UPS module is not displaying the shipping cost.

I viewed the <AccessRequest> and <RatingServiceSelectionResponse> XML via debug and can see that the <RatingServiceSelectionResponse> returns the shipping cost, but it never gets displayed on the page.

After search the forum and web I have covered the following:
*I have received and inputted the UPS Access Key for the production server from UPS.
*I have configured the UPS shipping module to allow for:
UPS Next Day Air, UPS Ground, UPS Standard, and UPS 3 Day Select.
*I have tried both clearing the "Ship From Zip Code" and populated it with the shipping originators zipcode.

I am, at this point, formally stuck.

Any help would be appreciated.

Using:
VirtualMart:1.1.6 stable
PHP Built on: Windows NT 6.1 build 7600
Database Version: 5.5.8-log
Database Collation: utf8_general_ci
PHP Version: 5.2.11
Web Server: Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8k PHP/5.2.11 (WAMP)
Web Server to PHP interface: apache2handler
Joomla! Version: Joomla! 1.5.10 Production/Stable [ Wohmamni ] 27-March-2009 23:00 GMT
User Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13

Thanks

lowmips

Try selecting all services in the module config. If you see rates after doing that, then you should expand your service selections.
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

OrangeLoon


lowmips

Post the XML request/reply here (be sure to REMOVE YOUR CREDENTIALS from the request).
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

OrangeLoon

Thanks for the help - maybe I am overlooked something.
==============================================
<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber>xxxxxxxxxx</AccessLicenseNumber>
<UserId>xxxxxxx</UserId>
<Password>xxxxxxxxx</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>75093-7469</PostalCode>   
         <CountryCode>US</CountryCode>   
         </Address> 
      </Shipper> 
      <ShipTo>   
         <Address>   
            <PostalCode>78665</PostalCode>   
            <CountryCode>US</CountryCode>   
            <ResidentialAddressIndicator/>   
         </Address> 
      </ShipTo> 
      <ShipFrom>   
         <Address>   
            <PostalCode>75093-7469</PostalCode>   
            <CountryCode>US</CountryCode>   
         </Address> 
      </ShipFrom> 
      <Package>   
            <PackagingType>   
               <Code>02</Code>   
            </PackagingType>   
         <PackageWeight>   
            <UnitOfMeasurement>     
               <Code>LBS</Code>   
            </UnitOfMeasurement>   
            <Weight>1</Weight>   
         </PackageWeight> 
      </Package>
   </Shipment>
</RatingServiceSelectionRequest>

==========================================

HTTP/1.1 200 OK
Date: Sun, 06 Feb 2011 15:09:50 GMT
Server: Apache
Pragma: no-cache
Content-Length: 7318
X-Powered-By: Servlet/2.5 JSP/2.1
Vary: User-Agent
Connection: close
Content-Type: application/xml


<?xml version="1.0"?>
<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>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>8.28</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>8.28</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery/>
<ScheduledDeliveryTime/>
<RatedPackage>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>8.28</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>8.28</MonetaryValue>
</TotalCharges>
<Weight>1.0</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
</RatedPackage>
</RatedShipment>
<RatedShipment>
<Service>
<Code>12</Code>
</Service>
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>11.17</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>11.17</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery>3</GuaranteedDaysToDelivery>
<ScheduledDeliveryTime/>
<RatedPackage>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>11.17</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>11.17</MonetaryValue>
</TotalCharges>
<Weight>1.0</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
</RatedPackage>
</RatedShipment>
<RatedShipment>
<Service>
<Code>02</Code>
</Service>
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>15.04</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>15.04</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery>2</GuaranteedDaysToDelivery>
<ScheduledDeliveryTime/>
<RatedPackage>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>15.04</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>15.04</MonetaryValue>
</TotalCharges>
<Weight>1.0</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
</RatedPackage>
</RatedShipment>
<RatedShipment>
<Service>
<Code>13</Code>
</Service>
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>28.23</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>28.23</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
<ScheduledDeliveryTime/>
<RatedPackage>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>28.23</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>28.23</MonetaryValue>
</TotalCharges>
<Weight>1.0</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
</RatedPackage>
</RatedShipment>
<RatedShipment>
<Service>
<Code>14</Code>
</Service>
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>66.11</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>66.11</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
<ScheduledDeliveryTime>8:00 A.M.</ScheduledDeliveryTime>
<RatedPackage>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>66.11</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>66.11</MonetaryValue>
</TotalCharges>
<Weight>1.0</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
</RatedPackage>
</RatedShipment>
<RatedShipment>
<Service>
<Code>01</Code>
</Service>
<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>32.32</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>32.32</MonetaryValue>
</TotalCharges>
<GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery>
<ScheduledDeliveryTime>10:30 A.M.</ScheduledDeliveryTime>
<RatedPackage>
<TransportationCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>32.32</MonetaryValue>
</TransportationCharges>
<ServiceOptionsCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>0.00</MonetaryValue>
</ServiceOptionsCharges>
<TotalCharges>
<CurrencyCode>USD</CurrencyCode>
<MonetaryValue>32.32</MonetaryValue>
</TotalCharges>
<Weight>1.0</Weight>
<BillingWeight>
<UnitOfMeasurement>
<Code>LBS</Code>
</UnitOfMeasurement>
<Weight>1.0</Weight>
</BillingWeight>
</RatedPackage>
</RatedShipment>
</RatingServiceSelectionResponse>

lowmips

You're getting http headers in the reply, which breaks the parser code.  You can try this fix:
http://forum.virtuemart.net/index.php?topic=80529.0

Or use my UPSv2 module:
http://forum.virtuemart.net/index.php?topic=47142.0

Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

OrangeLoon