Forums / Built-in Shipping and Payment Modules / Different max weight per box for national and overseas shipments

Different max weight per box for national and overseas shipments

Started by frank18 on 13 Feb 2011, 1:29 AM · Views: 1,244

Results 1 to 3 of 3
13 Feb 2011, 1:29 AM
#1
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Different max weight per box for national and overseas shipments

using v 1.3.9h - zone rates with 5 zones

The standard ZC install lets you specify the max weight per box you want to ship. As I understand it this can only be set globally, meaning if your max weight is set to 5kg this would apply to all zones.

Within Australia I can ship up to 5kg in Express Post satchels (the higher value).

Orders to overseas destinations are being shipped by registered air only. AusPost only allows max 2kg per box (the lower value) for this method.

Setting the max weight to the higher value easily covers national shipments but returns the dreaded we are not shipping to your region at this time if the total weight exceeds 2kg. The issue is further complicated by AusPost passing on a so-called US Govt security surcharge of a whopping $9 per item over 0.5kg to the US and some islands under US jurisdiction (eg Guam etc).

What would be the best way to configure

  1. max weight per box within Australia = 5 (my zone 1, geo_zone_id = 2 in DB)
  2. max weight per box to all other zones = 2

??

TIA

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

14 Feb 2011, 12:56 PM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Different max weight per box for national and overseas shipments

frank18:

The standard ZC install lets you specify the max weight per box you want to ship. As I understand it this can only be set globally, meaning if your max weight is set to 5kg this would apply to all zones.

Correct.

frank18:

What would be the best way to configure

  1. max weight per box within Australia = 5 (my zone 1, geo_zone_id = 2 in DB)
  1. max weight per box to all other zones = 2

This will require custom coding of the zones module. In simple terms, you'll first set the global max to something ridiciously high.

Then, in a suitable location in the zones.php file (ie, after it has determined the destination zone) you will be able to take the $shipping_weight & $shipping_num_boxes variables (which at this point will be the total weight of the cart in one box) then using simple maths you will be able to calculate new $shipping_weight & $shipping_num_boxes values based on the maximum allowed by the zone.

Admittedly, this is a somewhat crude method that doesn't take tare weights into account, and it is considered bad practice to directly manipulate the $shipping_weight & $shipping_num_boxes variables directly (it can have unexpected consequences). It also doesn't take the security surcharge into account either, but the destination zone is known to the module (obviously), so adding a DestintationUSA check and adding the surcharge is also possible within the module itself.

Personally I don't think there will be any difficulties in doing this, but as you can probably guess, I've already travelled this path, or a similar one, many times before.

What you are asking isn't TOO different to the much more common question of "How can I apply special rates to a specific category" (and similar), and THIS question has been answered a zillion times before, with some very good examples scattered throughout the forums.

Happy hacking,

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

14 Feb 2011, 1:13 PM
#3
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Different max weight per box for national and overseas shipments

RodG:

....
What you are asking isn't TOO different to the much more common question of "How can I apply special rates to a specific category" (and similar), and THIS question has been answered a zillion times before, with some very good examples scattered throughout the forums.

Happy hacking,

Cheers
Rod

Much appreciated - thanks Rod

Cheers / Frank

NOTE: We are sorry that Frank is no longer with us.
We are grateful for all his contributions to the Zen Cart community.