Page 1 of 1

Unable to get UPS Module Working

Posted: Sat Dec 16, 2017 7:26 am
by rugged24
I have been at this for several hours , I have googled , searched the forums , and gone through about a hundred threads on the issue with no luck. I have payments set up , I have checked the geozones and done all the localization and the checkout page still does not find ups as an option and returns Warning: No Shipping options are available. Please contact us for assistance!

Im getting this output received from ups through the error log but I cant deduce the issue.

Code: Select all

2017-12-15 23:10:50 - UPS DATA RECV: <?xml version="1.0"?>
<RatingServiceSelectionResponse><Response><TransactionReference><CustomerContext>Bare Bones Rate Request</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>125.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>103.91</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>123.76</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery/><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>103.91</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>123.76</MonetaryValue></TotalCharges><Weight>125.0</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>125.0</Weight></BillingWeight></RatedPackage><NegotiatedRates><NetSummaryCharges><GrandTotal><CurrencyCode>USD</CurrencyCode><MonetaryValue>102.87</MonetaryValue></GrandTotal></NetSummaryCharges></NegotiatedRates></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>125.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>462.49</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>482.34</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery>3</GuaranteedDaysToDelivery><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>462.49</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>482.34</MonetaryValue></TotalCharges><Weight>125.0</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>125.0</Weight></BillingWeight></RatedPackage><NegotiatedRates><NetSummaryCharges><GrandTotal><CurrencyCode>USD</CurrencyCode><MonetaryValue>457.87</MonetaryValue></GrandTotal></NetSummaryCharges></NegotiatedRates></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>125.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>665.54</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>685.39</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery>2</GuaranteedDaysToDelivery><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>665.54</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>685.39</MonetaryValue></TotalCharges><Weight>125.0</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>125.0</Weight></BillingWeight></RatedPackage><NegotiatedRates><NetSummaryCharges><GrandTotal><CurrencyCode>USD</CurrencyCode><MonetaryValue>658.88</MonetaryValue></GrandTotal></NetSummaryCharges></NegotiatedRates></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>125.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>878.07</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>897.92</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery><ScheduledDeliveryTime/><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>878.07</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>897.92</MonetaryValue></TotalCharges><Weight>125.0</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>125.0</Weight></BillingWeight></RatedPackage><NegotiatedRates><NetSummaryCharges><GrandTotal><CurrencyCode>USD</CurrencyCode><MonetaryValue>869.29</MonetaryValue></GrandTotal></NetSummaryCharges></NegotiatedRates></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>125.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>940.87</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>960.72</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery><ScheduledDeliveryTime>8:00 A.M.</ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>940.87</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>960.72</MonetaryValue></TotalCharges><Weight>125.0</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>125.0</Weight></BillingWeight></RatedPackage><NegotiatedRates><NetSummaryCharges><GrandTotal><CurrencyCode>USD</CurrencyCode><MonetaryValue>931.46</MonetaryValue></GrandTotal></NetSummaryCharges></NegotiatedRates></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>125.0</Weight></BillingWeight><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>908.92</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>928.77</MonetaryValue></TotalCharges><GuaranteedDaysToDelivery>1</GuaranteedDaysToDelivery><ScheduledDeliveryTime>10:30 A.M.</ScheduledDeliveryTime><RatedPackage><TransportationCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>908.92</MonetaryValue></TransportationCharges><ServiceOptionsCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>19.85</MonetaryValue></ServiceOptionsCharges><TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>928.77</MonetaryValue></TotalCharges><Weight>125.0</Weight><BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>125.0</Weight></BillingWeight></RatedPackage><NegotiatedRates><NetSummaryCharges><GrandTotal><CurrencyCode>USD</CurrencyCode><MonetaryValue>899.83</MonetaryValue></GrandTotal></NetSummaryCharges></NegotiatedRates></RatedShipment></RatingServiceSelectionResponse>
Please some help would be appreciated.

Re: Unable to get UPS Module Working

Posted: Sat Dec 16, 2017 7:53 am
by straightlight
No OC version posted.

However, this inquiry is quite interesting. Based on the several assumed hours of attempting to find the solution on what took on my end about 10 minutes regarding the issue that has been posted above, this solution may provide what you need: http://www.webassist.com/forums/post/10296/ .

In order to convert this into Opencart v3.x releases, in your catalog/model/extension/shipping/ups.php file,

find:

Code: Select all

$cost = $total_charges->getElementsByTagName('MonetaryValue')->item(0)->nodeValue;

						$currency = $total_charges->getElementsByTagName('CurrencyCode')->item(0)->nodeValue;
replace with:

Code: Select all

//$cost = $total_charges->getElementsByTagName('MonetaryValue')->item(0)->nodeValue;

						$currency = $total_charges->getElementsByTagName('CurrencyCode')->item(0)->nodeValue;
						
						$negotiated_rates = $rated_shipment->getElementsByTagName('NegotiatedRates')->item(0);
						
						$net_summary_charges = $negotiated_rates->getElementsByTagName('NetSummaryCharges')->item(0);
						
						$grand_total = $net_summary_charges->getElementsByTagName('GrandTotal')->item(0);
						
						$cost = $grand_total->getElementsByTagName('MonetaryValue')->item(0)->nodeValue;
See if that fixes the issue.

Re: Unable to get UPS Module Working

Posted: Sat Dec 16, 2017 8:12 am
by straightlight
Code updated above.

Re: Unable to get UPS Module Working

Posted: Sat Dec 16, 2017 8:48 am
by rugged24
I did do the change you posted and still running into the same error , sorry I did not post the version , its 3.0.2.0. I thought it might be a configuration issue not a version incompatibility or a programming issue. I am just a ux/visual developer and im not a big php guy. I just figured that it would come working with the opencart 3.0 installation. Would purchasing a shipping module possibly alleviate this problem if I dont have to programming knowledge to fix this out of date shipping module?

Re: Unable to get UPS Module Working

Posted: Sat Dec 16, 2017 8:58 am
by straightlight
Ensure your total is above 0. If a shipping quote total has been parametered as a value of 0 or under, obviously, the shipping rate may not process its quote.

Re: Unable to get UPS Module Working

Posted: Fri Mar 23, 2018 9:18 am
by quietearth
I had similar problem with freshly installed 3.0.2.0. UPS module was enabled, but UPS shipping options were not showing up in my cart. Here's how I solved it:

Replace one line of code in catalog/model/extension/shipping/admin.php

Find:
if ($this->config->get('ups_' . strtolower($this->config->get('shipping_ups_origin')) . '_' . $code)) {

And replace with:
if ($this->config->get('shipping_ups_' . strtolower($this->config->get('shipping_ups_origin')) . '_' . $code)) {

Now UPS shipping options show up in my cart, and I am a happy camper.

Re: Unable to get UPS Module Working

Posted: Sat Mar 31, 2018 10:50 pm
by dpanderson
Thanks @quietearth, that fixed my problem too (although note that the file to modify is ups.php, not admin.php)

Re: Unable to get UPS Module Working

Posted: Sun Apr 01, 2018 1:08 pm
by cyborgspider
I want to echo that sentiment, changing it to

Code: Select all

shipping_ups
from

Code: Select all

ups
in the PHP got it working for me. I'd spent two hours and looking in the wrong version. I'm on 3.0.2, my UPS API was working just fine (checking the Debug Error Logs), went through Geo zones and units of measurement. nothing was showing up until I I added that code, so thank you.

(now to figure out why my dang Gallery isn't appearing. time to find the right board to complain about that :P )