# Shipping rules based on weight

Thread began 10/28/2010 8:09 pm by phil107723 | Last modified 11/15/2010 10:54 am by Jason Byrnes | 2762 views | 16 replies |

## 10/28/2010 8:09 pm  |  #1 phil107723

### Shipping rules based on weight

What I am tring to do is:

If total weight is less than 1kg or less for 1item then shipping is five dollars but if total weight of items more than 1kg but less than 3kg 7.50 and if weight is equal or greater than 3kg then shipping is 8.5

I was trying with 3 seperate rules but I got undefined variables errors

I need professional help
Thanks

## 10/29/2010 10:12 am  |  #2 Jason ByrnesWebAssist

On the shipping tab, create 3 rules:
1) Less than 1kg:
Triggers:
SubTotal For Any Column
If the subtotal of column [TotalWeight] is [<] a value of [1]

calculations:
Flat rate of 5

2) Greater than 1kg Less Than 3kg:
Triggers:
SubTotal For Any Column
If the subtotal of column [TotalWeight] is [>=] a value of [1]

AND
SubTotal For Any Column
If the subtotal of column [TotalWeight] is [<=] a value of [3]

calculations:
Flat rate of 7.5

3) Greater than 3kg:
Triggers:
SubTotal For Any Column
If the subtotal of column [TotalWeight] is [>] a value of [3]

calculations:
Flat rate of 8.5

## 10/31/2010 4:06 pm  |  #3 phil107723

### Thanks but I've an extra complication

Thanks for that. What's great is the speed of your help and I wasn't that far off on my own. Just to complicate it though I now need to change the cost based on location.
The first location will be just as with the rules but I need to add an extra different cost for each of the rules for the different location.

Now I was thinking somewhere in the shopping cart I would need to have a select location A and would keep the normal rules or select location B which would add the increase to each rule.

Thanks
Phil

## 11/01/2010 4:05 pm  |  #4 Jason ByrnesWebAssist

Can you give a little more detail please.

is there going to be a separate cost for each country? or 2 separate fess, one for inside the US and one for outside the US (or other country).

The best way to do this depends on the number of separate possibilities.

if there are only two separate possibilities, we will create 6 different rules, but if there are more, this becomes unwieldy, so we would store the rate in a session.

## 11/01/2010 6:37 pm  |  #5 phil107723

### More details on shipping costs

Rule: Less than 1kg
Cost for Location A and Location B is \$5

Rule: Greater than 1kg less than 3kg
Cost for location A is \$7.50 but cost for Location B is 8.50

Rule: Greater than 3kg
Cost for location A is \$8.50 but cost for location B is 22.50

Thanks

## 11/02/2010 10:47 am  |  #6 Jason ByrnesWebAssist

What Exactly is location a? A Country? US? UK? Other? OR a City? Boston? Los Angeles?

What Exactly is location b? A Country? Outside US? Outside UK? Other? OR a City? Outside Boston? Outside Los Angeles?

## 11/02/2010 4:21 pm  |  #7 phil107723

### Location A LocationB

Sorry I didn't realise you needed it to be that specific. LocationA is the North Island of New Zealand and Location B is the South Island of New Zealand

## 11/03/2010 2:29 pm  |  #8 Jason ByrnesWebAssist

Ok, thanks for the clarification. Are those choices in the shipping address on the checkout page?

eCart will store the selected shipping country in a a session variable named:
eCartCheckoutForm_shipping_country

you can use this session variable as a trigger. if the value for Nort New Zeland is "NNZ" and South New Zealand is "SNZ":

you can add triggers to the shipping rules:
Based on Session Variable value:
If the session Variable "eCartCheckoutForm_shipping_country" has a value of "NNZ"

For the south island:
Based on Session Variable value:
If the session Variable "eCartCheckoutForm_shipping_country" has a value of "SNZ"

## 11/03/2010 4:14 pm  |  #9 phil107723

### How to include Session variable

Hi
I'm pretty new at session variables but would I include something like this to my check out page?
<select name='eCartCheckoutForm_shipping_country' >
<option value='NNZ' selected >North Island</option>
<option value='SNZ' >South Island</option>
</select>

And if so would I have to include an update buttton to update the total?
Thanks
Phil

## 11/03/2010 4:15 pm  |  #10 Jason ByrnesWebAssist

no, the session will get created when the checkout page posts to the confirm page.

## Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

## Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

## Everything else!

Close Window

Account or customer service questions?

Need technical support?

Content

Layout

Ease of use

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Window

## We were unable to retrieve the attached file

Close Window

### Attach and remove files

• Text Formatting
• Insert Element
• Block Formatting
• Cancel
Close Window

Close Window

#### This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --