Publishing and unpublishing scripts
Use the Script Editor to publish and unpublish your scripts to your online store.
After you have created your scripts and tested them, then you can publish them to your online store. A script that is published will run in your online store when it is triggered. For example, a line items script will run whenever a change occurs to a cart.
You can publish one script per script type at a time. For example, you can publish a line items script and a shipping rates script, but you can't publish two line items scripts at the same time.
When you publish a script the following occurs:
- any error counts that are connected to the script are cleared and information about the errors disappears from the script.
- you are subscribed automatically to notification emails for that script. Whenever a production error occurs in that script, you will receive an email about the error.
Publishing a script does not apply its discounts to existing carts. Similarly, unpublishing a script does not remove discounts that the script has applied to existing carts.
You can also schedule line item and shipping scripts to run during events using the Launchpad app.
To publish a script:
In the Script Editor, click the name of the draft script that you want to publish.
Click Publish or Save and publish to save changes to the script and publish it:
Unpublish a script
Unpublishing a script does not remove discounts that the script has applied to existing carts.
To unpublish a script:
In the Script Editor, click the name of the published script that you want to unpublish.
Click Unpublish to make the script an unpublished draft.
After you have published your scripts, you can update your Liquid template files so that your storefront responds to the changes that your scripts make.