UPS Negotiated Rate

  • Posts: 90
  • Thank you received: 0
  • Hikashop Essential
10 years 3 weeks ago #177786

-- url of the page with the problem -- : www.casesmithcustoms.com
-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.4

Still no luck with the UPS shipping plugin for showing a "Negotiated Rate" in checkout..

I had this working and then is just reverted back..

Does anyone have the negotiated rate for UPS shipping working for their checkout and showing the discounted shipping prices?

any ideas of why it is not working for me?

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

  • Posts: 12953
  • Thank you received: 1778
10 years 3 weeks ago #177859

Hello,
I'm currently doing some modifications on the UPS plugin regarding the Negotiated rate option, so I'll give you the last UPS plugin version when I'll finish it :).

The following user(s) said Thank You: pouce

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

  • Posts: 90
  • Thank you received: 0
  • Hikashop Essential
10 years 3 weeks ago #177864

Great news... thanks! No rush, I look forward to seeing it...

Reed

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

  • Posts: 79
  • Thank you received: 5
10 years 2 weeks ago #178966

It's displaying the public rates for me also.

I was with a technical commercial of ups this morning whom asked me to show the xml file but I wasn't able to show it to him

I found on the forum that you can get the xml file by addind : var_dump($xml);exit;
just after curl_setopt($session,CURLOPT_POSTFIELDS,$xml); on line ~828
but did not work.
Well It was for canadian post but thought it could work for ups

I tested this solution in a local webserver

UPDATE : The file is plugins/hikashopshipping/ups/ups.php

joomla 3.3.6
hikashop 2.3.4

Last edit: 10 years 2 weeks ago by pouce.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 1 week ago #179341

Hello,
Note that I already changed the code of the ups negotiated rate option and I'm actually testing it on my end.
If you want to display the xml code that is sent to UPS, you'll have to un-comment that line :

//echo '<!-- '. $result. ' -->'; // THIS LINE IS FOR DEBUG PURPOSES ONLY-IT WILL SHOW IN HTML COMMENTS

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

  • Posts: 79
  • Thank you received: 5
10 years 1 week ago #179422

Hello,

I can't find this commented line on the ups.php file. In which file shall I find it or where to add this line in ups.php, please ?

Regards,

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

  • Posts: 12953
  • Thank you received: 1778
10 years 1 week ago #179424

You'll have to add that line :

echo '<!-- '. $result. ' -->'; // THIS LINE IS FOR DEBUG PURPOSES ONLY-IT WILL SHOW IN HTML COMMENTS
just before these lines :
$session = curl_init("https://www.ups.com/ups.app/xml/Rate");
		curl_setopt($session, CURLOPT_HEADER, 1);
		curl_setopt($session,CURLOPT_POST,1);
		curl_setopt($session,CURLOPT_TIMEOUT, 30);
		curl_setopt($session,CURLOPT_RETURNTRANSFER,1);
		curl_setopt ($session, CURLOPT_SSL_VERIFYPEER, 0);
		curl_setopt ($session, CURLOPT_SSL_VERIFYHOST, 0);
		curl_setopt($session,CURLOPT_POSTFIELDS,$xml);

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

  • Posts: 79
  • Thank you received: 5
10 years 1 week ago #179740

Sorry I can't get it show the html comments
I went to the end of the order process, at which step of the order is it shown ?
The order wasn't confirmed as our shop is already online and :P I don't want to buy one of our products
Thank you I'm a newbie Hikashop.

Just want to say that hikashop is the best e-commerce solution for joomla!

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

  • Posts: 12953
  • Thank you received: 1778
10 years 1 week ago #179794

Hello,

Sorry I can't get it show the html comments

If you have correctly added the code on the ups shipping method, you'll find it on the html comments of the shipping step of your checkout workflow.

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

  • Posts: 90
  • Thank you received: 0
  • Hikashop Essential
9 years 11 months ago #182603

Hi,

Any luck with the UPS plugin and negotiated rates? Just curious if it looks like the project will be completed?

Thanks,
Reed

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

  • Posts: 12953
  • Thank you received: 1778
9 years 11 months ago #182623

Hello Reed,
I already added and fixed the code of the negotiated rate option (now you'll have to add a state/province code through your warehouse address)

The following user(s) said Thank You: reedstickets

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

  • Posts: 90
  • Thank you received: 0
  • Hikashop Essential
9 years 11 months ago #183838

Great! Seems to work now... Thanks for all the help and work on this Mohamed!

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

  • Posts: 64
  • Thank you received: 0
9 years 3 months ago #210999

Hi,

I tried negotiated rate but I am getting regular price.It does not make any change if I change negotiated setting to "Yes" or "No".I am able to see negotiated rate on UPS.com but not in hikashop.Could you please tell me if there is any setting I need to do on UPS?


Thank you.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 3 months ago #211010

Hi,

Can you make sure that you have the latest version of HikaShop ?
Old versions of the UPS plugin had an issue with negociated rates.

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

  • Posts: 64
  • Thank you received: 0
9 years 3 months ago #211042

Yes,I have checked this with new hikashop setup but negotiated retes are not showing?On the other hand I am able to see negotiated rate.


Thanks,

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 3 months ago #211071

Hi,

Can you make sure with UPS that your UPS account has the negotiated rates activated for the "shipping and rating API" ?
It's possible to have a UPS account with the negotiated rates activated for the online website but not the API so maybe you're in that case.

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

  • Posts: 64
  • Thank you received: 0
9 years 3 months ago #211074

I checked xml and I am getting negotiated rates with regular rates.So it seems code is handling only regular rates.After changes I am able to get negotiated rate.Below is the code changes in if condition if(!empty($is_negotiated_rate)) {,it would be great if you can confirm if this is fine.

foreach($xml->RatedShipment as $rate){
	$shipment[$i]['value'] = (string) $rate->TotalCharges->MonetaryValue;
	$shipment[$i]['currency_code'] = (string)$rate->TotalCharges->CurrencyCode;
	$shipment[$i]['old_currency_code'] = (string)$rate->TotalCharges->CurrencyCode;
	if(!empty($is_negotiated_rate)) {
		if(isset($rate->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue) && 
		isset($rate->NegotiatedRates->NetSummaryCharges->GrandTotal->CurrencyCode)){
			$shipment[$i]['value'] = (string)$rate->NegotiatedRates->NetSummaryCharges->GrandTotal->MonetaryValue;
			$shipment[$i]['currency_code']= (string)$rate->NegotiatedRates->NetSummaryCharges->GrandTotal->CurrencyCode;
			$shipment[$i]['old_currency_code']= (string)$rate->NegotiatedRates->NetSummaryCharges->GrandTotal->CurrencyCode;					
		}
	}		
	$shipment[$i]['code'] = (string)$rate->Service->Code;
	$shipment[$i]['delivery_day'] = (string)$rate->GuaranteedDaysToDelivery;
	$shipment[$i]['delivery_time'] = (string)$rate->ScheduledDeliveryTime;
	$i++;
}

Thanks,

Last edit: 9 years 3 months ago by Jerome. Reason: clean code

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

  • Posts: 12953
  • Thank you received: 1778
9 years 3 months ago #211142

Hello,
That code will work fine if you've correctly set the is_negotiated_rate variable, also regarding the "$rate->NegotiatedRates" you're correctly testing if it's set, so that code will probably correctly do what you want, I'll also re-do some tests regarding the "Negotiated Rates" option on my end.
Thanks for your feedback.

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

Time to create page: 0.111 seconds
Powered by Kunena Forum