Totaling Algorithm Examples

Introduction

Each product is may be assigned to a shipping group using the Shipping Group field under Shipping in the Product listing.

If no shipping group is assigned to a product than the start (*) shipping group is applied. Shipping rates are then defined according to these groups.

For example, you might sell books, maps and DVDs, for which you wish to charge separate shipping rates. You would therefore define package identifier the values of “book”, “DVD”, and “map”.
Bear in mind that the other filtering criteria also come into play, so for instance you can split according to destination, weight, price, #items as well to ensure that correct rates are given. It can get very complex and will require a fair degree of testing to ensure you have things correctly configured. This example ignores other criteria.Shipping Groups, rates and delivery types could then be defined as below
 Shipping Group Rate Delivery Type book 5 Standard map 10 Standard DVD 15 Standard book 7 Express map 15 Express DVD 20 Express

The table below shows the output based on cart contents and totalling algorithm:

 Products in Cart Bare Item Totalling Per Item Totalling Per Product Totalling Sum of Groups Highest Group Price Book & Map TBC \$15 Standard\$22 Express \$15 Standard\$22 Express \$15 Standard\$22 Express \$10 Standard\$15 Express Book, Map, DVD TBC \$30 Standard\$42 Express \$30 Standard\$42 Express \$30 Standard\$42 Express \$15 Standard\$20 Express Book, 2 * Russia Maps TBC \$25 Standard\$37 Express \$15 Standard\$22 Express \$15 Standard\$22 Express \$10 Standard\$15 Express Book, Russia Map, Italy Map TBC \$25 Standard\$37 Express \$25 Standard\$37 Express \$15 Standard\$22 Express \$10 Standard\$15 Express

1. Per Package Totalling

The rules we are implementing:

• Set the price for standard items shipping to the US to \$20
• Set the price for heavy items shipping to the US to \$50
• Combine prices for items from 2 shipping groups  on checkout

Prerequisites

• “package id * includes all items” is set to Yes
• Totalling algorithm  set to Per Package Totalling

The following screenshot show the shipping for the * grouped item:

The following screenshot show the shipping for the HEAVY grouped item:

The following screenshot shows the shipping for both items when in the cart:

2. Highest Price Totalling and IO and I algorithms

Te rules we are implementing

1. Set the shipping price for all items except bikes to \$10
2. Set the shipping price to \$50 for bikes
3. Charge a one off additional fee of \$5 if the customer adds any further items (excluding bikes) to the cart
4. Charge an extra \$10 if they purchase > 1 bike

Solution

1. As you can see below we have created 2 rows in the configuration, 1 for the * items (which in this scenario is everything except bikes) and 1 for the bikes.
2. The base prices should be self-explanatory
3. We use the io= algorithm to specify an additional one off price if > 1 non-bikes are in the cart
4. We use the i= algorithm to specify an additional price if > 1 bikes are in the cart

With the highest price algorithm it will look at the highest priced shipping group (in this case the bikes), and take that as the base cost. Then it looks at any additional per item charges.

Example of Rates Output

Items in cart  Shipping Price
1 x non-bike  \$10
3 x  standard items \$10+\$5=\$15
1 x BIKE item  \$50
3 x BIKE item \$50+(2*\$10)=\$70
3 x BIKE item, 1*non-bike \$50+(2*\$10)+\$5=\$75
3 x BIKE item, 2*non-bike \$50+(2*\$10)+\$5=\$75

3. Totalling Algorithm: Per Item Surcharge Totalling Example

The rules we are implementing:

• Standard rates based on price rages
• Overnight rates for weight over 150 lbs to the US
• Overnight rates to HI, AK, PR

Prerequisites

Using the example in the per_item_surcharge the resulting rates will be as follows:

Items in cart Destination Shipping calculation Final shipping price
1 x \$12 standard item AK \$12  \$6.99
1 x  \$12 standard item, 1 x \$12 item over 75lbs item AK \$7.99 + \$75 \$82.99
1 x  \$12 standard item, 1 x \$12 item over 75lbs item CA \$7.99 \$7.99
1 x \$12 std item, 1 x \$12 item 75lbs, 1x  \$16 item  151 lbs AK \$8.99 + \$75 + \$75  \$158.99

3. Per Item Bare Totalling in Product Matrix

The rules we are implementing:

• For items weighing up to 5lbs charge \$3 for shipping
• For items weighing from 5lbs to 10lbs charge \$5 for shipping
• If two items are in the cart charge separate rates and ad them together

Prerequisites

• “package id * includes all items” is set to No
• Totalling algorithm set to Per Package Item Bare Packaging
Items in cart  Shipping calculation Final shipping price
1 x standard item under 5lbs \$3  \$3
1 x  standard item 7lbs \$5 \$5
1 x standard item under 5lbs,  1 x  standard item 7lbs \$3 + \$5 \$8
2 x standard item under 5lbs \$3 + \$3 \$6

Here is a screenshot of the totalling algorithm in progress at the shopping cart