Forums / Built-in Shipping and Payment Modules / Alternate Shipping above a certain weight?

Alternate Shipping above a certain weight?

Locked

Views: 1,694

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
26 Sep 2008, 4:14 PM
#1
segnosaur avatar

segnosaur

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Alternate Shipping above a certain weight?

Just wondering if this is possible in Zen Cart, or if someone has done any mods to fix this...

We have a situation with mutiple 'cloned' modules for ship by weight. What we would like to do is have a situation where if we are below a certain threshold, we could use any of the shipping modules, but if we are above a certain threshold we are restricted to only one of the shipping methods.

The problem is, if we create a table #1 with a maximum weight (of lets say 10 pounds), and add a 20 pound item to it, the shipping cost is estimated as '0'. Instead, it shouldn't even show this as a shipping option, and should instead only show the estimates for the other tables.

Thanks in advance.

26 Sep 2008, 4:47 PM
#2
ronpeled avatar

ronpeled

Zen Follower

Join Date:
Sep 2004
Location:
LA, California
Posts:
111
Plugin Contributions:
0

Re: Alternate Shipping above a certain weight?

Are you sure this is not a configuration issue? Have you tried all of your configuration options?

We have successfully implemented many shipping scenarios and in the more complicated ones we try to either use the table one and cover all cases. Or effectively use multiple shipping modules and make it in such a way that automatically some would be more effective for 0-10 pounds and others for 10-50 pounds etc. Hence the user actually chooses the most cost effective.

Ron Peled

26 Sep 2008, 5:19 PM
#3
segnosaur avatar

segnosaur

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Alternate Shipping above a certain weight?

Its quite possible that there is a way to configure it to work the way we need, but I haven't stubled on it yet.

Actually, we have already do something like you suggest, by putting in an artificial shipping cost that is excessivly high for some shipping methods above a threshold weight. The problem is aesthetics; we don't even want the user to SEE a shipping method if its not available.

26 Sep 2008, 5:19 PM
#4
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Alternate Shipping above a certain weight?

I achieved what you are looking for with clones of a zone tables module.

We needed to force the display/hide of 2 shipping choices, based on the shipping weight, coupled with the shipping zone.

The purpose was to have ONLY Royal Mail pricing for orders with a shipping weight UNDER 2kg, and to have ONLY ParcelForce24 pricing for orders with a shipping weight OVER 2kg.

We further needed to have zone-configured prices for each service (hence the decision to clone zonetables) so that correct rates could show for outlying UK regions for the two methods on offer

You can see it in operation at https://www.edutrade.co.uk

Go to that site, and add some items to a cart, total weight under 2kg. Then, using the shipping estimator on the shopping cart page, select ENGLAND as the zone.

  • If your cart has a weight UNDER 2kg, it will offer ONLY Royal Mail 1st Class Recorded (at England rates).

  • If your cart has a weight OVER 2kg, it will offer ONLY ParcelForce24 (at England rates). Now increase the cart items to exceed 2kg - see what happens.

  • If your cart is over 2kg, and you now select CHANNEL ISLANDS, it will still apply Parcelforce24 - and will now price the shipping according to ParcelfForce rates for Channel Islands.

It took some doing, but it works perfectly. The secret was a nifty addition to the modules' php code which hides/displays the relevant shipping method, based on the cart weight.

As a client paid for this I cannot offer it for free. If you want it, I will have to clear it with the client first.

26 Sep 2008, 6:03 PM
#6
segnosaur avatar

segnosaur

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Alternate Shipping above a certain weight?

fairestcape:

We needed to force the display/hide of 2 shipping choices, based on the shipping weight, coupled with the shipping zone.

The purpose was to have ONLY Royal Mail pricing for orders with a shipping weight UNDER 2kg, and to have ONLY ParcelForce24 pricing for orders with a shipping weight OVER 2kg.
...
It took some doing, but it works perfectly. The secret was a nifty addition to the modules' php code which hides/displays the relevant shipping method, based on the cart weight.
Yeah, that's pretty much what we were looking for. Well, at least from the looks of things I'll have to do a little PHP work.

As a client paid for this I cannot offer it for free. If you want it, I will have to clear it with the client first.
Yeah, I understand. My company has dealt with those types of software ownership issues ourselves.

29 Sep 2008, 2:44 PM
#8
segnosaur avatar

segnosaur

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Alternate Shipping above a certain weight?

fairestcape:

Would you like me to talk to the client?

Well, that would be appreciated. But don't make any special effort for that. (Its a small problem that we can live with, since there are workarounds.)

29 Sep 2008, 3:28 PM
#9
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Alternate Shipping above a certain weight?

What shipping module (and its clone) are you using? My php modifications may help you.

29 Sep 2008, 6:25 PM
#10
segnosaur avatar

segnosaur

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Alternate Shipping above a certain weight?

fairestcape:

What shipping module (and its clone) are you using? My php modifications may help you.

We're using the table.php shipping module (and a clones of it).

The 2 shipping methods are for postal and courier. The problem is, the post office won't accept packages over a certain weight (and some of the products can't be subdivided). So, if the weight is over 10 pounds, we have to use the courier.

Like I said, we do have workarounds (we can set up the postal table to have values resembling the courier table above the threshold weight). It would just be 'nice' to have the postal values totally hidden when we can't use postal service.

29 Sep 2008, 7:16 PM
#11
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Alternate Shipping above a certain weight?

Okay... this is a possible solution (and forms a PART of my solution but not all of it!)

You are free to test it and to use it if it suits your needs.

I strongly advise you backup copies of your existing shipping mods (the table and cloned table), and then apply this.

Revert to original files if this is not suitable / does not work

In your FIRST TABLES MODULE...
eg:
(includes/modules/shipping/table1.php)

Find:-

  	  function table() {
    global $order, $db;

    $this->code = 'table';
    $this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_TABLE_TAX_BASIS;
    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
    }

Make the additions as shown (nb: addition of $total_weight at the top):

  function table() {
    global $order, $db, $total_weight;

    $this->code = 'table';
    $this->title = MODULE_SHIPPING_TABLE_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_TABLE_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_TABLE_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_TABLE_TAX_CLASS;
    $this->tax_basis = MODULE_SHIPPING_TABLE_TAX_BASIS;
    // disable only when entire cart is free shipping
    if (zen_get_shipping_enabled($this->code)) {
      $this->enabled = ((MODULE_SHIPPING_TABLE_STATUS == 'True') ? true : false);
    }
    // Minimum Shipping Weight: If the shipping weight more then XKg disable the module
    if ($total_weight > X) {
      $this->enabled = false;
  	}

(... where Xkg is in your case 150) ... so this one is for shipping module configured for consignments UNDER 150kg.

Then, basically do the same to the CLONED module, this time switching > (GREATER THAN) to < (LESS THAN).

// Minimum Shipping Weight: If the shipping weight less then XKg disable the module
 if ($total_weight < X) {
   $this->enabled = false;
 }

You may have to set your shipping TARE to 0 all round as this "fix" does not like tare settings - but as you are working in big values (150kg) this should not matter. You could try by leaving tare settings as is, then test it at thresholds close to 150.

29 Sep 2008, 7:45 PM
#12
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town &amp; London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Alternate Shipping above a certain weight?

Sorry guys...

... in my explanation above, where am I getting 150kg from???

Your value will be 10 (for 10 pounds).

Of course this numerical variable can be set to any value you need....

30 Sep 2008, 6:31 PM
#13
segnosaur avatar

segnosaur

New Zenner

Join Date:
Oct 2007
Posts:
19
Plugin Contributions:
0

Re: Alternate Shipping above a certain weight?

fairestcape:

Okay... this is a possible solution (and forms a PART of my solution but not all of it!)

Thank you very much. I have tried it out and it seems to meet our needs perfectly.