When adding your own scripts, you can access your shop’s data with simple Civil Pixels variables.
Civil Pixels variables are global variables that store information about your shop. They allow you to easily add information like cart items, order information and user data to your scripts in Civil Pixels.
Here’s how to use Civil Pixels variables:
- Begin by adding a new custom script or editing any existing one from your Civil Pixels dashboard.
- In the code editor box, click on the location where you’d like to insert a variable.
- Click on the Insert Variable dropdown to bring up a popup with all the variables you can use.
- Pick the variable you want and click the Add button.
- Tip: If something is greyed-out and unclickable, you’re missing the required trigger to use it. To change your triggers, exit the popup and scroll down to the trigger section. Select User & Page Actions and click on the required trigger to activate it.
That’s it! When your script is triggered, the selected variable will now automatically have the described value.