How do I test rules in the simulator?
The Simulator shows what checkout would do for a cart, an address and a customer, using the same rule engine as the functions that run at checkout. Nothing is sent to checkout and no order is created. It works even before the checkout functions are turned on.
Run a simulation
- Open Simulator.
- Build the cart: pick real products from your store, or enter items by hand (title, quantity, price, SKU, weight, product type, vendor, tags, collections).
- Enter the delivery address: country, region and postcode.
- Set the customer: logged in or not, customer tags, B2B company.
- Choose the checkout language.
- Enter the delivery options checkout would offer (name and type, such as “Standard” shipping and “Express” shipping).
- Run the simulation.
Read the result
- Rules: which rules matched, and for each rule which of its conditions matched and which did not.
- Delivery options: which options would be hidden, renamed (with the new name) or moved, and the final order.
- Checkout: whether checkout would be blocked, and the message the buyer would see in the chosen language.
Save scenarios and run them all after a rule change
Save the carts you care about once, then check them all in one click every time you change your rules.
- Set up a scenario as above. When the result shows what you want checkout to do, enter a name under Saved scenarios and click Save scenario. The fields must be valid to save.
- The scenario is saved with the result your rules give it now: which delivery options are hidden, the name each option is shown with, and whether checkout is blocked. If Include turned-off rules was ticked, the scenario keeps running with turned-off rules included.
- After you add or change a rule, open Simulator and click Run all. Each saved scenario shows Pass when it still gives its saved result, or Mismatch with what changed, for example
Express shipping: expected shown as “Express shipping”, now hidden. - If a mismatch is what you intended, save the scenario again under the same name and confirm Replace to keep the new result.
Good to know:
- You can save up to 20 scenarios. Delete one to save a new one.
- Saving under a name that already exists asks before it replaces the saved scenario. Names are compared without regard to upper or lower case.
- Use Rename and Delete on a scenario to keep the list tidy.
- Saved scenarios are stored in your store, so everyone on your team sees the same list. They are only used by the simulator and never change checkout.
- Run all compares hidden options, option names and whether checkout is blocked. It does not compare the order of the options or the wording of a block message.
Tips
- Test the edge of a range: if a rule uses
57030-57039, try 57029, 57030 and 57039. - Test a buyer language you did not write a message for, to see the fallback.
- Switched-off rules never run at checkout, but you can still test them in the simulator, for example a new preset rule before you switch it on.
- The delivery options you enter are only for the simulation. At checkout, the rules work on the options your shipping settings offer.