Forums / Addon Shipping Modules / UPS XML and Discounts on Shipping?

UPS XML and Discounts on Shipping?

Locked

Views: 4,564

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
28 Sep 2010, 2:41 PM
#1
fretty avatar

fretty

New Zenner

Join Date:
Sep 2010
Posts:
59
Plugin Contributions:
0

UPS XML and Discounts on Shipping?

Hi everyone,

I recently installed the UPS XML module and it worked like a charm, thanks for the suggestion to use that (previoud thread)!

Can anyone tell me how to apply a percentage discount to all shipping quotes? It's not built into the admin from what I can tell and I've gone through the UPS XML coding to see if I can find a simple place to just do the math, but no luck. I basically just want to offer a 30% discount across the board on shipping rates.

Any help is much appreciated!
Thank you.

The reason for this is:

The one thing I'm running into is that I currently have a UPS account with Negotiated Rates (discounted rates for being a bulk customer). The rates UPS XML gets from UPS are the full priced rates, so I contacted UPS to see how this can b fixed and they gave me a lengthy reply with how to grab the Negotiated Rates. Unfortunately UPS XML does not support Negotiated Rates and I can't quite figure out how to edit their code properly to use the Negotiated Rates (as I'm sure we can all agree, looking at someone else's code and trying to understand it is a very hard thing indeed).

28 Sep 2010, 3:37 PM
#2
fretty avatar

fretty

New Zenner

Join Date:
Sep 2010
Posts:
59
Plugin Contributions:
0

Re: UPS XML and Discounts on Shipping?

I managed to locate it.

In the file upsxml.php located by default in:
/zen-cart/includes/modules/shipping/

Look down to line 269 and change the following code:
($this->handling_fee + $cost)

To:
(($this->handling_fee + $cost) * THIS-DECIMAL-NUMBER)

Where THIS-DECIMAL-NUMBER is whatever you'd like your discount to be.

Example:
(($this->handling_fee + $cost) * 0.8)
This would give a 20% discount of all rates given by UPS.

28 Sep 2010, 6:22 PM
#3
zc_fan avatar

zc_fan

New Zenner

Join Date:
Sep 2010
Location:
SF Bay Area
Posts:
54
Plugin Contributions:
0

Re: UPS XML and Discounts on Shipping?

This is very strange because I am about to install this UPS XML module for only one reason - to pass on the discounted rates to customer. Now what I understand is that UPS XML module is supposed to pick up the discounted rates you get from UPS through your UPS Rates Access key. But what you say is it is not? The basic Zen Cart installation can pick the retail UPS rates anyway. So why would anyone go through this process.

Are you sure the only way is to add that 20% discount multiplier? Because even still it did not pick up your discounted rate. :unsure:

28 Sep 2010, 7:01 PM
#4
fretty avatar

fretty

New Zenner

Join Date:
Sep 2010
Posts:
59
Plugin Contributions:
0

Re: UPS XML and Discounts on Shipping?

zc_fan:

This is very strange because I am about to install this UPS XML module for only one reason - to pass on the discounted rates to customer. Now what I understand is that UPS XML module is supposed to pick up the discounted rates you get from UPS through your UPS Rates Access key. But what you say is it is not? The basic Zen Cart installation can pick the retail UPS rates anyway. So why would anyone go through this process.

Are you sure the only way is to add that 20% discount multiplier? Because even still it did not pick up your discounted rate. :unsure:

Well, I have attached in a quote my reply from UPS' technical support regarding this for you to view. But to sum it up, your negotiated rate CAN be sent to you via their API, but they come back as different variables. UPS says that their API will send you back both the standard rates and your negotiated rates when you make an API call/request. My problem was that UPS XML does not have the built in coding to allow for negotiated rates. You can always make these changes yourself, which was something I looked into, but the amount of work involved to edit the existing coding to allow for negotiated rates, the amount of different files involved that must be edited etc. just wasn't worth the work when I can just add a flat percentage discount across the board with a simple modification to the code (listed in my previous post).

Here is UPS' e-mail reply.
If you find a way to incorporate this into your code, I'd LOVE to see it, as like I said, I tried but it seemed very complicated (working with other people's code is always complicated for me).

Subject
Technical Support / Developer Resources

Response (Madeline M.) 09/27/2010 03:21 PM
Dear Karl,

Thank you for your inquiry. 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. 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.

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.

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

  1. The approved User ID associated with the Negotiated Rates must be used in the AccessRequest container along with the Access Key and Password.

  2. The approved shipper number must be included in the RatingServiceSelectionRequest/Shipment/Shipper/ShipperNumber container.

  3. The empty node <NegotiatedRatesIndicator/> must be included in the RatingServiceSelectionRequest/Shipment/RateInformation container. The RateInformation container may need to be added as well.

  4. The <StateProvinceCode> node is required in the RatingServiceSelectionRequest/Shipment/Shipper/Address container or RatingServiceSelectionRequest/Shipment/ShipFrom/Address container depending on the absence or presence of the ShipFrom container. If the <ShipFrom> container is present, the <StateProvinceCode> node is required there. In the absence of a <ShipFrom> container the <StateProvinceCode> node is required in the <Shipper> container. It is also required in the RatingServiceSelectionRequest/Shipment/ShipTo/Address container.

Please see the XML snippet below for examples of element placement. Note these are in addition to the already required tags for all Rates Tool requests:

<AccessRequest> <AccessLicenseNumber>XXXXXXXXXXXXXXXX</AccessLicenseNumber> <UserId>XXX..XXX</UserId> <Password>XXXX..XXXX</Password> </AccessRequest> <RatingServiceSelectionRequest> <Shipment> <Shipper> <ShipperNumber>XXXXXX</ShipperNumber> <Address> <StateProvinceCode>XX</StateProvinceCode> <!-- Required here if ShipFrom is not present --> </Address> </Shipper> <ShipFrom> <Address> <StateProvinceCode>XX</StateProvinceCode> <!-- Required here if ShipFrom is present --> </Address> </ShipFrom> <ShipTo> <Address> <StateProvinceCode>XX</StateProvinceCode> <!-- Required --> </ShipTo> <RateInformation> <NegotiatedRatesIndicator/> </RateInformation> </Shipment> </RatingServiceSelectionRequest>
  1. Negotiated rates are returned in the NegotiatedRates node of the XML response and only at the shipment level. Published rates are still returned in the normal locations.
<NegotiatedRates> <NetSummaryCharges> <GrandTotal> <MonetaryValue>16.08</MonetaryValue> </GrandTotal> </NetSummaryCharges> </NegotiatedRates> </RatedShipment>
  1. Lastly, please note that the Customer Integration Environment (CIE) only returns a 1% discount regardless of you actual negotiated rates. You will need to move to production to see your actual rates.

Please contact us if you need any additional assistance.

Madeline M.
UPS Technical Support
UPS now has a new app that lets you Track, Ship, Find Locations and obtain rate quotes directly from your smartphone. Go to m.ups.com or visit ups.com to learn about Apple and BlackBerry device-specific applications.

Customer (UPS E-mail Communications) 09/27/2010 11:50 AM
Your Name: Karl XXXX
Your E-mail Address: [email protected]
Support Category: Technical Support
Support Topic: Developer Resources
Are you the ...:
Your Telephone: XXX-XXX-XXXX
Stage of Development: Post-integration
Developer Resource: XML[ Rating ]
Version Number:
Attach File:
What is your question or comment? The rates being quoted are full priced rates. My account status with UPS gives me a discounted rate which I would like passed on to my customers. Is it possible to have that discount applied automatically when pulling the rates via the UPS API?

Is there somewhere on UPS.com under My Account that allows me to set a percentage discount or to merely tell UPS.com to send the discounted rates when I call upon the API instead of the full rates?

Please call me at XXX-XXX-XXXX as I would like to get this information as soon as possible. Thank you for looking into this matter for me.

28 Sep 2010, 8:02 PM
#5
zc_fan avatar

zc_fan

New Zenner

Join Date:
Sep 2010
Location:
SF Bay Area
Posts:
54
Plugin Contributions:
0

Re: UPS XML and Discounts on Shipping?

My problem was that UPS XML does not have the built in coding to allow for negotiated rates.

Okay, I got two things 1) So UPS XML will give not me negotieted rates; 2) it works on Zen Cart v1.3.9.

I was thinking it would give negotiated rates to customers because the module is being tied to my UPS Access Key.

Thanks for the elaborate response and multiplier crack. I will give iit a try.

28 Sep 2010, 10:06 PM
#6
zc_fan avatar

zc_fan

New Zenner

Join Date:
Sep 2010
Location:
SF Bay Area
Posts:
54
Plugin Contributions:
0

Re: UPS XML and Discounts on Shipping?

I am running Zen Cart on my PC using localhost and installed all the UPS XML files and activated the module from Modules->Shipping. But I get the following error:

Email Error: Could not instantiate mail function. Please check Admin->Configuration->Email Options->Email Transport.

Even though my Email transport method under Configuration is PHP.

Thanks.

2 Oct 2010, 9:37 PM
#7
steeltrepid avatar

steeltrepid

New Zenner

Join Date:
Jun 2009
Posts:
2
Plugin Contributions:
0

Re: UPS XML and Discounts on Shipping?

Thank you for the information everyone. While it is an elegant solution, it works. I just hope I don't end up getting screwed sometime if this makes a mistake.

I too tried to contact UPS and the support person I was in contact with was not very helpful. I wonder if I pass on this information if it could help them a little? I know Zen Cart is small and I guess a lot of people really doesn't use it but I would think a company as big as UPS could do something for us? Modify this module and provide it on their site? With everything working of course. All we can do is hope. For now though it seems to work and I'm happy now. Hopefully people will appreciate the savings and opt for UPS shipping more often. I want to ship more with UPS because they sent me some kick ###### coupons and I want to utilize them before they expire!! Thanks again!