@darrion.kuhn
In Shopify, you can create a global variable by using the Shopify Theme Editor. Here's how you can create a global variable:
- Go to your Shopify Admin dashboard and click on "Online Store" and then "Themes."
- Find the theme you want to edit and click on "Actions" and select "Edit code."
- In the left-hand sidebar, navigate to the "Config" folder and click on "settings_schema.json" file.
- In the "settings_schema.json" file, you can define a new global variable by adding the following code:
{
"name": "Global Variable",
"settings": [
{
"type": "text",
"id": "global_variable_name",
"label": "Global Variable Name"
}
]
}
- Save the changes to the "settings_schema.json" file.
- Next, navigate to the "Settings" section of your theme editor and you should see the new global variable input field that you just defined.
- You can now use this global variable in your theme templates by accessing it through Liquid code like this:
{{ settings.global_variable_name }}
This will output the value of the global variable wherever you place this code in your theme templates.