Premium tablerates extension allows you to configure complex rules for shipping rates calculation with the use of algorithm column of the csv file. For details about the algorithm, please check our section Configure advanced rules using algorithm column.

Minimum Shipping price and price increment on weight

In this example, we will show you how to calculate the shipping price depending on the weight of the items in cart, and set a minimum shipping price.

Country Region/State City Zip From Zip To Weight >= Weight < Price >= Price < Qty >= Qty < Shipping Price Algorithm Shipping Method Sort Order
USA * * * * * * * * * * 4 w=2@3&min=20 Standard *

Here we offer Standard shipping method only. The price of this method is calculated based on the weight of the items in cart. The algorithm w=2@3, calculates the shipping price based on the weight of the cart.

Weight calculation:

Consider adding 2 quantities of an item to cart that that weighs 5lbs.

  • Weight of the product = 5lbs
  • Qty in cart = 2
  • Total Weight in cart = Sum of <Weight of the product> x <Qty in cart>, of every product in cart.
    In this example, the total weight in cart = 5*2 = 10

    If there was another product with weight 2lbs and quantity 1, then the weight in cart would be, 5*2+2*1 = 12

Shipping price calculation:

First, price is calculated based on weight. The algorithm defined is w=2@3, which means, add $3 for every 2lbs.
The price calculated will be $15.
Shipping price = <price in column shipping price>+<price calculated based on weight> = 4 + 15 = $19, which is less than minimum price ($20).
Hence the final shipping price will be, $20 which is he minimum shipping price.

If we change the algorithm w=2@3 to w=1@2, this will add $2 for every 1lbs, which will make the price based on weight = $20
Final shipping price = <price in column shipping price>+<price calculated based on weight> = 4+20 = $24, which is greater than the minimum price ($20).
Hence the $24 will be the final shipping price.
 

Delivery based on stock availabilty

This example explains how to offer shipping rates based on the stock availability.

Country Region/State City Zip From Zip To Weight >= Weight < Price >= Price < Qty >= Qty < Shipping Price Algorithm Shipping Method Sort Order
USA * * * * * * * * * * 50 instock=true Next Day *
USA * * * * * * * * * * 20 * Standard *

This will offer Standard delivery method for all cases when the country is USA and the shipping price will be $20. Next Day delivery is offered only when the products are in stock and the shipping price for Next Day delivery will be $50. Next Day delivery method will not be available if any or all of the products in cart are out of stock, in which case only Standard delivery method will be offered to the customer.

Note: This will only work when Backorders are enabled. You might not be able to proceed with the checkout, if the product is out of stock otherwise.

 

Custom Shipping Method code and Qty based shipping price

This example shows you how to store a custom shipping method code in the database. The shipping method code will be saved in the database table sales_order. This can then be used with third party integrations.
This also shows you how to add per item surcharge for a particular shipping method.

Country Region/State City Zip From Zip To Weight >= Weight < Price >= Price < Qty >= Qty < Shipping Price Algorithm Shipping Method Sort Order
USA * * * * * * * * * * 50 m=upsground UPS Ground *
USA * * * * * * * * * * 20 m=dhlexpreasy DHL Express Easy *
* * * * * * * * * * * 10 m=dhlexprww&ai=5 DHL Express Worldwide *

The first 2 rows are valid only when the country is USA, whereas, the third row applies to all the other countries except USA. The algorithm column for the USA options shows you how to use a different shipping method code to be saved in the order details, in the database. The third row, which an option for worldwide shipping, shows how to add a surcharge of $5 per item in cart and save a custom shipping method code.

Live chat: cookie consent required

Copyright © Hungersoft 2019

· Terms & Conditions · Privacy policy