This doc will explain in more detail about all the features and possibilities of the ‘Cost per Shipping Class’ option available in the Advanced Pricing section of the Advanced Shipping for WooCommerce plugin.
Shipping Cost Per Shipping Class
Within the ‘Cost per shipping class’ section you are able to add shipping cost for specific shipping classes. This includes setting up rules based on the shipping class quantity, weight or subtotal.
Setting up rules in this section only adds (or deducts) cost from the shipping rate cost, it does not determine if the shipping rate will show or not.
The Shipping Class Field
This field is pretty straight forward. You can select which shipping class you’d like to apply the rule for. All the registered shipping classes will be shown here automatically to choose from. You can create a new shipping class in the WooCommerce > Settings > Shipping > Shipping Classes section of your site.
The ‘Min/Max’ Fields
The ‘Min’ and ‘Max’ fields allow you to setup a simple condition to determine when this cost rule should be applied. Both fields are optional, when left empty it will always apply the cost when the selected shipping class is present in the cart. Leaving either one of them empty will simply not impose a minimum or maximum accordingly.
The fields by default are based on the shipping class quantity that is in the cart. By using special ‘modifier characters’ you can change this to be based on the shipping class weight or subtotal.
Setting Shipping Cost Based On Shipping Class Quantity
The default behaviour of the Min and Max fields is based on the shipping class quantity that is present in the cart. Setting a minimum/maximum allows you to setup different quantity based cost rules. This is a sample setup with different cost based on the quantity.
Setting Shipping Cost Based On Shipping Class Weight
Add a ‘w’ modifier character to change the behaviour of the Min/Max field to be based on the shipping class weight that is present in the cart. The weight is unit independent (meaning its always the same as the store unit), it is a simple comparison of the entered value against the retrieved cart shipping class weight.
Here’s a example of how this would look like;
Setting Shipping Cost Based On Shipping Class Subtotal
To setup cost rules based on the shipping class subtotal you can add a dollar sign (‘$’) modifier character (its always the ‘$’ sign, no matter the currency you’re using).
The ‘Fee amount’ Field
The ‘Fee amount’ is very flexible and has different modifier characters to allow for configuring advanced cost based on the shipping class.
Flat Fee
Entering just any numeric value will simply be added to the shipping cost as a flat fee. Using a minus (-
) sign you can also deduct it from the shipping cost.
Example value: 5
– Add $5 to the shipping rate cost
Example value: -5
– Deducting $5 from the shipping rate cost
Cart Subtotal Percentage
Using a percentage sign (%
) it is possible to charge a percentage of the cart subtotal to be added to the shipping cost.
Example value: 5%
– Adding 5% of the cart subtotal
Shipping Class Subtotal Percentage
If you want to add a percentage of the shipping class subtotal you can add a double percentage sign (%%
) to accomplish that.
Example value: 5%%
– Adding 5% of the shipping class subtotal
Cost per (Shipping Class) Item
Using a asterisk (*
) character you can multiply the given cost with the selected shipping class quantity that is present in the cart.
Example value: 5*
– Adding $5 per item with the selected shipping class
Additional Cost per (Shipping Class) Item
In addition to the above cost per item feature, there’s also a way to setup a ‘Additional cost per item’. This will use the quantity from the ‘Min’ field as the starting point, and add the given cost for any quantity above the Min quantity. To configure this you can use a double asterisk (**
).
Example value: 5**
– Adding $5 per item for anything above the ‘Min quantity’ field value
Min quantity | Max quantity | Fee amount | Shipping class quantity | Shipping cost added |
---|---|---|---|---|
5 | 1** | 8 | $3 | |
5 | 2.5** | 8 | $7.5 | |
10 | 5** | 18 | $40 |
Cost per Interval
The cost per interval functionality can be very powerful when you need it. This allows you to easily configure something like “$10 for every 5 items”. Depending on your needs you may want to round it up or round it down to the nearest quantity divisible by 5. Both rounding options are supported and can be configured.
Cost per Interval Rounding Up
Use a forward slash (/
) to setup a cost per interval and round it up to the nearest quantity divisible by the given value. A valid format of the cost per interval for this would look like:
10/5
– this translates to “Charge $10 for every 5 items, rounding up”.
Here are a couple examples to show the exact working of this feature;
Fee amount | Shipping class quantity | Shipping cost added |
---|---|---|
10/5 | 1 | $10 |
10/5 | 5 | $10 |
10/5 | 6 | $20 |
10/5 | 9 | $20 |
10/5 | 11 | $30 |
Cost per Interval Rounding Down
Using a backslash (\
) it will round down to the nearest quantity that is divisible by the interval. The valid format for this would be similar to the other;
10\5
– this translates to “Charge $10 for every 5 items, rounding down”.
Further example configurations and cost added to show how this works;
Fee amount | Shipping class quantity | Shipping cost added |
---|---|---|
10\5 | 1 | $0 |
10\5 | 5 | $10 |
10\5 | 6 | $10 |
10\5 | 9 | $10 |
10\5 | 11 | $20 |