Forums / Addon Shipping Modules / UPSXML shipping discount

UPSXML shipping discount

Locked

Views: 1,790

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
22 Apr 2009, 5:56 PM
#1
crawfish avatar

crawfish

New Zenner

Join Date:
Apr 2009
Posts:
3
Plugin Contributions:
0

UPSXML shipping discount

I am using the UPSXML shipping module and need to discount all UPS shipping prices by 20%. We only ship 40 lb sacks of live crawfish overnight. The high shipping cost usually equals or exceeds the product cost, thus our shipping discount keeps our prices competitive. At the very least, I would like the price displayed in the shipping estimate to show the discounted shipping price before the customer initiates the checkout process.

Ideally, I would like the shipping estimator to show:

  • the higher, original UPS shipping price,
  • our 20% discount,
  • and the new, discounted UPS shipping price.

I tried to adjust the shipping cost by adding a negative fraction for the handling fee, but this didn't work; it only gave me a blank page during checkout

From upsxml.php line 269:

ORIGINAL-
$methods[] = array('id' => $type, 'title' => $_type, 'cost' => ($this->(handling_fee * $cost) + $cost));

CHANGED TO-
$methods[] = array('id' => $type, 'title' => $_type, 'cost' => ($this->handling_fee + $cost));

Example:

UPS shipping cost is $100
handling_fee is -0.2

(handling_fee * $cost) + $cost)
(-0.2 * $100) + $100)
-20 + $100 = $80
UPS shipping cost with discount is $80

Maybe my php coding is incorrect.
Other possible options include:

  • a permanent or default coupon without entering a coupon code,
  • a negative tare value,
  • or lowering the shipping weight (last resort)

Viewed these threads while looking for answers:

Can you give a % discount on the UPS shipping mod ?

Handling Fee as Percentage?

Adding Percentage Handling fee UPS

Help a Cajun out, please.

22 Apr 2009, 6:00 PM
#2
crawfish avatar

crawfish

New Zenner

Join Date:
Apr 2009
Posts:
3
Plugin Contributions:
0

Re: UPSXML shipping discount

Oops, looks like I reversed the order of the code from line 269.
CHANGED TO: is the ORIGINAL snippet and ORIGINAL: should be CHANGED TO.

23 Apr 2009, 3:24 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: UPSXML shipping discount

IF this is the line you are using now, there is a typo:

$methods[] = array('id' => $type, 'title' => $_type, 'cost' => ([B]$this->(handling_fee[/B] * $cost) + $cost));

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Apr 2009, 6:48 PM
#4
crawfish avatar

crawfish

New Zenner

Join Date:
Apr 2009
Posts:
3
Plugin Contributions:
0

Re: UPSXML shipping discount

Not sure I follow, what/where is the typo ? The part in red is the same as mine. Are you saying that is the invalid part ? If so, what do I change it to ? Kinda new to this and thanks for being patient.

23 Apr 2009, 6:55 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: UPSXML shipping discount

I do not have a copy of your code but that part in red I am pretty certain would not be written as:
$this->(

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!