comecerodocs
Settings reference

Shipping by subtotal

Price a shipping method by the order subtotal, with flat prices for subtotal ranges in each currency and an optional percentage of the subtotal.

A shipping method priced by subtotal charges by the order subtotal, for example free shipping over $50. Set it up in the dashboard under Store > Shipping Methods, or with subtotal_config in Create a shipping method.

The Add Shipping Method form, priced by the order subtotal

How the price is worked out

  1. If the order subtotal falls in one of your ranges, the price is that range's flat price.
  2. Otherwise, if you set a percentage of the subtotal (percent_of_subtotal), the price is the subtotal times that fraction. 0.1 is 10%, and the most is 3 (300%).
  3. Otherwise the price of a nearby range is used, so the shopper always gets a quote.

With no ranges, the price is always the percentage of the subtotal. The subtotal is the whole order's items subtotal, digital items included, but shipping is only charged when the order has a physical item.

{
  "description": "Standard Shipping",
  "countries": ["US", "CA"],
  "subtotal_config": {
    "percent_of_subtotal": 0.1,
    "rules": [
      {
        "currency": "USD",
        "ranges": [
          { "minimum": 0, "maximum": 50, "price": 15 },
          { "minimum": 50.01, "maximum": 100, "price": 10 }
        ]
      }
    ]
  }
}
Order subtotalPriceWhy
$25$15In the $0 to $50 range
$75$10In the $50.01 to $100 range
$200$20In no range: 10% of $200

Ranges

  • Each entry in rules holds the ranges for one currency. Each currency may appear once.
  • Ranges must not overlap. List them from lowest to highest. When saved, the lowest range starts at 0 and a gap is closed by moving the next range's minimum to the previous maximum plus 0.01.
  • Add as many ranges as you need.

Currencies

When the shopper pays in a currency you gave ranges for, those ranges are used. Otherwise the subtotal is converted into the currency of your first set of ranges to find the range, and the price is converted back into the shopper's currency with your pricing settings' exchange rates and rounding. A percentage of the subtotal is worked out in the shopper's currency.

After the price is found, any adjustment for the shopper's state or province is applied, then tax and shipping promotions.

On this page