WooCommerce Advanced Shipping Conditions

The WooCommerce Advanced Shipping plugin contains a number of conditions by default you can utilise to set a shipping rate. In this documentation each condition will be explained how it works.

Conditions

Cart

Subtotal

This matches your given number in the value field against the cart subtotal. The subtotal number is excluding coupons/shipping and including taxes.

This condition is not based on the cart total as that would also include the shipping cost, which would give unexpected results.

Subtotal ex. taxes

This condition works the subtotal, but this is without the taxes.

Tax

Compare your given value against the amount of taxes that needs to be paid.

Quantity

The quantity of products in the cart. This is the total number of products and the quantity of those products in the cart. For example, if you have two products in the cart, each of which you have 3 as quantity, the number that is compared against your given value is ‘6’.

Contains product

This condition will match if there is at least one product in the cart that is your selected product. You can have multiple rows of this condition, which would then require EACH product to be at least once in the cart.

You can use different condition groups to make a ‘OR’ situation.

Coupon

The value field must contain a given coupon code. Please make sure the coupon is all lowercase as WooCommerce also only takes lowercase coupons.

Weight

Compare your given value against the total cart weight.

Contains shipping class

This condition will match if there is at least one product in the cart that has the given shipping class. You can have multiple rows of this condition in order to make sure each class is present in the cart, or to make sure a certain class – is not – present.

You can use different condition groups to make a ‘OR’ situation.

User details

Zipcode

Compare the zipcode entered by the user against your value. You can use comma (,) separated values. If you want to set the shipping conditions for users between the zipcode 1000 and 2000, you can create two condition rows, both containing the zipcode condition, but one set to ‘greater or equal to’ and ‘1000’, and the other set to ‘less or equal to’ and ‘2000’.

You can add a asterisk (*) to a zipcode to change its matching functionality to a ‘starts with’ kind of way. The same kind of functionality is used by default by the WooCommerce Advanced Shipping – Shipping Zones Extension.

For zipcodes (numbers only) a range can be created by using a dash (-). For example, entering `1000-2000` will match anything in between those numbers. This functionality does not work when using letters.

City

Match the given value against the users shipping city. Note that this is case insensitive, but does not account for special characters. It is advised to insert every possible value the user can use in the value field. You can use comma (,) separated values.

State

Users’ state must match your chosen state. You can select from the states that are integrated within WooCommerce. If your states are not available, there might be a extension online to add your states to WC. If you want to configure multiple states as a zone, you can use the WooCommerce Advanced Shipping – Shipping Zones Extension.

Country 

Users’ country is compared against the given country. If you want to group a list of countries (for example if you want entire Europe) you can use the WooCommerce Advanced Shipping – Shipping Zones Extension.

User Role

This condition requires the user to have the selected user role. For example, if you want to target guest users, you can use the ‘user role’ – not equal to – ‘customer’ condition.

Product

Width

Compare the given value against the widest product in the cart.

Height

Compare the given value against the highest product in the cart.

Length

Compare the given value against the lengthiest product in the cart.

Stock

All products in the cart must match this stock condition. (e.g. allow next day shipping method only for products that are in stock.

Stock status

All products in the cart must match the selected stock status. If there is one product in the cart that does not match this, it the condition group will not match.

Category

All products in the cart must match the configured category. If there is one product in the cart that does not match the given category, the condition group will not match.

If you only want to require one or more products in the cart to have the given category, you can use the ‘contain category’ condition (read more below).

Custom conditions

WooCommerce Advanced Shipping is made to be very easily extendable. You can add you own conditions, or alter the way an existing condition matches (among others). There are a couple scripts available that you can request with me via a contact form on JeroenSormani.com. The following scripts are not all the scripts that are available, so you can always ask if there is something available for you, or if something can be created for you.

Contains category

The contains category condition only requires one product in the cart with the given category.

Volume

Compare the cart volume (width * height * length) against your given value. Note that the values are in the store dimensions unit you’ve setup (e.g. inches, centimeter, meters etc).