Forums / Built-in Shipping and Payment Modules / Subtracting UPS Ground cost from other UPS methods

Subtracting UPS Ground cost from other UPS methods

Locked

Views: 2,918

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
13 May 2009, 6:44 PM
#1
sabucat avatar

sabucat

New Zenner

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

Subtracting UPS Ground cost from other UPS methods

Hi all,

Here's the scenario. Our online store offers free UPS Ground shipping, although the customer is able to pay for expedited UPS shipping if they want to. But since UPS Ground is free (via the free shipping module), I would like to deduct the cost of ground shipping from the expedited methods. Why give the customer free ground shipping but then make them pay full price for expedited UPS shipping? I want the expedited methods to be discounted at the rate of whatever ground shipping costs. For example, right now it might look like:

UPS (Next Day Air Early AM) $122.25
UPS (Next Day Air) $91.25
UPS (Next Day Air Saver) $81.85
UPS (2nd Day Air) $52.60
UPS (3 Day Select) $34.75
UPS (Ground) $14.82

However, I want it to show:

UPS (Next Day Air Early AM) $107.4
UPS (Next Day Air) $76.43
UPS (Next Day Air Saver) $67.03
UPS (2nd Day Air) $37.78
UPS (3 Day Select) $19.93
UPS (Ground) $0.00

This would also allow me to abandon the free shipping module... Not a huge deal, but it would be nice to consolidate everything down to one shipping chart/table. It would also help to avoid customers from accidentally paying for ground shipping instead of selecting the free option (it has happened before, oddly enough). Yes I know I can just remove the UPS Ground option to avoid that, but I also have customers in Alaska and Hawaii who don't get free shipping and must pay for UPS Ground.

I have been trying to figure out how to do this in the ups.php shipping module file, but I can't get it to come out properly, or even at all. I am guessing this is a pretty simple thing to fix, but my background is in Visual Basic so I'm not quite adept at figuring out PHP coding.

Thanks for any help! :cool:

13 May 2009, 8:17 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Subtracting UPS Ground cost from other UPS methods

You need to compute the cost of the Ground shipping from the quote then deduct that from the cost quoted for each method ...

This will take a little customization of the code but it can be done and can work ...

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!

13 May 2009, 8:28 PM
#3
sabucat avatar

sabucat

New Zenner

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

Re: Subtracting UPS Ground cost from other UPS methods

Ajeh:

You need to compute the cost of the Ground shipping from the quote then deduct that from the cost quoted for each method ...

This will take a little customization of the code but it can be done and can work ...

Exactly. I was thinking I could set up a new variable, and assign the cost of UPS Ground to that variable. Then, it would just be a matter of subtracting that variable from the cost... This is where the cost appears to be calculated in ups.php:

if (!in_array($type, $allowed_methods)) continue;
        // EOF: UPS USPS
        $methods[] = array('id' => $type,
                           'title' => $this->types[$type] . $show_box_weight,
                           'cost' => ($cost * MODULE_SHIPPING_UPS_HANDLING) * $shipping_num_boxes);

I would just insert that new variable into the equation in order to subtract it from the cost. That part is easy. But I need help creating the new variable and assigning the cost of ground shipping to that variable.

Any ideas?

14 May 2009, 4:08 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Subtracting UPS Ground cost from other UPS methods

I would have to sit down and actually write the code for this ... but it can be done ... :smile:

HINT: you have to process the results from UPS to get the actual ground cost and then processes the results for building the actual quotes ...

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!