Skip to content

Write your first custom rule

Quick controls are switches; custom rules are sentences. This guide writes a real one — “discount codes only work on orders of $50 or more, unless the customer is a VIP” — and teaches every part of the rule builder on the way.

  1. Open Controller, scroll to Custom rules, and hit Add Rule.

  2. Name it something future-you understands: Min $50 for codes.

  3. Leave Action on Block, and write an honest Error Message: Discount codes apply on orders of $50 or more.

  4. Leave Trigger on as All codes — this rule should watch every code. (The Except field could exempt specific codes; we don’t need it.)

  5. Hit Condition and choose Cart subtotal. Set the operator to Less than and the value to 50.

    The rule now reads: for any code, if cart subtotal is less than 50 → block with your message.

  6. Create Rule, then Save on the page’s save bar. Live immediately.

Exceptions are Allow rules placed below the rule they punch through — rules run top to bottom and the later rule wins.

  1. First, register the tag: in Rule variables, open Customer tags, add VIP, and save the modal. (Rules pick values from these variables — that’s why the condition menu can’t free-type tags.)

  2. Add Rule again. Name: VIP exception. Set Action to Allow — notice the error message field disables; allow rules don’t need one.

  3. Keep Trigger on = All codes.

  4. Add condition Customer tag → operator Has any of → select VIP.

  5. Create Rule. Confirm it sits below Min $50 for codes in the list, then Save.

Now a $30 cart from a regular customer rejects codes with your message, and the same cart from a customer tagged VIP takes them.

An Allow rule only overrides other rules — never the quick controls. If Discount Lock is blocking a code, no custom rule can let it through; use that control’s own Allowed codes list instead. Full ordering details in which rule wins.

Test three carts at checkout: under $50 as a guest (blocked), over $50 as a guest (works), under $50 signed in as a VIP-tagged customer (works). Toggle the rule’s switch off in the list to pause it without deleting it.