Online store

Liquid & theme code

Open Online Store → Themes → Edit code. A theme has three kinds of files:

PathPurpose
sections/*.liquidA section merchants can add in the theme editor. Settings come from its {% schema %} block.
snippets/*.liquidReusable partials: {% render 'name', var: value %}.
assets/custom.cssLoaded on every storefront page after theme styles.
assets/custom.jsRuns once per page load (good place for custom pixels).

Section schema

Liquid
<section class="sf-page">
  <h2>{{ section.settings.heading }}</h2>
  {%- for block in section.blocks -%}
    <p>{{ block.settings.text }}</p>
  {%- endfor -%}
</section>

{% schema %}
{
  "name": "Testimonials",
  "settings": [{ "type": "text", "id": "heading", "label": "Heading", "default": "What customers say" }],
  "blocks": [{ "type": "quote", "name": "Quote", "settings": [{ "type": "textarea", "id": "text", "label": "Quote" }] }],
  "max_blocks": 6
}
{% endschema %}

Setting types: text, textarea, richtext, url, image, color, checkbox, range (min/max/step), select (options), collection, product, menu, page, header.

Objects

ObjectFields
shopname, currency, url, email
sectionid, settings, blocks[] (id, type, settings)
settingsTheme settings (colors, fonts, social links…)
productOn product pages: title, handle, url, price, compare_at_price, vendor, type, tags, description, featured_image, images, variants[]
collectionOn collection pages: title, handle, url, description, image, products_count, products[]
collections['handle']Any collection by handle (or 'all'), with products[] (first 50)
all_products['handle']Any active product by handle
cartitem_count

Filters

All standard Liquid filters plus money (formats minor units, e.g. {{ product.price | money }} → ₹799), money_without_currency, handleize, json.

Rules

  • Liquid is sandboxed: no JavaScript execution, no access to object prototypes, render-time and memory limits. Errors show in the theme editor preview and render nothing on the live store.
  • Files are validated on save (Liquid syntax and schema JSON). Max 256 KB per file. Every save is versioned; restore from Versions.
  • Names: lowercase letters, numbers, - and _.