Skip to content
zippie

Guides · WooCommerce · 3 min read

WooCommerce custom checkout rules: settings, plugin or custom code?

Minimum orders, region limits, B2B rules: when WooCommerce settings or a plugin are enough, and when a checkout rule needs custom code.

Published

A card payment terminal printing a long receipt on an orange background
Photo by Towfiqu barbhuiya on Unsplash

Most stores reach a point where the checkout needs a rule WooCommerce doesn’t have out of the box. A minimum order value for one delivery zone. Products that can’t ship to certain regions. Wholesale customers who should see different prices or skip a payment step. A field that must be filled in for some products and hidden for others.

There are three ways to add a rule like this. Use the lightest one that does the job.

Start with the settings you already have

Before adding anything, check what WooCommerce and your existing extensions already do. Shipping zones, shipping classes, tax classes, coupon restrictions and payment gateway settings cover more rules than most store owners expect. A rule set in settings is the easiest to maintain, because there is no extra code to break.

When a plugin is enough

There are plugins for most common checkout needs: checkout field editors, minimum and maximum order rules, role-based pricing for wholesale, and conditional payment or shipping methods.

  • Good for: rules that match what the plugin was built for, with only small differences.
  • Watch for: how recently it was updated, whether it supports the checkout your store actually uses (see below), and how many plugins already touch your checkout. Several plugins changing the same checkout often conflict.
  • Cost: usually a yearly licence.

If you need two or three plugins plus a few workarounds to get one rule, that is a sign the rule belongs in custom code.

When it needs custom code

Custom code is right when the rule is specific to your business, combines several conditions, or has to stay reliable as the store changes. It should live in a small custom plugin, not pasted into the theme’s functions.php, so it survives theme updates and can be switched off cleanly.

  • Good for: rules like “wholesale customers in these regions need a minimum of this amount, unless the order contains these products.”
  • Watch for: who maintains it, and whether it is documented and tested.
  • Cost: a one-off build, plus small updates when WooCommerce changes.

Check which checkout your store uses

Recent versions of WooCommerce use the block-based Checkout by default on new stores. Older stores often still use the shortcode checkout. The two are built differently: the block checkout works through WooCommerce’s Store API, and code written for the shortcode checkout may not run on it at all.

This matters for both plugins and custom code. A rule that worked on the old checkout can stop working silently after a store switches to the new one. Before you buy a plugin or commission code, check which checkout your store uses, and ask for the rule to be tested on that one.

Test it properly

Use a staging copy

Checkout changes should never be built or tested on the live store first. Test on a staging copy with the same plugins, theme and settings.

Write the cases down

List each case the rule must handle, for example: “wholesale, region A, under minimum: blocked with this message”, “retail, region A: allowed”. Test every line, and keep the list for the next WooCommerce update.

Check orders, not just the page

A rule can show the right message on the checkout page but still let an order through another way, such as a saved payment method or an express checkout button. Place real test orders and check what reaches the admin.

When it’s worth paying for a build

If settings cover the rule, use settings. If one well-maintained plugin does exactly what you need, use the plugin. Pay for custom code when the rule is specific to your business, when plugins conflict, or when a broken checkout would cost you real orders.

← All guides

Start here

Bring one problem. Leave with a fixed price.

A Build Plan takes five working days and costs $1,500. You get a prototype, a fixed quote and a written definition of done. The fee counts toward the build.