Troubleshooting
What to check when a Playwright Checkout Rules rule doesn’t do what you expect at checkout.
A code shows “Enter a valid discount code”
Shopify shows this for a code that doesn’t exist as a discount in Shopify, before Playwright’s rules run. Check:
- You’ve published Line Item Rules since adding the code to a rule.
- The code is an exact code (a code list row, a pattern without a *, or Cart Has Discount Code with Match one of). Wildcards and patterns aren’t created: create the code in Shopify or list it exactly.
- In your Shopify admin under Discounts, “Playwright: discount codes” is active and has the code. Shopify adds codes in the background, so a new code can take a little while.
- The code is for a shipping rule only: Playwright doesn’t create those. Create it in Shopify.
A discount doesn’t show at checkout
- The area’s banner says “Your discount rules are live in Shopify checkout”. If it says “You have changes that aren’t live yet”, publish.
- The rule is Active, and wasn’t left out: look for “won’t be published” in its notes.
- The customer matches: customer conditions need a signed-in customer; destination conditions need the shipping address entered at checkout.
- Tags match whole tags, exactly.
- An earlier rule hasn’t changed what this rule sees, for example the subtotal or an item already discounted.
- Another product discount isn’t winning over Playwright’s: they don’t combine. See How codes combine.
- For free gifts, the gift is in the cart. For buy X get Y, the cart has enough items. See below.
- The Playwright discount is turned on in your Shopify admin under Discounts. If you turned “Playwright: discount rules” off there, turn it back on.
The shopper needs 2 in the cart
That’s how “buy one, get one free” works on the same product: with Buy number 2 and Get number 1, the customer adds 2 and pays for 1. With one in the cart there’s no set yet, and Shopify Functions can’t add the second item.
Changing to Buy 1 Get 1 makes every unit free instead. See Buy one, get one on the same product.
Customers see “You can buy at most…”
That’s a quantity limit: “You can buy at most 2 of Classic Hat”, or “You can’t buy Classic Hat” when the limit is 0. Shopify Functions can’t lower the quantity, so checkout waits until the customer does.
A renamed shipping rate shows the carrier’s name
Shopify always shows the carrier’s name before a renamed rate. Choose a new name that reads well after it.
Shop Pay or Apple Pay didn’t change
Shopify doesn’t let apps rename or move wallets, and options shown with a logo keep their names. They can be hidden.
A rule “won’t be published”
The message says what Shopify Functions can’t do with the rule as set up. Change that setting, save and publish. Every message, with what it means, is in The pre-publish checks.
Publishing failed
- Permissions
- “Playwright needs permission to manage discounts and checkout customizations. Open Playwright from your Shopify admin to approve the new permissions.” Open Playwright from your Shopify admin and approve.
- Too large
- The area’s rules are over the size limit. Remove or combine rules. See Size limit.
- Too many tags
- The area checks more than 100 product or customer tags. See Tags.
- “Shopify couldn’t find Playwright’s functions”
- This is a problem on our side. Email support@playwrightapp.com.
If the message is anything else, try again in a moment, then email us with the message.
Sharing Function run logs
Shopify keeps a record of each time a Function runs, with what it received and what it did. You can’t read these records in your Shopify admin, but you can share them with Playwright so we can see exactly what happened at checkout:
- In your Shopify admin, go to Settings, then Apps and sales channels, and open Playwright.
- In Share function logs, select Share logs. This shares the last 24 hours of runs.
- Email support@playwrightapp.com with your store address and the time of the test order.
When a discount Function fails, Shopify also shows a warning on the Discounts page, with a link to share its runs.
Still stuck?
Email support@playwrightapp.com with your store’s myshopify.com address, the rule’s name, what you expected and what happened. Screenshots of the rule’s settings help.