HDWebmobile Conditional Shipping Rules

Description

WooCommerce shipping zones decide which methods exist for an address. HDWebmobile Conditional Shipping Rules decides which of those methods a customer actually sees, and what they cost, based on what is in the cart and who is buying.

A rule has conditions and an action. When every condition you set matches the cart, the action runs. Some examples:

  • Hide free shipping when the cart weighs more than 20 kg
  • Show only local pickup when the cart contains furniture
  • Add 15% to express shipping for international orders
  • Charge wholesale customers a fixed 5.00 for standard shipping
  • Hide same-day delivery on Sundays
  • Never charge more than 25.00 for standard shipping
  • Remove free shipping when a discount coupon is used

Conditions

  • Cart subtotal (minimum and/or maximum, after coupons)
  • Total cart weight
  • Number of items
  • Product categories in the cart (contains any of / contains none of)
  • Shipping classes in the cart (contains any of / contains none of)
  • Coupons used in the cart (any of / none of)
  • Customer role, including guests
  • Shipping country
  • Day of the week (your site’s time zone)

Actions

  • Hide the chosen shipping methods
  • Show only the chosen shipping methods
  • Add a fixed amount to their cost
  • Add a percentage to their cost
  • Set their cost to a fixed amount
  • Keep their cost between a minimum and maximum (free methods stay free)

You can target a single method in a single zone (for example “Europe — Flat rate”) or every method of a type (“Any Free shipping method”). Rules run from top to bottom, and you can reorder, disable or edit them at any time. Shipping tax is recalculated when a cost changes.

Works with the block-based Cart and Checkout and with the classic shortcode checkout.

Security by design

  • Only users who can manage WooCommerce can change rules, and every change is protected by a nonce.
  • Every value is validated on save: numbers are range-checked, and every category, shipping class, role, country and shipping method must exist on your site. Actions come from a fixed list; nothing you type is ever run as code.
  • Rules are checked on the server against the cart WooCommerce built. Nothing the browser sends can change which rules apply.

Limitations (please read before installing)

  • Rules adjust existing shipping methods; they do not create new ones. Set up your zones and methods under WooCommerce > Settings > Shipping first.
  • If your rules hide every method for a cart, the customer sees WooCommerce’s normal “no shipping options” message.
  • Up to 100 rules.

How to Use

1. Add a rule

Click Add rule, give it a name, and fill in only the conditions you need. Empty conditions are ignored.

2. Choose the action

Pick what should happen and tick the shipping methods it applies to. For cost actions, enter the amount (or the percentage).

3. Order your rules

Rules run top to bottom. Use the arrows to reorder them, and the Enabled/Disabled button to switch one off without deleting it.

Screenshots

Installation

  1. Upload the plugin files to the /wp-content/plugins/hdwebmobile-conditional-shipping-rules directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress. WooCommerce must already be installed and active.
  3. Go to WooCommerce > HDWebmobile > Shipping Rules to add your first rule.

FAQ

Do customers see the change straight away?

Yes. Shipping is recalculated whenever the cart, the customer or your rules change.

Can I combine rules?

Yes. Each matching rule works on the result of the rules above it, so for example one rule can add a surcharge and a later rule can cap the final cost.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“HDWebmobile Conditional Shipping Rules” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.0.0

  • Initial release: conditional rules to hide, limit or re-price shipping methods by subtotal, weight, items, categories, shipping classes, coupons, role, country and weekday.