@zohofinance/commerce 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/package.json +2 -2
- package/ts-dist/mocks/init-theme/.claude/CLAUDE.md +6 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/SKILL.md +242 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/figma.md +81 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/screenshot.md +54 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/inputs/url.md +88 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/spec-table.md +102 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/accessibility.md +110 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/performance.md +127 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/tokens.md +87 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-section-from-design.20260528/verification/visual-diff.md +123 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/SKILL.md +605 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/design-tokens.md +105 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/page-json-contract.md +58 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/qa-accessibility.md +35 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/reference-lookup.md +94 -0
- package/ts-dist/mocks/init-theme/.claude/skills/.archive/zcommerce-theme-builder.20260528/section-anatomy.md +109 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/SKILL.md +313 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/agent-hierarchy.md +142 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/ask-developer.md +113 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/bootstrap.md +260 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/build-metrics.md +89 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/code-quality.md +186 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/common-pages-agent.md +97 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/dev-server-and-urls.md +127 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/exemplars.md +79 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/figma-discovery.md +138 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/figma-extraction.md +132 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/image-sources.md +84 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/inputs/guidelines-frame.md +178 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/page-builder.md +322 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/page-orchestrator.md +199 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/parallel-fanout.md +152 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/a11y.mjs +129 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/lint-section.mjs +502 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/perf.mjs +134 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/pixel-diff.mjs +206 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/scripts/record-build-metrics.mjs +118 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/section-builder.md +131 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/subagent-escalation.md +75 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/transcription-rules.md +98 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/verification.md +227 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/visual-verify-loop.md +117 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/_index.md +4 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/assets.md +105 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/best-practices.md +212 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/custom-scripts.md +294 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/i18n.md +155 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/introduction.md +91 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/layouts.md +158 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/pages.md +156 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/_index.md +4 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/filters.md +419 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/global-objects.md +415 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/schema-types.md +926 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/reference/tags.md +259 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/sections.md +203 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/setup-guide.md +424 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/snippets.md +70 -0
- package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/theme-structure.md +252 -0
- package/ts-dist/mocks/init-theme/.cursor/PLAYBOOK.md +144 -0
- package/ts-dist/mocks/init-theme/.cursor/README.md +6 -0
- package/ts-dist/mocks/init-theme/.cursor/agents/figma-desktop-mobile-parallel.md +48 -0
- package/ts-dist/mocks/init-theme/.cursor/agents/visual-compare.md +221 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/add-field.md +83 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/add-theme-setting.md +200 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/assemble-page.md +72 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/audit-page.md +57 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/build-page-sections.md +110 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/build-section.md +418 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/build-theme.md +307 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/compare-section.md +358 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/create-theme.md +77 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/extract-tokens.md +43 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/fix-section.md +92 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/impact.md +50 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-a11y.md +66 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-i18n.md +110 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-layout.md +127 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-performance.md +72 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-section.md +84 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-sections.md +48 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/qa-theme.md +85 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/redesign-section.md +177 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/refactor-section.md +185 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/sync-theme-settings.md +132 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/validate-page.md +60 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/validate-section-group.md +88 -0
- package/ts-dist/mocks/init-theme/.cursor/commands/validate-theme-settings.md +119 -0
- package/ts-dist/mocks/init-theme/.cursor/examples/design-instructions-template.md +151 -0
- package/ts-dist/mocks/init-theme/.cursor/mcp.json +18 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/README.md +160 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/accessibility.mdc +24 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/add-field.mdc +222 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/add-theme-setting.mdc +39 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/assemble-page.mdc +130 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/audit-page.mdc +92 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/build-section.mdc +178 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/build-theme.mdc +47 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/compare-section.mdc +94 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/create-theme.mdc +78 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/css.mdc +137 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/design-spec-extraction.mdc +255 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/extract-tokens.mdc +43 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/figma-mcp-resolution.mdc +40 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/fix-section.mdc +154 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/general.mdc +30 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/i18n.mdc +85 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/javascript.mdc +85 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/liquid-no-hardcoded-strings.mdc +42 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/liquid.mdc +171 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/mobile-desktop-setting-meta.mdc +34 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/naming-convention.mdc +64 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/pages.mdc +120 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/performance.mdc +51 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/qa-section.mdc +134 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/redesign-section.mdc +147 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/schema-sync.mdc +110 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/schema.mdc +360 -0
- package/ts-dist/mocks/init-theme/.cursor/rules/share-urls.mdc +68 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/browser-verify.md +128 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/design-tokens.md +105 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/page-json-contract.md +87 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/qa-accessibility.md +35 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/reference-lookup.md +88 -0
- package/ts-dist/mocks/init-theme/.cursor/skills/section-anatomy.md +173 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Global Objects"
|
|
3
|
+
weight: 14
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Global Objects
|
|
7
|
+
|
|
8
|
+
Global objects are variables available in every template without needing to be passed or assigned. They provide access to store data, request context, and platform information.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Store Objects
|
|
13
|
+
|
|
14
|
+
### store
|
|
15
|
+
|
|
16
|
+
The current store. Available on every page.
|
|
17
|
+
|
|
18
|
+
| Property | Type | Description |
|
|
19
|
+
|----------|------|-------------|
|
|
20
|
+
| `store.name` | string | Store display name |
|
|
21
|
+
| `store.tag_line` | string | Store tagline |
|
|
22
|
+
| `store.email` | string | Contact email |
|
|
23
|
+
| `store.phone` | string | Contact phone number |
|
|
24
|
+
| `store.logo` | object | Store logo; use `store.logo.url` |
|
|
25
|
+
| `store.favicon` | object | Store favicon; use `store.favicon.url` |
|
|
26
|
+
| `store.social_profiles` | array | Social links: `{ name, link }` |
|
|
27
|
+
| `store.social_preview` | object | Open Graph preview; use `store.social_preview.url` |
|
|
28
|
+
| `store.customer_portal.enabled` | boolean | Whether customer accounts are enabled |
|
|
29
|
+
| `store.customer_portal.signin_url` | string | URL to the sign-in page |
|
|
30
|
+
| `store.breadcrumb.enabled` | boolean | Whether breadcrumb navigation is enabled |
|
|
31
|
+
| `store.breadcrumb.level` | number | Breadcrumb depth |
|
|
32
|
+
| `store.preferences` | object | Feature flags (e.g. `is_menu_enabled`, `is_footer_enabled`, `search_box_enabled`, wishlist, save-for-later, customer sign-up) |
|
|
33
|
+
|
|
34
|
+
Individual preference keys follow the platform configuration in your store.
|
|
35
|
+
|
|
36
|
+
**Removed (not exposed in Liquid):** `organizationID`, `current_user`. To read the signed-in customer in client-side code, use `GET /portal/user` instead of a Liquid global.
|
|
37
|
+
|
|
38
|
+
```liquid
|
|
39
|
+
<title>{{ page_title }} | {{ store.name }}</title>
|
|
40
|
+
<img src="{{ store.logo.url }}" alt="{{ store.name }}">
|
|
41
|
+
|
|
42
|
+
{% if analytics.webmaster_meta_tag != '' %}
|
|
43
|
+
<meta name="google-site-verification" content="{{ analytics.webmaster_meta_tag }}">
|
|
44
|
+
{% endif %}
|
|
45
|
+
|
|
46
|
+
<link rel="shortcut icon" href="{{ store.favicon.url }}">
|
|
47
|
+
|
|
48
|
+
{% if store.customer_portal.enabled %}
|
|
49
|
+
<a href="{{ store.customer_portal.signin_url }}">Sign In</a>
|
|
50
|
+
{% endif %}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
### analytics
|
|
56
|
+
|
|
57
|
+
Site verification and analytics identifiers (split out from the old `organization` object).
|
|
58
|
+
|
|
59
|
+
| Property | Type | Description |
|
|
60
|
+
|----------|------|-------------|
|
|
61
|
+
| `analytics.webmaster_meta_tag` | string | Google site verification meta content |
|
|
62
|
+
| `analytics.google_analytics_container_id` | string | Google Analytics / GTM container ID |
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### seo
|
|
67
|
+
|
|
68
|
+
SEO copy for the current page, provided as a top-level global on the storefront response. Use `seo.description` and `seo.keywords` in `<head>` when your theme should emit description and keywords meta tags. For checking non-empty values, filters like `escape`, and general layout usage, follow the same patterns as **`store`** and **`analytics`** above.
|
|
69
|
+
|
|
70
|
+
| Property | Type | Description |
|
|
71
|
+
|----------|------|-------------|
|
|
72
|
+
| `seo.description` | string | Meta description for the page (may be empty) |
|
|
73
|
+
| `seo.keywords` | string | Meta keywords for the page (may be empty) |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### currency
|
|
78
|
+
|
|
79
|
+
Global currency information. Use this instead of any former `cart.currency` field.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### product
|
|
84
|
+
|
|
85
|
+
The current product (available on product pages).
|
|
86
|
+
|
|
87
|
+
| Property | Type | Description |
|
|
88
|
+
|----------|------|-------------|
|
|
89
|
+
| `product.id` | string | Product ID |
|
|
90
|
+
| `product.title` | string | Product name |
|
|
91
|
+
| `product.description` | string | HTML description |
|
|
92
|
+
| `product.short_description` | string | Short plain-text or HTML summary |
|
|
93
|
+
| `product.price` | number | Current price (in cents) |
|
|
94
|
+
| `product.on_sale` | boolean | Whether the product is on sale |
|
|
95
|
+
| `product.price_min_formatted` / `price_max_formatted` | string | Formatted price range |
|
|
96
|
+
| `product.available` | boolean | Whether the product is purchasable |
|
|
97
|
+
| `product.url` | string | Relative URL |
|
|
98
|
+
| `product.cover_media` | object | Primary image / media |
|
|
99
|
+
| `product.images` | array | All product images |
|
|
100
|
+
| `product.variants` | array | Product variants |
|
|
101
|
+
| `product.attribute_names` | array | Attribute names (e.g. Size, Color) |
|
|
102
|
+
| `product.options` | array | `ProductOption` objects: `name`, `values`, `selected_value` |
|
|
103
|
+
| `product.initial_variant` | object | Selected variant, or default first available |
|
|
104
|
+
| `product.updated_at` | string | Last update timestamp |
|
|
105
|
+
| `product.average_rating` | number | Average review score (see note below) |
|
|
106
|
+
| `product.review_count` | number | Number of reviews (see note below) |
|
|
107
|
+
| `product.specification_group` | array | Specification groups |
|
|
108
|
+
| `product.custom_fields` | array | Custom field definitions |
|
|
109
|
+
| `product.compare_at_price` | number | Original price before discount |
|
|
110
|
+
| `product.created_at` | string | Creation timestamp |
|
|
111
|
+
|
|
112
|
+
`average_rating` and `review_count` are set on collection, category, search, and recommendations pages; they are `0` elsewhere.
|
|
113
|
+
|
|
114
|
+
```liquid
|
|
115
|
+
<h1>{{ product.title }}</h1>
|
|
116
|
+
<p>{{ product.price }}</p>
|
|
117
|
+
|
|
118
|
+
{% if product.on_sale %}
|
|
119
|
+
<span class="sale">{{ "product.on_sale_label" | t }}</span>
|
|
120
|
+
{% endif %}
|
|
121
|
+
|
|
122
|
+
{% for image in product.images %}
|
|
123
|
+
<img src="{{ image | image_url }}" alt="{{ product.title }}">
|
|
124
|
+
{% endfor %}
|
|
125
|
+
|
|
126
|
+
{% for option in product.options %}
|
|
127
|
+
<label>{{ option.name }}</label>
|
|
128
|
+
<span>{{ option.selected_value }}</span>
|
|
129
|
+
{% endfor %}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
### collection
|
|
135
|
+
|
|
136
|
+
The current collection (available on collection pages).
|
|
137
|
+
|
|
138
|
+
| Property | Type | Description |
|
|
139
|
+
|----------|------|-------------|
|
|
140
|
+
| `collection.id` | string | Collection ID |
|
|
141
|
+
| `collection.title` | string | Collection name |
|
|
142
|
+
| `collection.description` | string | HTML description |
|
|
143
|
+
| `collection.url` | string | Relative URL |
|
|
144
|
+
| `collection.products` | array | Products in this collection |
|
|
145
|
+
| `collection.products_count` | number | Total product count |
|
|
146
|
+
| `collection.last_modified_time` | string | Last modification time |
|
|
147
|
+
| `collection.page_context` | object | Pagination / listing context (replaces `collection.paginate`) |
|
|
148
|
+
|
|
149
|
+
**Removed — not exposed:** includes `sort_by`, `image`, `featured_image`, `tags`, `all_tags`, `all_types`, `all_vendors`, `template_suffix`, and others not listed above.
|
|
150
|
+
|
|
151
|
+
```liquid
|
|
152
|
+
<h1>{{ collection.title }}</h1>
|
|
153
|
+
<p>{{ collection.products_count }} products</p>
|
|
154
|
+
|
|
155
|
+
{% for product in collection.products %}
|
|
156
|
+
{% render 'product-card', product: product %}
|
|
157
|
+
{% endfor %}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
### cart
|
|
163
|
+
|
|
164
|
+
The current customer's shopping cart.
|
|
165
|
+
|
|
166
|
+
| Property | Type | Description |
|
|
167
|
+
|----------|------|-------------|
|
|
168
|
+
| `cart.items` | array | Line items in the cart |
|
|
169
|
+
| `cart.item_count` | number | Total number of items |
|
|
170
|
+
| `cart.total_price` | number | Cart total (in cents) |
|
|
171
|
+
| `cart.items_subtotal_price_formatted` | string | Subtotal, formatted |
|
|
172
|
+
| `cart.total_discount_formatted` | string | Total discount, formatted |
|
|
173
|
+
| `cart.total_price_formatted` | string | Total price, formatted |
|
|
174
|
+
|
|
175
|
+
Test for an empty cart with `cart.item_count == 0`. Use the global **`currency`** object for currency display, not a property on `cart`.
|
|
176
|
+
|
|
177
|
+
**Removed — not exposed:** includes `cart_level_discount_applications`, `discount_applications`, `checkout_charge_amount`, `note`, `original_total_price`, `requires_shipping`, `taxes_included`, `tax_total`, `total_weight`, and discount/tax line objects (`DiscountApplication`, `TaxLine`, etc.).
|
|
178
|
+
|
|
179
|
+
#### Cart line items (`cart.items[]`)
|
|
180
|
+
|
|
181
|
+
| Property | Description |
|
|
182
|
+
|----------|-------------|
|
|
183
|
+
| `item.id` | Line item ID |
|
|
184
|
+
| `item.product` | Full product object |
|
|
185
|
+
| `item.product.title` | Product title |
|
|
186
|
+
| `item.selected_variant` | Chosen variant |
|
|
187
|
+
| `item.selected_variant.cover_media` | Line image |
|
|
188
|
+
| `item.selected_variant.sku` | SKU |
|
|
189
|
+
| `item.item_total` / `item.item_total_formatted` | Line total |
|
|
190
|
+
| `item.rate` / `item.rate_formatted` | Unit price |
|
|
191
|
+
| `item.label_rate` / `item.label_rate_formatted` | List / label price |
|
|
192
|
+
| `item.discount_total_formatted` | Discount on the line |
|
|
193
|
+
| `item.item_custom_fields` | Custom fields |
|
|
194
|
+
|
|
195
|
+
```liquid
|
|
196
|
+
{% if cart.item_count > 0 %}
|
|
197
|
+
<span class="cart-badge">{{ cart.item_count }}</span>
|
|
198
|
+
{% endif %}
|
|
199
|
+
|
|
200
|
+
{% for item in cart.items %}
|
|
201
|
+
<div class="cart-item">
|
|
202
|
+
<span>{{ item.product.title }}</span>
|
|
203
|
+
<span>{{ item.rate }} × {{ item.quantity }}</span>
|
|
204
|
+
</div>
|
|
205
|
+
{% endfor %}
|
|
206
|
+
|
|
207
|
+
<strong>Total: {{ cart.total_price_formatted }}</strong>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
### save_for_later
|
|
213
|
+
|
|
214
|
+
Saved items use the same line-item shape as `cart.items`: `item.id`, `item.product`, `item.selected_variant`, etc.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
### customer
|
|
219
|
+
|
|
220
|
+
The logged-in customer (nil if not logged in).
|
|
221
|
+
|
|
222
|
+
| Property | Type | Description |
|
|
223
|
+
|----------|------|-------------|
|
|
224
|
+
| `customer.id` | string | Customer ID |
|
|
225
|
+
| `customer.first_name` | string | First name |
|
|
226
|
+
| `customer.last_name` | string | Last name |
|
|
227
|
+
| `customer.email` | string | Email address |
|
|
228
|
+
| `customer.orders` | array | Order history |
|
|
229
|
+
| `customer.addresses` | array | Saved addresses |
|
|
230
|
+
| `customer.default_address` | object | Primary address |
|
|
231
|
+
|
|
232
|
+
```liquid
|
|
233
|
+
{% if customer %}
|
|
234
|
+
<span>Welcome, {{ customer.first_name }}</span>
|
|
235
|
+
{% else %}
|
|
236
|
+
<a href="{{ routes.signin_url }}">Sign In</a>
|
|
237
|
+
{% endif %}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Page Context Objects
|
|
243
|
+
|
|
244
|
+
### page_title
|
|
245
|
+
|
|
246
|
+
The title of the current page, set automatically based on page type:
|
|
247
|
+
|
|
248
|
+
```liquid
|
|
249
|
+
<title>{{ page_title }} | {{ store.name }}</title>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### request
|
|
253
|
+
|
|
254
|
+
Information about the current HTTP request:
|
|
255
|
+
|
|
256
|
+
| Property | Type | Description |
|
|
257
|
+
|----------|------|-------------|
|
|
258
|
+
| `request.path` | string | Current URL path |
|
|
259
|
+
| `request.host` | string | Hostname |
|
|
260
|
+
|
|
261
|
+
```liquid
|
|
262
|
+
<link rel="canonical" href="{{ request.host }}{{ request.path }}">
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
### menu
|
|
268
|
+
|
|
269
|
+
The store’s default navigation menu. Top-level entries are `menu.menu_items`; nested items use `child_items`. Each item follows `{ id, name, url, child_items, resource }`.
|
|
270
|
+
|
|
271
|
+
| Property | Type | Description |
|
|
272
|
+
|----------|------|-------------|
|
|
273
|
+
| `menu.menu_items` | array | Top-level navigation items |
|
|
274
|
+
|
|
275
|
+
```liquid
|
|
276
|
+
{% for item in menu.menu_items %}
|
|
277
|
+
<a href="{{ item.url }}">{{ item.name }}</a>
|
|
278
|
+
{% for child in item.child_items %}
|
|
279
|
+
<a href="{{ child.url }}">{{ child.name }}</a>
|
|
280
|
+
{% endfor %}
|
|
281
|
+
{% endfor %}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
### page_info
|
|
287
|
+
|
|
288
|
+
Information about the current page context. Useful for building URLs in client-side scripts.
|
|
289
|
+
|
|
290
|
+
| Property | Type | Description |
|
|
291
|
+
|----------|------|-------------|
|
|
292
|
+
| `page_info.origin` | string | The base origin URL (e.g. `https://yourstore.com`) |
|
|
293
|
+
|
|
294
|
+
```liquid
|
|
295
|
+
{% assign search_url = page_info.origin %}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
### routes
|
|
301
|
+
|
|
302
|
+
Platform-provided URL routes for dynamic features.
|
|
303
|
+
|
|
304
|
+
| Property | Type | Description |
|
|
305
|
+
|----------|------|-------------|
|
|
306
|
+
| `routes.predictive_search_url` | string | Predictive search API |
|
|
307
|
+
| `routes.cart_api_url` | string | Cart API |
|
|
308
|
+
| `routes.checkout_coupons_api_url` | string | Checkout coupons API |
|
|
309
|
+
| `routes.quote_api_url` | string | Quote API |
|
|
310
|
+
| `routes.quotes_list_api_url` | string | Quotes list API |
|
|
311
|
+
| `routes.quote_request_api_url_prefix` | string | Prefix for quote request API |
|
|
312
|
+
| `routes.quote_detail_api_url_prefix` | string | Prefix for quote detail API |
|
|
313
|
+
| `routes.signin_url` | string | Sign-in page |
|
|
314
|
+
| `routes.signup_url` | string | Sign-up page |
|
|
315
|
+
| `routes.forgotpassword_url` | string | Forgot password page |
|
|
316
|
+
| `routes.product_recommendations_url_suffix` | string | Suffix for product recommendations URL (see below) |
|
|
317
|
+
| `routes.product_reviews_url_suffix` | string | Suffix for product reviews URL (see below) |
|
|
318
|
+
|
|
319
|
+
**Recommended products** — `product.recommended_products` is not available in Liquid. Build the URL and call the API from JavaScript:
|
|
320
|
+
|
|
321
|
+
```liquid
|
|
322
|
+
{% assign reco_url = product.id | prepend: '/products/' | append: routes.product_recommendations_url_suffix %}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
`GET /products/{id}/recommendations` returns `{ recommendations: [...], sections: {...} }`.
|
|
326
|
+
|
|
327
|
+
**Product reviews** — reviews API path changed from `/reviews/{id}` to `/products/{id}/reviews`. Replace `routes.reviews_api_url_prefix` with `routes.product_reviews_url_suffix`:
|
|
328
|
+
|
|
329
|
+
```liquid
|
|
330
|
+
{% assign reviews_url = product.id | prepend: '/products/' | append: routes.product_reviews_url_suffix %}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
```liquid
|
|
334
|
+
{% assign route_url = routes.predictive_search_url %}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
---
|
|
338
|
+
|
|
339
|
+
## Section Objects
|
|
340
|
+
|
|
341
|
+
### section
|
|
342
|
+
|
|
343
|
+
Available inside section templates. Provides access to the section's settings and blocks.
|
|
344
|
+
|
|
345
|
+
| Property | Type | Description |
|
|
346
|
+
|----------|------|-------------|
|
|
347
|
+
| `section.settings` | object | The section's current setting values |
|
|
348
|
+
| `section.blocks` | array | The section's block instances |
|
|
349
|
+
| `section.id` | string | Unique section ID |
|
|
350
|
+
|
|
351
|
+
```liquid
|
|
352
|
+
<h2>{{ section.settings.title }}</h2>
|
|
353
|
+
|
|
354
|
+
{% for block in section.blocks %}
|
|
355
|
+
{{ block.settings.text }}
|
|
356
|
+
{% endfor %}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### block
|
|
360
|
+
|
|
361
|
+
Available inside a block loop. Represents a single block instance.
|
|
362
|
+
|
|
363
|
+
| Property | Type | Description |
|
|
364
|
+
|----------|------|-------------|
|
|
365
|
+
| `block.type` | string | Block type identifier |
|
|
366
|
+
| `block.settings` | object | Block setting values |
|
|
367
|
+
| `block.zcommerce_attributes` | string | Required attributes for editor interaction |
|
|
368
|
+
|
|
369
|
+
```liquid
|
|
370
|
+
{% for block in section.blocks %}
|
|
371
|
+
<div {{ block.zcommerce_attributes }}>
|
|
372
|
+
{{ block.settings.heading }}
|
|
373
|
+
</div>
|
|
374
|
+
{% endfor %}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## Layout Variables
|
|
380
|
+
|
|
381
|
+
These are used exclusively in layout files (`theme.liquid`, `accounts.liquid`):
|
|
382
|
+
|
|
383
|
+
| Variable | Placement | Description |
|
|
384
|
+
|----------|-----------|-------------|
|
|
385
|
+
| `content_for_header` | Inside `<head>` | Server-injected platform scripts, meta tags, stylesheets, and analytics (from Zoho Commerce admin) |
|
|
386
|
+
| `content_for_layout` | Inside `<body>` | Page-specific content |
|
|
387
|
+
| `content_for_footer` | Before `</body>` | Post-DOM scripts |
|
|
388
|
+
|
|
389
|
+
> **Note:** `content_for_header` outputs markup and scripts that the server injects based on your Zoho Commerce admin configuration. That includes standard head content and **analytics scripts** when tracking is enabled for the store. You do **not** need any separate analytics wiring in the theme—place `{{ content_for_header }}` once in your layout `<head>` and the platform applies analytics for you alongside other meta and scripts.
|
|
390
|
+
|
|
391
|
+
See [Layouts](../layouts) for usage examples.
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Variant objects
|
|
396
|
+
|
|
397
|
+
When iterating `product.variants` or using `product.initial_variant`:
|
|
398
|
+
|
|
399
|
+
| Property | Type | Description |
|
|
400
|
+
|----------|------|-------------|
|
|
401
|
+
| `variant.cover_media` | object | Primary image for the variant |
|
|
402
|
+
| `variant.available_stock` | number | Available quantity |
|
|
403
|
+
| `variant.options` | array | Option values by position: `options[0]`, `options[1]`, `options[2]` |
|
|
404
|
+
| `variant.sku` | string | SKU |
|
|
405
|
+
| `variant.price_formatted` | string | Current price, formatted |
|
|
406
|
+
| `variant.label_price_formatted` | string | List / label price, formatted |
|
|
407
|
+
| `variant.discount_total_formatted` | string | Discount amount, formatted |
|
|
408
|
+
| `variant.product_id` | string | Parent product ID |
|
|
409
|
+
| `variant.custom_fields` | array | Custom fields |
|
|
410
|
+
|
|
411
|
+
Use **`product.options`** for option pickers — `options_with_values` is not available on variants.
|
|
412
|
+
|
|
413
|
+
**Removed — no replacement:** `compare_at_price` on variants.
|
|
414
|
+
|
|
415
|
+
**Removed — not exposed:** includes `barcode`, `inventory_quantity`, `unit_price_measurement`, `store_availabilities`, `quantity_price_breaks`, `quantity_rule`, and other fields not listed above.
|