nopCommerce always adds the products' Additional Shipping Charges AFTER it gets the rate from a shipping plugin. And, thus when you use the TEST button in Shipping Director, it will NOT show any additional charges. If you use the Estimate Shipping in the public cart, then you will see the added charges. Note the " - Product.AdditionalShippingCharge" (minus) in the above expression. That ensures that the Product.AdditionalShippingCharge does not apply to the first quantity of the product. However, if you need also do some type of free shipping (e.g. free for domestic, and above per-item rates only for international), then you can't use the Product's Additional Shipping Charge, and must adjust the above scenario to also include the per-one rate as another element in the Admin Comment, and parse it out.
Here's a simple but useful shipping scenario:
First Item shipping would be £3.50This 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"