RIACO Advanced Shipping Rules For WooCommerce

Advanced Shipping Rules For WooCommerce

Advanced Shipping Rules For WooCommerce it is a plugin that lets you create smart, conditional shipping rules that automatically apply shipping fees based on what’s actually in the cart: total weight, number of items, or subtotal. 

This is a simple video demo:

With this free shipping plugin for WooCommerce you can 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.

How it works

The plugin adds a new shipping method — Advanced Shipping Rules — directly inside WooCommerce’s native shipping zones. 

Admins simply add this new shipping method to one of existing shipping zone.

Then it is possible to set shipping conditions using AND/OR logic:

Multiple groups use OR logic, so any group can match (OR).

Conditions inside a group use AND logic, so ALL conditions must be true (AND).

If multiple groups match the highest shipping price is applied.

And that’s it.

On frontend users simply see the name of shipping method applied to cart based on the matched rules:

Available condition types

all conditions type in woocommerce shipping advanced

In the free version of the plugin there are 3 available condition type:

  • Cart total (subtotal): the value of all products in the cart before shipping is added.
  • Total cart weight: the combined weight of all products in the cart.
  • Number of products: the total quantity of items in the cart, regardless of product type.

Who is this for?

This plugin is ideal for:

  • Store owners shipping heavy or bulky goods who need to recover real carrier surcharges for overweight shipments.
  • Shops with variable order sizes that want to add a handling fee when orders fall below a minimum quantity or total.
  • Multi-zone stores that need location-specific fee logic on top of WooCommerce’s native shipping zones.

How to Use (quickly)

  1. Open the method settings after adding it to a shipping zone.
  2. Click Add Group to create a rule group.
  3. Inside the group, click Add Condition and choose a condition type (weight, item count, or cart total), an operator, a threshold value, and an extra fee amount.
  4. Add more conditions to the same group (all must match — AND logic) or add a second group (either group can match — OR logic).
  5. Click Save changes. The fees will be applied automatically at checkout when the cart meets the defined conditions.

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 type
  • asrfwoo_shipping_cost — filter the final computed cost before it is passed to WooCommerce

Example: 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

  • Charge €5 extra when total cart weight exceeds 20 kg.
  • Charge €3 extra when the order contains fewer than 3 items.
  • Charge €10 extra when cart total is below €50 AND weight exceeds 10 kg.