Understand rule priority and action order
Shopify shipping rule priority in ShipWith controls the order of active rules within one Function input. That order matters when more than one rule or action changes the same delivery method.
ShipWith changes delivery options that Shopify already supplies. It does not create shipping rates, change their prices, or offer shipping discounts.
How rules are ordered
For active rules that use the same Function input:
- The rule with the lower Priority number runs first. Priority
0runs before priority1. - If two rules have the same Priority, the rule created earlier runs first. ShipWith uses the rule's creation time automatically; editing a rule does not make it newer.
Use different priority numbers when the order is important. This makes the intended order clear without relying on the creation-time tie-break.
ShipWith syncs each Function input type to a separate Shopify Delivery Customization Function. Shopify does not guarantee the order in which different Function inputs run. For example, a priority 0 Standard input rule is not guaranteed to run before a priority 1 Address input rule. Put rules that must run in a specific sequence in the same Function input.
Shopify also evaluates each delivery group independently. The available methods, matches, and result can differ between groups in the same checkout.
How actions are ordered
Within a rule, actions run from top to bottom: Action #1, then Action #2, and so on. When several rules use the same Function input, ShipWith finishes the earlier rule's actions before starting the next rule.
The first applicable action can limit what later actions can do:
- A hide action removes a method from the visible list. Hiding also clears any pending rename or move for that method.
- The first successful Rename delivery method(s) action for a method wins. Later rename actions do not replace that title.
- The first move, reorder, or cost-sort action that affects a method locks its position. Later Move delivery method to the top, Move delivery method to the bottom, Reorder a specific delivery method, or cost-sort actions do not move that method again.
- Show only the cheapest rate, Show only the highest rate, Sort delivery methods by cost high-low, and Sort delivery methods by cost low-high use only the eligible methods that are still visible when the action runs. Cost sorting also skips methods whose positions are already locked.
Conditions can narrow which delivery methods are eligible. Hidden or ineligible methods do not participate in a later cost comparison.
What Ignore previous rules does
When an applicable Ignore previous rules action runs, ShipWith resets the accumulated effects for that delivery group. It:
- Restores methods hidden by earlier actions.
- Clears earlier renames.
- Unlocks methods moved, reordered, or cost-sorted earlier.
- Restores Shopify's original method order.
This reset includes effects from lower-priority rules and from actions above Ignore previous rules in the same rule. Actions below the reset and later rules then apply to the restored methods.
The reset does not create a method that Shopify did not provide for that checkout. The rule containing Ignore previous rules must also apply to the checkout and have an eligible delivery method before its actions run.
Example sequence
Assume Shopify supplies these methods in this order:
Standard— $5Express— $15Local pickup— $0
All three rules use Standard input and match the checkout:
- Priority
0, created first:- Action #1: Rename delivery method(s) changes
ExpresstoFast delivery. - Action #2: Move delivery method to the top moves
Expressfirst and locks its position.
- Action #1: Rename delivery method(s) changes
- Priority
0, created later:- Action #1: Rename delivery method(s) tries to change
ExpresstoNext-day delivery. - Action #2: Sort delivery methods by cost low-high sorts the other eligible visible methods, but does not move the already locked
Expressmethod.
- Action #1: Rename delivery method(s) tries to change
- Priority
1:- Action #1: Ignore previous rules clears both priority
0rules' effects and restores the original titles and order. - Action #2: Hide specific delivery method(s) hides
Local pickup. - Action #3: Show only the cheapest rate compares the currently visible eligible methods,
StandardandExpress, and keepsStandard.
- Action #1: Ignore previous rules clears both priority
The expected final result is one visible method: Standard at $5. The earlier Fast delivery rename and move are gone because Ignore previous rules reset them. The attempted Next-day delivery rename never replaced the first rename, and both renames were later cleared.
Set up rules in a predictable order
- Put dependent rules in the same Function input.
- Give each rule a distinct Priority, with lower numbers on rules that should run first.
- Under Actions, list each action in the order it should run. Use Add new action to add the next step.
- Set Status to Live, select Save, and wait for Shopify sync to show Synced.
- Review earlier rules and actions whenever a method is hidden, keeps an earlier title, or does not move as expected.
Test the result at checkout
- Create a checkout that matches the rules and note the delivery methods, titles, prices, and original order supplied by Shopify.
- Continue to the step that shows delivery methods and check every delivery group.
- Compare the result with the rules in ascending Priority order and each rule's actions from top to bottom.
- Repeat with a checkout that does not match. Confirm that the rules do not change its methods.
- Test important edge cases separately: equal priorities, a method targeted by two renames, a method targeted by two ordering actions, methods hidden before a cost action, and a matching Ignore previous rules exception.
If the result is unexpected, first confirm that every rule is Live and Synced. Then check that dependent rules use the same Function input, their conditions and delivery method targets match, and no earlier hide, rename, move, reorder, cost sort, or Ignore previous rules action changes the same method.
