

How to add Advanced Shipping Rules For WooCommerce as a shipping method and configure conditions.
Stop losing money on shipping costs — take full control of your WooCommerce shipping fees.
Advanced Shipping Rules For WooCommerce lets you create smart, conditional shipping rules that automatically apply extra fees based on what’s actually in the cart: total weight, number of items, or subtotal. Define as many conditions as you need, combine them with AND/OR logic, and let the plugin handle the rest at checkout — no developer required.
Whether you run a small shop or a high-volume store, getting shipping costs right is critical for both profitability and customer satisfaction. This plugin gives you the precision tooling you need.
Who is this for?
How it works
The plugin adds a new shipping method — Advanced Shipping Rules — directly inside WooCommerce’s native shipping zones. You configure groups of conditions for each zone. When a customer’s cart matches a group, the defined extra fee is applied. Multiple groups use OR logic; conditions inside a group use AND logic. The highest matching fee wins, so you stay in control even when several rules could apply.
Key benefits
Available condition types
Condition
Operators
Cart total (subtotal)
equal to, less than, greater than
Total cart weight
equal to, less than, greater than
Number of products
equal to, less than, greater than
Extensible by developers
Three WordPress filters let you add custom condition types, evaluation handlers, and adjust the final shipping cost without modifying plugin files:
asrfwoo_condition_types — register new condition type definitions (description, operators, input type, step)asrfwoo_condition_handlers — register the evaluation logic for each condition typeasrfwoo_shipping_cost — filter the final computed cost before it is passed to WooCommerceExample: add a custom condition type based on the number of unique product categories in the cart.
add_filter( 'asrfwoo_condition_types', function( $types ) {
$types['category_count'] = array(
'description' => 'Number of Categories',
'operators' => array(
'greater_than' => 'Greater than',
'less_than' => 'Less than',
'equal' => 'Equal to',
),
'placeholder' => 'Enter category count',
'input_type' => 'number',
'step' => '1',
);
return $types;
} );
add_filter( 'asrfwoo_condition_handlers', function( $handlers ) {
$handlers['category_count'] = function( $operator, $value, $cost, &$group_cost, &$is_condition_met, $cart_weight, $cart_items, $cart_total ) {
$categories = array();
foreach ( WC()->cart->get_cart() as $item ) {
$terms = get_the_terms( $item['product_id'], 'product_cat' );
if ( $terms ) {
foreach ( $terms as $term ) {
$categories[ $term->term_id ] = true;
}
}
}
$count = count( $categories );
if ( ( $operator === 'greater_than' && $count > (int) $value ) ||
( $operator === 'less_than' && $count < (int) $value ) ||
( $operator === 'equal' && $count === (int) $value ) ) {
$group_cost += $cost;
$is_condition_met = true;
}
};
return $handlers;
} );
HPOS compatible: fully tested with WooCommerce High-Performance Order Storage.
Example setups
This plugin is released under the GPL-2.0+ license.