UPS Delivery Constants Not Working and Other Issue

  • Posts: 37
  • Thank you received: 3
9 years 1 month ago #216928

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.4.45
-- Browser(s) name and version -- : Chrome 45.0.2454.101
-- Error-message(debug-mod must be tuned on) -- : n/a

1) Before I updated the UPS plugin, the NO_DELIVERY_HOUR constant displayed "No delivery hour". Now that I've updated, it is showing up blank everywhere. (The normal DELIVERY_HOUR constant displays its hours just fine.) BTW, it would be more appropriate to use "By End of Day" as the default than "No delivery hour" since that's what UPS specifies. (See Issue #1s on screenshot.)

2) In addition, the ESTIMATED_TIME_AFTER_SEND constant displays the number of days for all services except UPS Ground. UPS does know how long it takes to get from the shipper to the destination for ground shipping to I assume their API is returning that value. (See Issue #2 on screenshot)

3) The USPS shipping plugin has an option to display the shipping services in ascending/descending order by price. This UPS plugin has no such option and it is needed. The services are displayed in the same order as they are in the backend of the plugin which seems random. Most customers will choose the cheapest option so it should go at the top. (See reference of Issue #3 on screenshot)

4) We have chosen not to use product dimensions by choosing to 'Exclude Dimensions' in the configuration. However, every time a customer adds a product without dimensions specified in the backend, HikaShop displays a message that "The Width is missing for the product...", "The Length is missing..., and "The Height is missing..." (See Issue #4 on screenshot)

5) This plugin is randomly displaying the number of packages and they make no sense to me. I have tested several ways and there is no pattern that I can see for when it displays the number of packages and when it doesn't. Very inconsistent so I don't know if you can shed any light on that.

Note: The entire 'Generic Configuration' section of the UPS configuration is missing from the documentation page. I did find the same content on the Manual Shipping Methods documentation so it would be nice if it was either copied over or referenced on the UPS and other shipping methods' documentation pages. It would have saved us an unnecessary ticket yesterday concerning one of it's settings.

Attachments:
Last edit: 9 years 1 month ago by efocus. Reason: Added another issue

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
9 years 1 month ago #217038

Hello,

1. Thanks for your feedback, I just fixed it through the last UPS version, to fix it you'll just have to edit the "ups.php" file of you UPS shipping plugin, and change the lines :

if(isset($rate->shipping_params->show_eta) && $rate->shipping_params->show_eta){
	if($method['delivery_day'] != -1)
		$new_usable_rates[$i]->shipping_description .= ' '.JText::sprintf('ESTIMATED_TIME_AFTER_SEND', $method['delivery_day']);
	else
		$new_usable_rates[$i]->shipping_description .= ' '.JText::_('NO_ESTIMATED_TIME_AFTER_SEND');

	if($method['delivery_time'] != -1)
		$new_usable_rates[$i]->shipping_description .= '<br/>'.JText::sprintf('DELIVERY_HOUR', $method['delivery_time']);
	else
		$new_usable_rates[$i]->shipping_description .= '<br/>'.JText::_('NO_DELIVERY_HOUR');
}
By :
if(isset($rate->shipping_params->show_eta) && $rate->shipping_params->show_eta){
	if(!empty($method['delivery_day']) && $method['delivery_day'] != -1)
		$new_usable_rates[$i]->shipping_description .= ' '.JText::sprintf('ESTIMATED_TIME_AFTER_SEND', $method['delivery_day']);
	else
		$new_usable_rates[$i]->shipping_description .= ' '.JText::_('NO_ESTIMATED_TIME_AFTER_SEND');

	if(!empty($method['delivery_time']) && $method['delivery_time'] != -1)
		$new_usable_rates[$i]->shipping_description .= '<br/>'.JText::sprintf('DELIVERY_HOUR', $method['delivery_time']);
	else
		$new_usable_rates[$i]->shipping_description .= '<br/>'.JText::_('NO_DELIVERY_HOUR');
}
Also, if you want to change the "" message by "By End of Day", you'll just have to change the translation of the "NO_DELIVERY_HOUR" word through you Hikashop translation file via "Hikashop->System->Configuration->Languages".
2. If it's not displayed for the UPS ground, that means that the UPS platform doesn't return that information, I just tested it on my end, and no information about the delivery day/time were sent.

3. To do that you'll have to directly edit the code of the UPS plugin, I just added it on our TODO list.

4. That's because the UPS platform NEEDS the product dimensions to return the correct rates, you won't be able to use UPS without your product dimensions.

5. It will display the number of package only if you have set the "Group packages" option to YES through your UPS shipping configuration page.

The following user(s) said Thank You: efocus

Please Log in or Create an account to join the conversation.

  • Posts: 37
  • Thank you received: 3
9 years 1 month ago #217190

Thank you for all the feedback! It was very helpful.

1) I updated the code you suggested in public_html > plugins > hikashopshipping > ups > ups.php and it fixed the issue. I updated the wording with the Language Manager as suggested and it works great now!

2) Checking with UPS on this issue. No word yet.

3) Looking forward to being able to sort the rates by cost when you get to it. Already had a few customers confused with so many options to choose from in random order. So we have disabled most of the UPS air options for now.

4) The client added in all product dimensions and the dimension messaging went away.

5) We do have "Group Packages" enabled. It is very random in what it displays. It sometimes shows 2 packages for one product and if I click "Proceed to Checkout" on the mini cart in the sidebar, it updates to 1 package (not shown but assumed). So I tested by not using the mini cart for changing product quantities or using the proceed to checkout. I only added new products to adjust the number of products. That seems to work so making changes in the mini cart appears to be what causes random package numbers, not adding products to cart.

I also tested updating the product quantity on the checkout page and it is not consistent either. Using the add to cart method, 20 overhead lights generated 2 packages. Changing the quantity to 40 products still says 2 packages. Changing it back to 20 products now shows no packages. Changing to 40 again, incorrectly showing 2 packages. Changed to 80 products, it says 3 packages but using the add to cart method, 80 products should be 6 packages.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
9 years 1 month ago #217271

Hello,

Note that you can disable the displaying of the group package option, by directly editing the "X_PACKAGES" translation word through your translation file via "Hikashop->System->Configuration->Languages".

Also, I just tested it on my end and it seemed to work fine, can you give me a temporary Back-end / FTP access to your website so that I can directly check it and see from where your issue is coming ?

Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 37
  • Thank you received: 3
9 years 1 month ago #217777

Hi Mohamed,

I PM'd the credentials to you last Friday. Let me know when you've had a chance to see what's going on.

Thank you!

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 1 month ago #217779

Hi,

Please do not use private message to contact the support team.
Please use the "contact us" form.
www.hikashop.com/support/contact-us.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: efocus

Please Log in or Create an account to join the conversation.

  • Posts: 37
  • Thank you received: 3
9 years 1 month ago #217858

Thanks Jerome,

I guess I've never had to do that before. Sorry for the mistake. I have sent the credentials requested. I forgot the FTP ones in the first email so I sent them in a second email using the contact form.

Thank you!

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
9 years 1 month ago #217987

Hello,
I just checked what was sent to the UPS platform and when I enable the "Negotiated rates" option, the UPS shipping method correctly send this information "<RateInformation><NegotiatedRatesIndicator/></RateInformation>" which is supposed to tell to the UPS platform that we want negotiated rates. Even if I send a 1 lb product without dimension (with the UPS "exclude dimensions" option set to YES), I still have an "UPS Three-Day Select" service available for $22.25 which is too expensive.
Also, as it's said on the UPS developer documentation :

Users who want to obtain their Negotiated Rates or want to see their Account Based Rating (ABR) information via the Rating API first need to have their account numbers set up for ABR by their UPS Account Executive and then authenticate their account.


After some further tests, her is the response that we are receiving from the UPS platform:
<RatedShipment>
	<Service>
		<Code>12</Code>
	</Service>
	<RatedShipmentWarning>Your invoice may vary from the displayed reference rates</RatedShipmentWarning>
	<BillingWeight>
		<UnitOfMeasurement>
			<Code>LBS</Code>
		</UnitOfMeasurement>
		<Weight>2.0</Weight>
	</BillingWeight>
	<TransportationCharges>
		<CurrencyCode>USD</CurrencyCode>
		<MonetaryValue>25.49</MonetaryValue>
	</TransportationCharges>
	<ServiceOptionsCharges>
		<CurrencyCode>USD</CurrencyCode>
		<MonetaryValue>0.00</MonetaryValue>
	</ServiceOptionsCharges>
	<TotalCharges>
		<CurrencyCode>USD</CurrencyCode>
		<MonetaryValue>25.49</MonetaryValue>
	</TotalCharges>
	<GuaranteedDaysToDelivery>3</GuaranteedDaysToDelivery>
	<ScheduledDeliveryTime/>
	<RatedPackage>
		<TransportationCharges>
			<CurrencyCode>USD</CurrencyCode>
			<MonetaryValue>25.49</MonetaryValue>
		</TransportationCharges>
		<ServiceOptionsCharges>
		<CurrencyCode>USD</CurrencyCode>
		<MonetaryValue>0.00</MonetaryValue>
		</ServiceOptionsCharges>
		<TotalCharges><CurrencyCode>USD</CurrencyCode><MonetaryValue>25.49</MonetaryValue></TotalCharges>
		<Weight>1.1</Weight>
		<BillingWeight><UnitOfMeasurement><Code>LBS</Code></UnitOfMeasurement><Weight>2.0</Weight></BillingWeight>
	</RatedPackage>
	<NegotiatedRates>
	<NetSummaryCharges>
	<GrandTotal>
	<CurrencyCode>USD</CurrencyCode>
	<MonetaryValue>12.50</MonetaryValue>
	</GrandTotal>
	</NetSummaryCharges>
	</NegotiatedRates>
</RatedShipment>
For a 2 lb order, we have :
- A "GrandTotal" = $12.50
- A "TransportationCharges" / "TotalCharges" = $25.49

In our case we always take into account the "TotalCharges" which is always correctly returned. The best solution will probably be to directly ask to UPS about it.

Please Log in or Create an account to join the conversation.

  • Posts: 37
  • Thank you received: 3
9 years 1 month ago #218002

Thanks Mohamed.

We have gone through two levels of tech support at UPS and are waiting for the third to contact us. I really appreciate the response code to prove that we're not getting negotiated rates from them. I'll let you know what I find out.

Please Log in or Create an account to join the conversation.

  • Posts: 37
  • Thank you received: 3
9 years 1 month ago #218119

Mohamed,

I received a reply from UPS Developer Services. Here is the most relevant parts of their response.

Negotiated Rates are only returned for qualified Shipper Account Numbers and eligibility is determined using the combination of User ID and the Shipper's Shipper Account Number in the XML request. The approved shipper number needs to be associated with the User ID used in the XML by adding it the Account Summary under Manage MyUPS at UPS.com.

My client has done all this and is fully qualified.

If the User ID is qualified, both Published Rates and Negotiated Rates are returned. ]If the User ID or Shipper Account Number is not qualified for Negotiated Rates, only Published Rates are returned in the response.

Based on UPS' response and the XML code you provided above, the UPS API is sending both rates.

To receive Negotiated Rates some XML additions are required that are slightly different from a basic request.

I'm not a programmer but looking at your code, it looks like HikaShop's plugin has all the necessary code. I can send you their full reply if you wish.

The negotiated total will be the total cost of the shipment including any service option charges."

From reviewing UPS' response, the negotiated total is the 'GrandTotal' that is returned and is what should be displayed for shipping costs when Negotiated Rates is set to 'Yes' in HikaShop's UPS plugin. The 'TransportationCharges' are the retail/published rates without the service option charges; 'TotalCharges' are the retail/published rates with the service option charges included. They said the the negotiated 'GrandTotal' also includes the service option charges.

How can we have the Negotiated Rates display for our customers at checkout?

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
9 years 1 month ago #218206

Hello,
Thanks for your feedback, that's the only thing I needed to know :

From reviewing UPS' response, the negotiated total is the 'GrandTotal' that is returned and is what should be displayed for shipping costs when Negotiated Rates is set to 'Yes' in HikaShop's UPS plugin. The 'TransportationCharges' are the retail/published rates without the service option charges; 'TotalCharges' are the retail/published rates with the service option charges included. They said the negotiated 'GrandTotal' also includes the service option charges.

I added a fix on that last UPS shipping version, can you test it and tell me if it fixed your issue

File Attachment:

File Name: plg_hikash...0-23.zip
File Size:12 KB

Attachments:
Last edit: 9 years 1 month ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

  • Posts: 37
  • Thank you received: 3
9 years 1 month ago #218256

I installed the new plugin. I'm sorry to say that the displayed rates are still the retail/published rates. I am pretty sure that shipping rates are never cached but I cleared cache just in case but same result. I assume you still have admin and FTP access so feel free to test on your end. A 2 lb order using 3DS to Massachussetts should be $12.50.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 1 month ago #218328

Hi,

HikaShop have a shipping cache system (in order to avoid too much calls to the shipping APIs).
By saving the shipping method configuration in the HikaShop backend, you can change clean the shipping cache and the calls to the API will be re-done.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 37
  • Thank you received: 3
9 years 1 month ago #218354

I did as you asked. I even did it a second time by changing a setting, saving it, then changing it back and saving it again. HikaShop is still not displaying the negotiated rates at checkout.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
9 years 4 weeks ago #218486

Hello,
I added another fix directly by using the temporary FTP access you gave us, it should work fine now.

The following user(s) said Thank You: efocus

Please Log in or Create an account to join the conversation.

  • Posts: 37
  • Thank you received: 3
9 years 4 weeks ago #218561

Mohamed,

It works! Thank you so much for all your hard work.

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum