#
Installing Scripts
Once you have completed your work to configure your rule(s), you must copy and paste the script(s) which Playwright generates for you into the Shopify Script Editor.
#
Install Shopify Script Editor
Please be sure you have already installed Shopify Script Editor into your store environment. You can install it by visiting: https://apps.shopify.com/script-editor and installing the app.
#
Types of Scripts
There are three types of scripts you can add to your Shopify Store checkout experience.
- Line Items: also known as Line Item Rules in Playwright
- Shipping Rates: also known as Shipping Rules in Playwright
- Payment Gateways: also known as Payment Rules in Playwright
When copying over a Playwright-generated script, you must ensure you select the corresponding script-type in the Shopify Script Editor. For example: copying a Shipping Rule generated by Playwright into a Line Item blank template in Shopify Script Editor will fail.
#
Copying your Playwright Rule to Shopify Script Editor
Once you have completed setting up your rules within one or more of the rule types, you can generate the script to be copied and pasted into Shopify Script Editor. The process is the same for each rule type. Once you are happy with your rule, proceed with the following steps:
- Generate the script from Playwright (the big green button)
- Copy the resulting code to your clipboard
- Open Shopify Script Editor, and create a new Line Items (or your respective rule type) script from a Blank Template. Give the script a title, and then paste the Playwright code directly into the Code section by replacing everything that was in that field by default.
- Test your rules configuration
It's always important to test and verify your rules using the built in Script testing. Add items to your input (to simulate a customer's cart and the criteria you are configuring for), and ensure the output is consistent with your desired behavior.
🎉🎉🎉 CONGRATULATIONS!!! 🎉🎉🎉 You're well on your way to improving your sales while making customers even more satisfied!