Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Disable PER_WEIGHT_UNIT if UPS module active

Disable PER_WEIGHT_UNIT if UPS module active

Locked

Views: 1,106

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
21 Nov 2009, 12:51 AM
#1
bobthemolder avatar

bobthemolder

Zen Follower

Join Date:
Nov 2008
Posts:
164
Plugin Contributions:
0

Disable PER_WEIGHT_UNIT if UPS module active

Just wanted to share something, in case anyone else runs into this in the future.
I have 3 shipping methods active:

  • Free Pickup
  • UPS Shipping Module
  • Per Weight Unit

Now, if UPS can handle the order, I don't want the "Per Weight Unit" option to show because the total usually comes to less than UPS, which is what I use to ship anyways.

I actually just had an order come through on a $20 item, where the UPS quote was $35, and the customer selected "Per Weight Unit" of $15, in effect making the total order equal to the shipping cost. Of course, I would lose money on this if I fulfilled the order. So you see my problem.

But being that I do get orders over the 150lb UPS weight limit, I need something to give them a quote. Even if it's off by a bit, I can let the larger orders eat into my profit a bit to close the sale.

But I'm rambling, so here's what I did:
In includes/modules/shipping/perweightunit.php add the following code

	// disable if UPS module can handle shipping cost, i.e. order is less than 150 lbs
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = (($_SESSION['cart']->show_weight() > 150) ? true : false);
    }	

after:

    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_PERWEIGHTUNIT_STATUS == 'True') ? true : false);
    }

And voila! Hope this keeps someone from :censored::frusty::cry:

21 Nov 2009, 12:53 AM
#2
bobthemolder avatar

bobthemolder

Zen Follower

Join Date:
Nov 2008
Posts:
164
Plugin Contributions:
0

Re: Disable PER_WEIGHT_UNIT if UPS module active

Does anyone know what folder I can put this in so it doesn't get overwritten in an update?

21 Nov 2009, 2:52 AM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Disable PER_WEIGHT_UNIT if UPS module active

You will need to either clone the shipping module or save a copy for future upgrades as there are no overrides for the shipping modules code files ...

21 Nov 2009, 3:00 AM
#4
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Disable PER_WEIGHT_UNIT if UPS module active

Ajeh:

You will need to either clone the shipping module or save a copy for future upgrades as there are no overrides for the shipping modules code files ...

Ajeh,
What do we add to disable ups when shipping international using zones in the shipping cart? I have both UPS and zone rates showing up when I enter a international address...I don't want ups to show on international orders nor international rates showing up when shipping ups in the states.

Shipping & Handling Charge
UPS $16.00

Zone Rates
Shipping to IT (1 Boxes) $10.50

Thanks

21 Nov 2009, 3:20 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Disable PER_WEIGHT_UNIT if UPS module active

Build a Zone for each of your shipping modules that only includes the places you do want to ship to ...

21 Nov 2009, 4:04 AM
#6
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Disable PER_WEIGHT_UNIT if UPS module active

Ajeh:

Build a Zone for each of your shipping modules that only includes the places you do want to ship to ...

I thought I had done this

21 Nov 2009, 4:24 AM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Disable PER_WEIGHT_UNIT if UPS module active

If you built the Zones and added them to the Shipping Modules, then you would only see the Shipping Modules if you were in the correct Zone ...

On the Zone Rate make sure you have built the Zones to be Skipped correctly ...

21 Nov 2009, 4:35 AM
#8
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Disable PER_WEIGHT_UNIT if UPS module active

Ajeh:

If you built the Zones and added them to the Shipping Modules, then you would only see the Shipping Modules if you were in the correct Zone ...

On the Zone Rate make sure you have built the Zones to be Skipped correctly ...

Looks like I need to read instructions again...

22 Nov 2009, 2:44 PM
#9
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Disable PER_WEIGHT_UNIT if UPS module active

Ok. I have what I need below. What & how can I set up to make this work? I do not want all shipping ways to show up in cart, only the actual shipping available to where items are being shipped.

have basically 3 Shipping rates I need within the US (excluding Alaska & Hawaii--they will have additional rates added to cart before check out)

FIRST RATE - USPS
1 piece of apparel -- $9.00 (additional pieces of apparel added to cart - $1.00 for each piece added)

SECOND RATE: - UPS
1 Pad = $16.00 (weight 7 lbs)
2 Pads = $27.00 (weight 14lbs)
3 Pads = $34.00 (weight 21lbs)
4 Pads = $41.00 (weight 35lbs)
5 Pads = $50.00 (weight 42 lbs)
6 Pads = $57.00 (weight 49 lbs)
7 Pads = $64.00 (weight 56 lbs)
8 Pads = $73.00 (weight 63 lbs)
9 Pads = $80.00 (weight 70 lbs)
10 Pads = $89.00 (weight 77lbs)
and so on...

THIRD RATE: - UPS
1 Pad = $16.00 (weight 5 lbs)
2 Pads = $27.00 (weight 10 lbs)
3 Pads = $34.00 (weight 15 lbs)
4 Pads = $41.00 (weight 20 lbs)
5 Pads = $50.00 (weight 25 lbs)
6 Pads = $57.00 (weight 30 lbs)
7 Pads = $64.00 (weight 35 lbs)
8 Pads = $73.00 (weight 40 lbs)
9 Pads = $80.00 (weight 45 lbs)
10 Pads = $89.00 (weight 50 lbs)
and so on...

*Alaska and Hawaii will have additional $5.00 added to cart before check out.
*ALL International shipping will have additional $30.00 added to cart before check out.

Thanks for you help.
Pkat