Skip to content
Docs menu

Publishing rules to checkout

Saved rules don’t change checkout until you publish them. When you publish, Playwright Checkout Rules checks each rule against what Shopify Functions can do and publishes the ones that can run.

What Publish does

Each area has its own Publish button: Publish Line Item Rules, Publish Shipping Rules or Publish Payment Rules. When you select it, Playwright:

  1. saves the rules on screen;
  2. checks every active rule (inactive rules are left out);
  3. publishes the rules that pass to the area’s Shopify discounts and customizations, creating, updating or removing them as needed;
  4. for line item rules that check for discount codes, creates those codes in Shopify (see Discount code rules);
  5. shows what was published, what was left out and why.

Publishing replaces what’s live for that area with every active rule that passes the checks. Rules that don’t pass are left out, and the others are still published.

The pre-publish checks

While you edit, Playwright lists what it found under “How your rules run on Shopify Functions”, and the publish result repeats it. There are two kinds of note:

Blocking
The rule “won’t be published”: it uses something Shopify Functions can’t check or do. Change the setting the message names and publish again.
Warning
The rule is published, but it behaves a little differently from Shopify Scripts, or there’s something you should know. Nothing to fix unless the difference matters to you.

Blocking messages

Every message that keeps a rule from being published:

  • Customer tags can only be matched exactly on Shopify Functions. Change “Contain one of” to “Match one of” and list the full tags.
  • Shopify Functions can’t see whether a customer accepts marketing. Tag those customers and use a customer tag condition instead.
  • Product tags can only be matched exactly on Shopify Functions. Change “Contain one of” to “Match one of” and list the full tags.
  • Line item properties aren’t available to Shopify Functions.
  • Cart weight isn’t available to Shopify Functions.
  • Street addresses aren’t available to discount rules. Use this condition in shipping or payment rules.
  • Shopify Functions can’t compare billing and shipping addresses here.
  • Shopify Functions only see the discount code itself, not its type or value.
  • Only discount rules and shipping discounts can see which discount code was entered.
  • Vendor conditions aren’t available to shipping price rules on Shopify Functions.
  • SKU conditions aren’t available to shipping rules on Shopify Functions. Select items by product or variant instead.
  • Gift card conditions aren’t available to shipping rules on Shopify Functions.
  • Sale-price conditions aren’t available to shipping rules on Shopify Functions.
  • Shipping and payment rules can’t see the discounts your line item rules gave.
  • Subscription conditions aren’t available to shipping rules on Shopify Functions.
  • Language conditions aren’t available to shipping price rules on Shopify Functions.
  • The shipping rate source (Shopify or carrier) isn’t available to Shopify Functions. Select rates by name or code instead.
  • Sale-price conditions aren’t available to payment rules on Shopify Functions.
  • Shopify Functions can’t see the billing address when choosing payment methods, so this rule can’t run.

Warnings

Every message about a rule that is published but runs differently. Messages about codes show example codes; yours show your own.

  • Only the first entered discount code is checked.
  • Codes are only rejected when Shopify allows it (codes from automatic-discount conflicts are kept).
  • Shopify Functions can’t change quantities. Customers over the limit see a message and can’t check out until they reduce the quantity.
  • An order can only get one shipping discount, so this doesn’t combine with other shipping discounts.
  • Functions can’t add the gift: it is only discounted when the buyer has added it.
  • The cap shows as a shipping discount, and an order can only get one shipping discount.
  • Shopify always shows the carrier name before a renamed shipping rate.
  • Shopify doesn’t allow renaming Shop Pay, Apple Pay, Google Pay or other wallets.
  • Shopify doesn’t allow moving wallets such as Shop Pay, Apple Pay and Google Pay.
  • Playwright creates “SUMMER10” as a discount code in Shopify when you publish, so you don’t need to create it.
  • Shopify only accepts codes that exist, and Playwright can’t create every code that matches “VIP-CLUB-****”. List the exact codes instead (Playwright creates them for you), or create each code as a discount in Shopify.
  • Shipping rules only see codes that exist in Shopify. Create “SUMMER10” as a discount in Shopify, or use the exact codes in a discount rule too (Playwright creates the codes discount rules check for).
  • Functions see only the discount code text, not its type, value or minimum.
  • The buy and get items are the same, so “Buy 1, Get 1” makes every unit free. For buy 1 get 1 free on the same product, set Buy 2 and Get 1.

Problems that stop a publish

These stop the area from publishing, or leave a rule out, until you fix them:

Too many tags
Your rules use 101 product tags; Shopify Functions can check at most 100. The same limit applies to customer tags. Tag conditions count a tag twice when it has capital letters, once as typed and once in lower case.
Too large
“These rules are too large to publish together (…). Remove or combine some rules and publish again.” See Size limit.
Permissions
“Playwright needs permission to manage discounts and checkout customizations. Open Playwright from your Shopify admin to approve the new permissions.”
A rule that can’t be read
“This rule’s settings couldn’t be read. Open the rule, check its settings and save it again.”

Live or out of date

Above your rules, a banner compares what you’ve saved with what’s live in Shopify checkout:

Your discount rules are live in Shopify checkout
Checkout runs exactly your saved rules. (Shipping and payment say “shipping rules” and “payment rules”.)
You have changes that aren’t live yet
You’ve saved changes since you last published, or a publish didn’t finish. Select Publish.
Publish your discount rules to run them in Shopify checkout
Nothing from this area has been published yet.
Your discount rules are missing from Shopify checkout
A discount or customization Playwright published was deleted in Shopify, so checkout doesn’t run those rules. Select Publish and Playwright creates it again.
Publish to remove your discount rules from Shopify checkout
You deleted every rule in the area, but the rules you published last are still in Shopify. Select Publish to remove them.

The banner also shows when you last published.

Size limit

Shopify passes each Function at most 10,000 bytes (about 10 kB) of settings, so the active rules of one area must fit in that space together. Long lists take the most room: product and variant IDs, tags, codes, postal codes and addresses.

If an area is too large, Playwright doesn’t publish it and says how large it is. Remove rules you no longer need, make old ones inactive, or combine rules, for example one rule with a Multi-Select instead of three similar rules.

Rule order

Rules in an area run one after another, from the top of the list. Each rule sees the cart as earlier rules left it: a later rule’s “current subtotal” is after earlier discounts, Discounted Item Selector finds items an earlier rule discounted, and bundle items an earlier rule discounted don’t count toward a bundle.

Rules run in the order the list shows. To change it, drag a rule up or down: Playwright saves the new order, and checkout uses it once you publish.

Shipping rules are published to two Functions (one for prices, one for hiding, renaming and reordering), and both run every shipping rule in order. So a shipping discount after a rename sees the new name.

Taking rules out of checkout

Make a rule Inactive (or delete it) and publish again. When an area no longer has rules of a kind, Playwright removes its discount or customization from Shopify.

To take a whole area out of checkout, delete its rules (or make them all inactive) and publish. Playwright removes the area’s discounts and customizations from Shopify and shows “Your discount rules are removed from checkout”.