Shipping Rates with a Minimum Charge

As previously mentioned, I'll be posting some more simple shipping examples...

The first shipping computation example we'll configure is:

Charge a fixed rate of 6% of the shopping cart sub total; however there should be a minimum of $10.

Here are some Shopping Cart Properties that are pre-defined variables in Shipping Director:

$TotalWeightDecimaluses ShippingService.GetShoppingCartTotalWeight()
$SubTotalWithoutDiscountsDecimaluses PriceCalculationService.GetSubTotal()
$SubTotalWithDiscountsDecimaluses PriceCalculationService.GetSubTotal()
$IsFreeShippingDecimaluses OrderTotalCalcService.IsFreeShipping()

(All pre-defined variables start with "$".  Also, when referenced, don't forget to enclose variable names in square brackets [ ] .)

So, 6% of  our "shopping cart sub total" would look like   [$SubTotalWithoutDiscounts] * 0.06

We want to calculate:  If 6% of subtotal is greater than $10, then use it, else use $10.  The If-Then-Else is achieved using the "? : " ternary operator -  condition ? if-true : if-false.

Here's the final record entry:

Above you can see how easy it is to have fixed rates with a minimum charge.   You can have a minimum shipping fee even when using actual rates from an external shipping method (like UPS, Fedex, USPS);  it's easily achieved using the Surcharge Expression - if the Rate returned by the shipper is more than $10, then no surcharge ($0), else the surcharge is the difference between $10 and the Rate returned.


Of course, you'd probably want to change the Name to something like "Shipping Rate".  Or, leave the name for your benefit, and use the Name Expression to override it when displayed to customer.  The Name Expression expects a string expression, so be sure to enclose any text in double quotes.

Tags :  MinimumCharge
Comments
Leave your comment
: