@zohofinance/commerce 1.0.0 → 1.1.0
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 +59 -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 +136 -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
package/ts-dist/mocks/init-theme/.claude/skills/theme-from-figma/zcommerce-docs/setup-guide.md
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Setup Guide"
|
|
3
|
+
weight: 3
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Setup Guide
|
|
7
|
+
|
|
8
|
+
Get your Zoho Commerce theme development environment ready in minutes.
|
|
9
|
+
|
|
10
|
+
## Prerequisites
|
|
11
|
+
|
|
12
|
+
Before starting, make sure you have:
|
|
13
|
+
|
|
14
|
+
- A code editor (VS Code recommended)
|
|
15
|
+
- Node.js (version 16 or higher)
|
|
16
|
+
- A Zoho Commerce store (or test account)
|
|
17
|
+
- Basic understanding of HTML/CSS
|
|
18
|
+
- Familiarity with command line
|
|
19
|
+
|
|
20
|
+
## Installing the CLI and Setting Up Your Theme
|
|
21
|
+
|
|
22
|
+
The recommended way to develop themes is using our CLI tool for local preview and the build tool for deployment.
|
|
23
|
+
|
|
24
|
+
### Step 1: Create Theme Folder Structure
|
|
25
|
+
|
|
26
|
+
Set up your theme directory with the required folders:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
mkdir my-theme && cd my-theme
|
|
30
|
+
mkdir assets i18n layouts sections snippets settings pages
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Step 2: Start Development Server
|
|
34
|
+
|
|
35
|
+
Run the development server using npx:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx @zohofinance/commerce theme dev
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
This starts a local development server that:
|
|
42
|
+
- Watches for file changes and reloads automatically
|
|
43
|
+
- Renders your Liquid templates with mock data
|
|
44
|
+
- Serves assets from the `assets/` folder
|
|
45
|
+
- Provides a local preview of your storefront
|
|
46
|
+
|
|
47
|
+
### Step 3: Connect to Live Store Data
|
|
48
|
+
|
|
49
|
+
To preview your theme with real data from your Zoho Commerce store:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx @zohofinance/commerce theme dev --storeUrl=https://yourstore.zohocommerce.com
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
This connects to the specified store and pulls live data — products, collections, customer information, pricing, and more.
|
|
56
|
+
|
|
57
|
+
> **Tip — Inspect the live data shape:** Before writing Liquid for any page, visit that page on your store with `?format=json` appended to the URL (e.g., `https://yourstore.zohocommerce.com/products/my-product?format=json`). The response is the exact JSON node tree that the Liquid template receives, so you can see every available object, key, and nested property before writing a single `{{ }}` expression.
|
|
58
|
+
|
|
59
|
+
## Understanding the Files
|
|
60
|
+
|
|
61
|
+
Key files to examine first in your new theme:
|
|
62
|
+
|
|
63
|
+
1. **`layouts/theme.liquid`** - Main HTML structure
|
|
64
|
+
2. **`settings/schema.json`** - Theme-wide settings
|
|
65
|
+
3. **`sections/header.liquid`** - Header component
|
|
66
|
+
4. **`i18n/en.json`** - Translation strings
|
|
67
|
+
5. **`assets/main.css`** - Main stylesheet
|
|
68
|
+
|
|
69
|
+
### Making Your First Change
|
|
70
|
+
|
|
71
|
+
Let's modify a section setting:
|
|
72
|
+
|
|
73
|
+
1. Open `sections/header.liquid`
|
|
74
|
+
2. Find the `{% schema %}` block at the bottom
|
|
75
|
+
3. Locate a text setting and modify its default value:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"type": "text",
|
|
80
|
+
"id": "announcement",
|
|
81
|
+
"label": "t:sections.header.settings.announcement.label",
|
|
82
|
+
"default": "Free shipping on orders over $50"
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
4. Save the file — the dev server will automatically reload
|
|
87
|
+
|
|
88
|
+
## Local Development Setup
|
|
89
|
+
|
|
90
|
+
For a professional development workflow:
|
|
91
|
+
|
|
92
|
+
### VS Code Setup (Recommended)
|
|
93
|
+
|
|
94
|
+
1. **Install Liquid extension:**
|
|
95
|
+
- Open VS Code
|
|
96
|
+
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
|
|
97
|
+
- Search for "Liquid"
|
|
98
|
+
- Install a Liquid language support extension
|
|
99
|
+
|
|
100
|
+
2. **Open the theme folder:**
|
|
101
|
+
- File > Open Folder > select your theme folder
|
|
102
|
+
|
|
103
|
+
## Theme Development Workflow
|
|
104
|
+
|
|
105
|
+
### 1. Planning Your Theme
|
|
106
|
+
|
|
107
|
+
Before coding, plan:
|
|
108
|
+
|
|
109
|
+
- **Layout**: How will pages be organized?
|
|
110
|
+
- **Colors**: What's your color scheme?
|
|
111
|
+
- **Typography**: What fonts will you use?
|
|
112
|
+
- **Components**: What sections do you need?
|
|
113
|
+
- **Features**: What Zoho Commerce features will you use?
|
|
114
|
+
|
|
115
|
+
### 2. Setting Up Structure
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
theme/
|
|
119
|
+
├── assets/
|
|
120
|
+
│ ├── style.css
|
|
121
|
+
│ ├── main.css
|
|
122
|
+
│ ├── theme-settings.css
|
|
123
|
+
│ ├── signin.css
|
|
124
|
+
│ ├── header.js
|
|
125
|
+
│ ├── footer.js
|
|
126
|
+
│ ├── add-to-cart.js
|
|
127
|
+
│ ├── cart-items.js
|
|
128
|
+
│ ├── product-images.js
|
|
129
|
+
│ ├── search-bar.js
|
|
130
|
+
│ └── fingerprint.json
|
|
131
|
+
├── i18n/
|
|
132
|
+
│ ├── en.json
|
|
133
|
+
│ └── en.schema.json
|
|
134
|
+
│ └── ...
|
|
135
|
+
├── layouts/
|
|
136
|
+
│ ├── theme.liquid
|
|
137
|
+
│ ├── accounts.liquid
|
|
138
|
+
│ └── sitemap.liquid
|
|
139
|
+
├── pages/
|
|
140
|
+
│ ├── index.json
|
|
141
|
+
│ ├── product.json
|
|
142
|
+
│ ├── collection.json
|
|
143
|
+
│ └── ...
|
|
144
|
+
├── sections/
|
|
145
|
+
│ ├── header.liquid
|
|
146
|
+
│ ├── header-group.json
|
|
147
|
+
│ ├── footer.liquid
|
|
148
|
+
│ ├── footer-group.json
|
|
149
|
+
│ └── ...
|
|
150
|
+
├── settings/
|
|
151
|
+
│ ├── schema.json
|
|
152
|
+
│ └── theme.json
|
|
153
|
+
└── snippets/
|
|
154
|
+
├── product-card.liquid
|
|
155
|
+
├── pagination.liquid
|
|
156
|
+
└── ...
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### 3. Creating Your First Section
|
|
160
|
+
|
|
161
|
+
Create `sections/hero-banner.liquid`:
|
|
162
|
+
|
|
163
|
+
```liquid
|
|
164
|
+
{% assign settings = section.settings %}
|
|
165
|
+
|
|
166
|
+
<section class="hero-banner" style="background: {{ settings.bg_color }}">
|
|
167
|
+
<div class="hero-content">
|
|
168
|
+
<h1>{{ settings.title }}</h1>
|
|
169
|
+
<p>{{ settings.subtitle }}</p>
|
|
170
|
+
<a href="{{ settings.button_url.handle }}" class="btn">{{ settings.button_text }}</a>
|
|
171
|
+
</div>
|
|
172
|
+
</section>
|
|
173
|
+
|
|
174
|
+
<style>
|
|
175
|
+
.hero-banner {
|
|
176
|
+
padding: {{ settings.desktop_padding }}px;
|
|
177
|
+
text-align: center;
|
|
178
|
+
color: {{ settings.text_color }};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.btn {
|
|
182
|
+
background: {{ settings.button_color }};
|
|
183
|
+
color: white;
|
|
184
|
+
padding: 12px 30px;
|
|
185
|
+
text-decoration: none;
|
|
186
|
+
border-radius: 4px;
|
|
187
|
+
display: inline-block;
|
|
188
|
+
}
|
|
189
|
+
</style>
|
|
190
|
+
|
|
191
|
+
{% schema %}
|
|
192
|
+
{
|
|
193
|
+
"name": "t:sections.hero_banner.name",
|
|
194
|
+
"category": "Banner",
|
|
195
|
+
"tag": "section",
|
|
196
|
+
"class": "section",
|
|
197
|
+
"available_in": {"templates": ["index", "category", "collection"]},
|
|
198
|
+
"settings": [
|
|
199
|
+
{
|
|
200
|
+
"type": "text",
|
|
201
|
+
"id": "title",
|
|
202
|
+
"label": "t:sections.hero_banner.settings.title.label",
|
|
203
|
+
"default": "Welcome"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"type": "text",
|
|
207
|
+
"id": "subtitle",
|
|
208
|
+
"label": "t:sections.hero_banner.settings.subtitle.label",
|
|
209
|
+
"default": "Your tagline here"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"type": "color",
|
|
213
|
+
"id": "bg_color",
|
|
214
|
+
"label": "t:sections.hero_banner.settings.bg_color.label",
|
|
215
|
+
"default": "#f5f5f5"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"type": "color",
|
|
219
|
+
"id": "text_color",
|
|
220
|
+
"label": "t:sections.hero_banner.settings.text_color.label",
|
|
221
|
+
"default": "#333333"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"type": "url",
|
|
225
|
+
"id": "button_url",
|
|
226
|
+
"label": "t:sections.hero_banner.settings.button_url.label",
|
|
227
|
+
"default": { "display_name": "t:sections.hero_banner.settings.button_url.default", "handle": "collections/all-products" }
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"type": "text",
|
|
231
|
+
"id": "button_text",
|
|
232
|
+
"label": "t:sections.hero_banner.settings.button_text.label",
|
|
233
|
+
"default": "Learn More"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"type": "color",
|
|
237
|
+
"id": "button_color",
|
|
238
|
+
"label": "t:sections.hero_banner.settings.button_color.label",
|
|
239
|
+
"default": "#000000"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"type": "range",
|
|
243
|
+
"id": "desktop_padding",
|
|
244
|
+
"label": "t:sections.hero_banner.settings.padding.label",
|
|
245
|
+
"min": 0,
|
|
246
|
+
"max": 100,
|
|
247
|
+
"step": 10,
|
|
248
|
+
"unit": "px",
|
|
249
|
+
"default": 50,
|
|
250
|
+
"meta": "desktop"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"type": "range",
|
|
254
|
+
"id": "mobile_padding",
|
|
255
|
+
"label": "t:sections.hero_banner.settings.padding.label",
|
|
256
|
+
"min": 0,
|
|
257
|
+
"max": 60,
|
|
258
|
+
"step": 5,
|
|
259
|
+
"unit": "px",
|
|
260
|
+
"default": 30,
|
|
261
|
+
"meta": "mobile"
|
|
262
|
+
}
|
|
263
|
+
]
|
|
264
|
+
}
|
|
265
|
+
{% endschema %}
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### 4. Testing Your Theme
|
|
269
|
+
|
|
270
|
+
Test your theme using the CLI with your store's live data:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
npx @zohofinance/commerce theme dev --storeUrl=https://yourstore.zohocommerce.com
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
The dev server will show your theme preview at `http://localhost:3000`.
|
|
277
|
+
|
|
278
|
+
Testing checklist:
|
|
279
|
+
- Check the admin UI customization works
|
|
280
|
+
- Test on mobile and desktop
|
|
281
|
+
- Verify all translations appear
|
|
282
|
+
- Test with real product data
|
|
283
|
+
|
|
284
|
+
## Publishing Your Theme
|
|
285
|
+
|
|
286
|
+
### Step 1: Prepare for Publishing
|
|
287
|
+
|
|
288
|
+
Checklist:
|
|
289
|
+
- ✅ All sections working correctly
|
|
290
|
+
- ✅ No broken links or references
|
|
291
|
+
- ✅ Mobile responsive design tested
|
|
292
|
+
|
|
293
|
+
> Validation (Liquid, JS, translations, assets), asset fingerprinting, and minification are all handled automatically by the CLI build command — no manual steps needed.
|
|
294
|
+
|
|
295
|
+
### Step 2: Build and Package Theme
|
|
296
|
+
|
|
297
|
+
Run the build command:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
npx @zohofinance/commerce theme build
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
The CLI validates all theme files, fingerprints assets, and produces a `theme.zip` ready for upload. If any issues are found, the build halts with a clear error report.
|
|
304
|
+
|
|
305
|
+
For a production-ready package with minification and Brotli compression:
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
npx @zohofinance/commerce theme build --prod
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Step 3: Upload to Zoho Commerce
|
|
312
|
+
|
|
313
|
+
1. Log in to Zoho Commerce admin
|
|
314
|
+
2. Go to **Online Store** → **Themes**
|
|
315
|
+
3. Click **Upload Custom Theme** or **Create From Template**
|
|
316
|
+
4. Select your `theme.zip` file
|
|
317
|
+
5. Click **Upload**
|
|
318
|
+
6. Zoho will process and activate your theme
|
|
319
|
+
|
|
320
|
+
### Step 4: Add to Marketplace (Optional)
|
|
321
|
+
|
|
322
|
+
Once your theme is working:
|
|
323
|
+
|
|
324
|
+
1. Polish and test thoroughly
|
|
325
|
+
2. Create marketing screenshots
|
|
326
|
+
3. Write description
|
|
327
|
+
4. Contact Zoho Commerce team
|
|
328
|
+
5. Submit for marketplace review
|
|
329
|
+
|
|
330
|
+
## Troubleshooting
|
|
331
|
+
|
|
332
|
+
### Common Issues
|
|
333
|
+
|
|
334
|
+
**Sections not appearing:**
|
|
335
|
+
- Check the page JSON includes the section
|
|
336
|
+
- Verify section filename matches the type
|
|
337
|
+
- Check for schema errors in the Liquid editor
|
|
338
|
+
|
|
339
|
+
**Images not loading:**
|
|
340
|
+
- Ensure using `asset_url` filter for theme assets
|
|
341
|
+
- Use `image_url` filter for product images
|
|
342
|
+
- Verify no typos in filenames
|
|
343
|
+
- Check fingerprint.json has correct mappings
|
|
344
|
+
|
|
345
|
+
**Translations missing:**
|
|
346
|
+
- Check key exists in `i18n/en.json`
|
|
347
|
+
- Verify key path (nested object structure)
|
|
348
|
+
- Ensure key is used with `t` or `translate` filter
|
|
349
|
+
|
|
350
|
+
**Styling not applied:**
|
|
351
|
+
- Clear browser cache
|
|
352
|
+
- Check CSS asset is in assets folder
|
|
353
|
+
- Verify using `asset_url` filter properly
|
|
354
|
+
- Check for CSS specificity conflicts
|
|
355
|
+
|
|
356
|
+
**Schema not working:**
|
|
357
|
+
- Validate JSON syntax (use JSON validator)
|
|
358
|
+
- Ensure all IDs are unique within section
|
|
359
|
+
- Check default values match setting type format
|
|
360
|
+
- Verify translation key format (`t:` prefix)
|
|
361
|
+
|
|
362
|
+
## Development Best Practices
|
|
363
|
+
|
|
364
|
+
### Comments and Documentation
|
|
365
|
+
|
|
366
|
+
```liquid
|
|
367
|
+
{%- comment -%}
|
|
368
|
+
Product card component
|
|
369
|
+
Displays product image, title, price
|
|
370
|
+
Parameters:
|
|
371
|
+
- product: product object
|
|
372
|
+
- show_price: boolean (default true)
|
|
373
|
+
{%- endcomment -%}
|
|
374
|
+
|
|
375
|
+
<article class="product-card">
|
|
376
|
+
<!-- Product image -->
|
|
377
|
+
<img src="{{ product.cover_media | image_url }}" alt="{{ product.title }}">
|
|
378
|
+
|
|
379
|
+
<!-- Product info -->
|
|
380
|
+
<div class="product-info">
|
|
381
|
+
<h3>{{ product.title }}</h3>
|
|
382
|
+
{% if show_price %}
|
|
383
|
+
<p class="price">{{ product.price }}</p>
|
|
384
|
+
{% endif %}
|
|
385
|
+
</div>
|
|
386
|
+
</article>
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## CLI Commands Reference
|
|
392
|
+
|
|
393
|
+
| Command | Description |
|
|
394
|
+
|---------|-------------|
|
|
395
|
+
| `npx @zohofinance/commerce theme dev` | Start local dev server with mock data |
|
|
396
|
+
| `npx @zohofinance/commerce theme dev --storeUrl=<url>` | Start dev server with live store data |
|
|
397
|
+
| `npx @zohofinance/commerce theme build` | Fingerprint assets, validate all files, and create `theme.zip` |
|
|
398
|
+
| `npx @zohofinance/commerce theme build --prod` | Same as above, plus minification and Brotli compression |
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## Quick Start
|
|
403
|
+
|
|
404
|
+
Set up your theme development environment:
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
# Create theme folder
|
|
408
|
+
mkdir my-theme && cd my-theme
|
|
409
|
+
mkdir assets i18n layouts sections snippets settings pages
|
|
410
|
+
|
|
411
|
+
# Start development server
|
|
412
|
+
npx @zohofinance/commerce theme dev
|
|
413
|
+
|
|
414
|
+
# Connect to your store for live data
|
|
415
|
+
npx @zohofinance/commerce theme dev --storeUrl=https://yourstore.zohocommerce.com
|
|
416
|
+
|
|
417
|
+
# Build for deployment (fingerprints, validates, creates zip)
|
|
418
|
+
npx @zohofinance/commerce theme build
|
|
419
|
+
|
|
420
|
+
# Production build (also minifies + Brotli compresses)
|
|
421
|
+
npx @zohofinance/commerce theme build --prod
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Snippets"
|
|
3
|
+
weight: 6
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Snippets
|
|
7
|
+
|
|
8
|
+
Snippets are reusable Liquid partials stored in the `snippets/` folder. Use them to avoid duplicating markup across sections and layouts.
|
|
9
|
+
|
|
10
|
+
## Using Snippets
|
|
11
|
+
|
|
12
|
+
Include a snippet with the `render` tag:
|
|
13
|
+
|
|
14
|
+
```liquid
|
|
15
|
+
{% render 'product-card', product: item %}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
> The `.liquid` extension is omitted — `'product-card'` loads `snippets/product-card.liquid`.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Passing Variables
|
|
23
|
+
|
|
24
|
+
Variables must be explicitly passed to snippets. Snippets cannot access parent template variables directly.
|
|
25
|
+
|
|
26
|
+
```liquid
|
|
27
|
+
<!-- Pass a single variable -->
|
|
28
|
+
{% render 'price-display', price: product.price %}
|
|
29
|
+
|
|
30
|
+
<!-- Pass multiple variables -->
|
|
31
|
+
{% render 'product-card', product: item, show_price: true, index: forloop.index %}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Inside the snippet, use the passed variable names directly:
|
|
35
|
+
|
|
36
|
+
```liquid
|
|
37
|
+
<!-- snippets/product-card.liquid -->
|
|
38
|
+
<div class="product-card">
|
|
39
|
+
<h3>{{ product.title }}</h3>
|
|
40
|
+
{% if show_price %}
|
|
41
|
+
<span>{{ product.price }}</span>
|
|
42
|
+
{% endif %}
|
|
43
|
+
</div>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Common Snippets
|
|
49
|
+
|
|
50
|
+
| Snippet | Purpose |
|
|
51
|
+
|---------|---------|
|
|
52
|
+
| `product-card.liquid` | Product display card used in collections |
|
|
53
|
+
| `pagination.liquid` | Page navigation for collections |
|
|
54
|
+
| `product-variant-picker.liquid` | Variant selection UI (size, color, etc.) |
|
|
55
|
+
| `icon-cart.liquid` | Cart icon SVG |
|
|
56
|
+
| `icon-search.liquid` | Search icon SVG |
|
|
57
|
+
| `theme-settings.liquid` | Injects dynamic CSS variables for theme settings |
|
|
58
|
+
| `cookie-bar.liquid` | Cookie consent bar |
|
|
59
|
+
| `message-bar.liquid` | Site-wide announcement/message bar |
|
|
60
|
+
|
|
61
|
+
> **Note:** Header and footer are **sections** (in `sections/`), not snippets. They are rendered via the `{% sections 'header-group' %}` and `{% sections 'footer-group' %}` tags in the layout, not with `{% render %}`.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Best Practices
|
|
66
|
+
|
|
67
|
+
- **Keep snippets focused** — one snippet, one responsibility
|
|
68
|
+
- **Always pass variables explicitly** — snippets have isolated scope
|
|
69
|
+
- **Use descriptive filenames** — `product-card.liquid` not `pc.liquid`
|
|
70
|
+
- **Avoid deeply nesting snippets** — one level of `render` inside another is fine; deeper nesting hurts readability
|