Per Item Shipping Rates

Here's a simple but useful shipping scenario:

First Item shipping would be £3.50
Each additional Item adds £1.00

So, for example, 3 items would be £3.50 + £1 + £1 = £5.50

This is easily handled by Shipping Director with a single Option type record:

Type:

Option

Name:

Shipping Rate

Expression:

true

Rate Expression:

3.50 + ((Items.Sum(Quantity)-1) * 1.00)

You can even decide to charge different rates for different countries or postal codes.  For example, shipping to the Highlands and the islands should be

First Item shipping would be £5.50
Each additional Item adds £1.50

For that, we would just add an OptionExit type record ordered before the previous one.  

Type:

OptionExit

Name:

Shipping Rate

Expression:

",AB,BT,DD,HS,IM,IV,KA,PA,PH,TR,ZE,".Contains( Zip.Substring(0,2) )

Rate Expression:

5.50 + ((Items.Sum(Quantity)-1) * 1.50)

OptionExit will exit with the calculated rate when the "Expression" condition is true.  Whereas "Option" with true expression will return the caclulated rate, and continue looking for more Options.

(Note, the above postal codes are just examples.  Determining all the actual codes for the Highlands & islands is more complex)

And finally, a little about the "Name:" field.  This is the option's name displayed to the customer.  In the examples above both Option records used the same Name "Shipping Rate".  But, the Highlands Option could have used "Shipping to Highlands and Islands".   Or, you can also include a "Name Expression".  If none is present, then the "Name" is displayed to the customer.  The Name Expression allows you to caclulate the option's name displayed to the customer.  For examples, see the other blogs like this one where the weight is included in the option name, and see this blog about using localized resources

UPDATE:

The postal code expression above was updated;  in older versions the "Zip" part was written as

  ShippingAddress.ZipPostalCode.Substring(0,2)

Additionally, in any version, you should probably have a prior rule to check that a Zip/Postal code was entered, otherwise an error will result - e.g.

ErrorExit   String.IsNullOrWhitespace(Zip)         "Please enter a zip/postal code"

Tags :  RatePerItem
Comments
Leave your comment
:
xiangzheng0000@gmail.com
Created on: 4/3/2017 8:14 AM
Hello. If I create a Pickup point in shipping config menu, the system name is "Pickup.PickupInStore", how can I check if it is checked or not in shipping director? Thx.
support@nopTools.com
Created on: 4/3/2017 8:29 AM
If the customer chooses a Pickup Point, nopCommerce does not get shipping methods/rates.  Thus, Shipping Director is never called.    Contact us at support at noptools com with more details about what you are trying to do, and we'll see if there is a solution.