shoplazza-cli 0.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.
Files changed (181) hide show
  1. package/.editorconfig +28 -0
  2. package/.prettierrc +9 -0
  3. package/LICENSE +21 -0
  4. package/README.md +208 -0
  5. package/bin/shoplazza +117 -0
  6. package/fixtures/assets/blog.scss +74 -0
  7. package/fixtures/assets/cart_modal.scss +450 -0
  8. package/fixtures/assets/collection_detail.js +234 -0
  9. package/fixtures/assets/collection_detail.scss +345 -0
  10. package/fixtures/assets/collection_list.scss +11 -0
  11. package/fixtures/assets/collection_slider.scss +169 -0
  12. package/fixtures/assets/feature_columns.scss +26 -0
  13. package/fixtures/assets/feature_product.scss +109 -0
  14. package/fixtures/assets/footer.js +58 -0
  15. package/fixtures/assets/footer.scss +337 -0
  16. package/fixtures/assets/four_images.scss +29 -0
  17. package/fixtures/assets/gallery.scss +55 -0
  18. package/fixtures/assets/header.js +178 -0
  19. package/fixtures/assets/header.scss +929 -0
  20. package/fixtures/assets/image_text.scss +72 -0
  21. package/fixtures/assets/logo_bar.scss +11 -0
  22. package/fixtures/assets/newsletter.scss +90 -0
  23. package/fixtures/assets/not_found.scss +39 -0
  24. package/fixtures/assets/page_detail.scss +16 -0
  25. package/fixtures/assets/pagination.scss +150 -0
  26. package/fixtures/assets/postcss.config.js +6 -0
  27. package/fixtures/assets/product_description.scss +88 -0
  28. package/fixtures/assets/product_detail.js +634 -0
  29. package/fixtures/assets/product_detail.scss +1106 -0
  30. package/fixtures/assets/relative_product.scss +45 -0
  31. package/fixtures/assets/reviews.scss +70 -0
  32. package/fixtures/assets/rich_text.scss +71 -0
  33. package/fixtures/assets/search.js +87 -0
  34. package/fixtures/assets/search.scss +67 -0
  35. package/fixtures/assets/slide.scss +51 -0
  36. package/fixtures/assets/slider.scss +141 -0
  37. package/fixtures/assets/theme.css +976 -0
  38. package/fixtures/assets/theme.scss +1100 -0
  39. package/fixtures/assets/three_images.scss +20 -0
  40. package/fixtures/assets/tools.scss +23 -0
  41. package/fixtures/assets/two_images.scss +24 -0
  42. package/fixtures/assets/video.scss +45 -0
  43. package/fixtures/assets/video_text.scss +63 -0
  44. package/fixtures/config/settings_data.json +107 -0
  45. package/fixtures/config/settings_schema.json +690 -0
  46. package/fixtures/layout/theme.liquid +76 -0
  47. package/fixtures/locales/ar-SA.json +212 -0
  48. package/fixtures/locales/de-DE.json +290 -0
  49. package/fixtures/locales/en-US.json +290 -0
  50. package/fixtures/locales/es-ES.json +290 -0
  51. package/fixtures/locales/fr-FR.json +290 -0
  52. package/fixtures/locales/id-ID.json +212 -0
  53. package/fixtures/locales/it-IT.json +212 -0
  54. package/fixtures/locales/ja-JP.json +289 -0
  55. package/fixtures/locales/ko-KR.json +290 -0
  56. package/fixtures/locales/nl-NL.json +290 -0
  57. package/fixtures/locales/pl-PL.json +290 -0
  58. package/fixtures/locales/pt-PT.json +212 -0
  59. package/fixtures/locales/ru-RU.json +212 -0
  60. package/fixtures/locales/th-TH.json +212 -0
  61. package/fixtures/locales/zh-CN.json +290 -0
  62. package/fixtures/locales/zh-TW.json +290 -0
  63. package/fixtures/sections/apps.liquid +47 -0
  64. package/fixtures/sections/blog.liquid +137 -0
  65. package/fixtures/sections/collection_desc.liquid +34 -0
  66. package/fixtures/sections/collection_detail.liquid +436 -0
  67. package/fixtures/sections/collection_image.liquid +104 -0
  68. package/fixtures/sections/collection_list.liquid +161 -0
  69. package/fixtures/sections/collection_name.liquid +34 -0
  70. package/fixtures/sections/collection_slider.liquid +330 -0
  71. package/fixtures/sections/feature_columns.liquid +275 -0
  72. package/fixtures/sections/feature_product.liquid +227 -0
  73. package/fixtures/sections/footer.liquid +488 -0
  74. package/fixtures/sections/four_images.liquid +160 -0
  75. package/fixtures/sections/gallery.liquid +258 -0
  76. package/fixtures/sections/header.liquid +1157 -0
  77. package/fixtures/sections/html.liquid +40 -0
  78. package/fixtures/sections/image_text.liquid +350 -0
  79. package/fixtures/sections/instagram_plus.liquid +393 -0
  80. package/fixtures/sections/logo_bar.liquid +183 -0
  81. package/fixtures/sections/newsletter.liquid +225 -0
  82. package/fixtures/sections/not_found.liquid +39 -0
  83. package/fixtures/sections/overlay_image.liquid +648 -0
  84. package/fixtures/sections/page_detail.liquid +39 -0
  85. package/fixtures/sections/photo_collection.liquid +433 -0
  86. package/fixtures/sections/product_description.liquid +208 -0
  87. package/fixtures/sections/product_detail.liquid +611 -0
  88. package/fixtures/sections/products.liquid +216 -0
  89. package/fixtures/sections/relative_product.liquid +121 -0
  90. package/fixtures/sections/reviews.liquid +115 -0
  91. package/fixtures/sections/rich_text.liquid +157 -0
  92. package/fixtures/sections/search.liquid +163 -0
  93. package/fixtures/sections/slide.liquid +719 -0
  94. package/fixtures/sections/three_images.liquid +157 -0
  95. package/fixtures/sections/two_images.liquid +125 -0
  96. package/fixtures/sections/video.liquid +95 -0
  97. package/fixtures/sections/video_text.liquid +128 -0
  98. package/fixtures/snippets/bgset.liquid +21 -0
  99. package/fixtures/snippets/card_title.liquid +8 -0
  100. package/fixtures/snippets/cart_modal.liquid +74 -0
  101. package/fixtures/snippets/collection.liquid +77 -0
  102. package/fixtures/snippets/collection_filter_modal.liquid +56 -0
  103. package/fixtures/snippets/default_image_4.liquid +14 -0
  104. package/fixtures/snippets/default_image_6.liquid +18 -0
  105. package/fixtures/snippets/default_image_8.liquid +23 -0
  106. package/fixtures/snippets/four_images_item.liquid +8 -0
  107. package/fixtures/snippets/header_ads.liquid +95 -0
  108. package/fixtures/snippets/hero_image.liquid +94 -0
  109. package/fixtures/snippets/icon_video_play_large.liquid +1 -0
  110. package/fixtures/snippets/icon_video_play_medium.liquid +4 -0
  111. package/fixtures/snippets/icon_video_play_small.liquid +4 -0
  112. package/fixtures/snippets/lazyimg.liquid +22 -0
  113. package/fixtures/snippets/lazyimg_art.liquid +36 -0
  114. package/fixtures/snippets/lazysizes.liquid +41 -0
  115. package/fixtures/snippets/link.liquid +2 -0
  116. package/fixtures/snippets/pagination.liquid +48 -0
  117. package/fixtures/snippets/product.liquid +126 -0
  118. package/fixtures/snippets/product_art_tpl.liquid +152 -0
  119. package/fixtures/snippets/product_info_body.liquid +337 -0
  120. package/fixtures/snippets/product_info_tpl.liquid +423 -0
  121. package/fixtures/snippets/product_label.liquid +46 -0
  122. package/fixtures/snippets/settings.liquid +295 -0
  123. package/fixtures/snippets/social-meta-tags.liquid +106 -0
  124. package/fixtures/snippets/video_html.liquid +11 -0
  125. package/fixtures/snippets/video_source.liquid +98 -0
  126. package/fixtures/snippets/video_thumb_icon.liquid +2 -0
  127. package/fixtures/templates/404.liquid +1 -0
  128. package/fixtures/templates/collection.liquid +92 -0
  129. package/fixtures/templates/index.liquid +206 -0
  130. package/fixtures/templates/page.liquid +1 -0
  131. package/fixtures/templates/product.liquid +99 -0
  132. package/fixtures/templates/search.liquid +1 -0
  133. package/jest.config.js +192 -0
  134. package/lib/__tests__/log.test.js +15 -0
  135. package/lib/__tests__/utils.test.js +69 -0
  136. package/lib/auth/__mocks__/getCode.js +7 -0
  137. package/lib/auth/__mocks__/index.js +0 -0
  138. package/lib/auth/child.js +23 -0
  139. package/lib/auth/getCode.js +35 -0
  140. package/lib/auth/index.js +91 -0
  141. package/lib/commands/__tests__/login.test.js +77 -0
  142. package/lib/commands/__tests__/logout.test.js +29 -0
  143. package/lib/commands/__tests__/store.test.js +44 -0
  144. package/lib/commands/__tests__/switch.test.js +45 -0
  145. package/lib/commands/login.js +99 -0
  146. package/lib/commands/logout.js +14 -0
  147. package/lib/commands/store.js +14 -0
  148. package/lib/commands/switch.js +52 -0
  149. package/lib/commands/theme/__tests__/delete.test.js +49 -0
  150. package/lib/commands/theme/__tests__/init.test.js +21 -0
  151. package/lib/commands/theme/__tests__/list.test.js +80 -0
  152. package/lib/commands/theme/__tests__/package.test.js +17 -0
  153. package/lib/commands/theme/__tests__/publish.test.js +61 -0
  154. package/lib/commands/theme/__tests__/pull.test.js +69 -0
  155. package/lib/commands/theme/__tests__/push.test.js +63 -0
  156. package/lib/commands/theme/__tests__/serve.test.js +107 -0
  157. package/lib/commands/theme/delete.js +64 -0
  158. package/lib/commands/theme/init.js +51 -0
  159. package/lib/commands/theme/list.js +28 -0
  160. package/lib/commands/theme/package.js +37 -0
  161. package/lib/commands/theme/publish.js +56 -0
  162. package/lib/commands/theme/pull.js +62 -0
  163. package/lib/commands/theme/push.js +106 -0
  164. package/lib/commands/theme/serve.js +153 -0
  165. package/lib/commands/theme/share.js +20 -0
  166. package/lib/commands/version.js +6 -0
  167. package/lib/config.js +5 -0
  168. package/lib/db/__mocks__/index.js +9 -0
  169. package/lib/db/__tests__/analytics.test.js +19 -0
  170. package/lib/db/__tests__/user.test.js +20 -0
  171. package/lib/db/analytics.js +48 -0
  172. package/lib/db/index.js +9 -0
  173. package/lib/db/user.js +68 -0
  174. package/lib/log.js +13 -0
  175. package/lib/openAPI/__mocks__/index.js +20 -0
  176. package/lib/openAPI/api.js +76 -0
  177. package/lib/openAPI/index.js +46 -0
  178. package/lib/report.js +37 -0
  179. package/lib/tracing.js +50 -0
  180. package/lib/utils.js +48 -0
  181. package/package.json +54 -0
@@ -0,0 +1,611 @@
1
+ {% comment %} {% capture time_seed %}{{ 'now' | date: "%s" }}{% endcapture %}
2
+ {% assign random = time_seed | times: 1103515245 | plus: 12345 | divided_by: 65536 | modulo: 32768 %} {% endcomment %}
3
+ <div class='{% unless REQUEST_URI contains "view=ajax" %}container{% endunless %} container-gap product-detail product-detail-{{section.id}}'
4
+ id="product_detail_{{ product.id }}"
5
+ data-track="product"
6
+ data-track-id="{{product.id}}"
7
+ data-track-price="{{product.price}}"
8
+ data-track-name="{{product.title | escape}}"
9
+ data-track-type="{{product.type}}" data-life-style="true">
10
+ {% assign recommendedProductsPosition = section.settings.recommended_products_position | default: false %}
11
+ {% assign selectedVariantId = "" %}
12
+ {% assign selectedVariant = nil %}
13
+ {% assign priceMin = 99999999 %}
14
+ {% assign comparePriceMin = 99999999 %}
15
+ {% assign priceMax = 0 %}
16
+ {% if settings.is_select_default_variants or product.variants.size == 1 %}
17
+ {% for variant in product.variants %}
18
+ {% if variant.available_quantity > 0 %}
19
+ {% assign selectedVariantId = variant.id %}
20
+ {% break %}
21
+ {% endif %}
22
+ {% endfor %}
23
+ {% endif %}
24
+ {% assign variant_type = settings.variant_type | default: 'button' %}
25
+ {% assign params = REQUEST_URI | split: "?" | last | split: "&" %}
26
+ {% for p in params %}
27
+ {% assign pair = p | split: "=" %}
28
+ {% if pair[0] contains "variant" and pair[1] != '' %}
29
+ {% assign selectedVariantId = pair[1] %}
30
+ {% endif %}
31
+ {% endfor %}
32
+
33
+ {% for variant in product.variants %}
34
+ {% if variant.compare_at_price < comparePriceMin %}
35
+ {% assign comparePriceMin = variant.compare_at_price %}
36
+ {% endif %}
37
+ {% if variant.price < priceMin %}
38
+ {% assign priceMin = variant.price %}
39
+ {% endif %}
40
+ {% if variant.price > priceMax %}
41
+ {% assign priceMax = variant.price %}
42
+ {% endif %}
43
+ {% if variant.id == selectedVariantId %}
44
+ {% assign selectedVariant = variant %}
45
+ {% endif %}
46
+ {% endfor %}
47
+
48
+ {% assign initialSlide = 0 %}
49
+ {% for item in product.images %}
50
+ {% if item.src contains selectedVariant.image.src %}
51
+ {% assign initialSlide = forloop.index0 %}
52
+ {% endif %}
53
+ {% endfor %}
54
+
55
+ <div class="row">
56
+ {% assign commonImg = 'oss/operation/1e6f85988d86fcd8bf0debdec2d41eda.png' | img_url %}
57
+ <div class="product-image col-12 col-md-6">
58
+ <div class="position-relative">
59
+ <div class="support-slick">
60
+ {% if product.images.size > 0 %}
61
+ {% for item in product.images %}
62
+ <div class="swiper-slide">
63
+ {% assign imgHeight = item.height | image_padding_bottom : item.width, origin:'unlimit' %}
64
+ {% assign media = item.src | media_parse %}
65
+ {% assign class_name = 'position-relative w-100 zoom' %}
66
+ {% unless initialSlide == forloop.index0 %}
67
+ {% assign class_name = class_name | append: ' d-none' %}
68
+ {% endunless %}
69
+ {% if media.mp4 or media.hls %}
70
+ {% include 'video_html', media: media, padding_bottom: imgHeight, class: class_name %}
71
+ {% else %}
72
+ <div style="padding-bottom:{{imgHeight}};" class="{{class_name}}">
73
+ <img data-lazy="{{item.src | img_url: '1080x'}}" src="{{shop.default_img}}" class="product-image__swiper_img imglazy loading_bg" data-zoom-src="{{item.src | img_url: '1080x'}}" data-zoom-width="{% if item.width < 1080 %}{{item.width}}{% else %}1080{% endif %}" data-zoom-height="{% if item.width < 1080 %}{{item.height}}{% else %}{{ 1080 | divided_by: item.aspect_ratio | round }}{% endif %}" alt="{{item.alt | default: product.title | escape}}" />
74
+ </div>
75
+ {% endif %}
76
+ </div>
77
+ {% endfor %}
78
+ {% else %}
79
+ <div class="swiper-slide">
80
+ <div style="padding-bottom:100%">
81
+ {% include 'lazyimg', src: commonImg %}
82
+ </div>
83
+ </div>
84
+ {% endif %}
85
+ </div>
86
+ {% if product.images.size > 1 %}
87
+ <a href="javascript:;" class="sep-loaded-slider__button sep-loaded-slider__button-prev d-none d-md-block"><i class="sep-font sep-font-angle-left"></i></a>
88
+ <a href="javascript:;" class="sep-loaded-slider__button sep-loaded-slider__button-next d-none d-md-block"><i class="sep-font sep-font-angle-right"></i></a>
89
+ {% endif %}
90
+ </div>
91
+ <div class="product-image__swiper_bullets">{{initialSlide | plus: 1}} / {{product.images.size}}</div>
92
+ {% comment %} 缩略图 {% endcomment %}
93
+ {% if product.images.size > 1 %}
94
+ <div class="product-image__thumbs">
95
+ <div class="product-image__thumbs-content">
96
+ {% assign thumbWidth = 80 %}
97
+ {% assign marginLeft = 0 %}
98
+ {% assign size = product.images.size %}
99
+ {% assign maxIdx = product.images.size | minus:6 %}
100
+ {% if initialSlide < 6 %}
101
+ {% assign marginLeft = 0 %}
102
+ {% elsif initialSlide >= maxIdx and size > 6 %}
103
+ {% assign marginLeft = maxIdx | times: 80 %}
104
+ {% else %}
105
+ {% assign marginLeft = initialSlide | times: 80 %}
106
+ {% endif %}
107
+
108
+ {% for item in product.images %}
109
+ <div class="product-image__thumbs-item position-relative {% if initialSlide == forloop.index0 %}slick-slide slick-current{% endif %}" style="margin-left:{% if forloop.index0 == 0 %}-{{marginLeft}}{% endif %}px" data-thumb-idx="{{ forloop.index0 }}" >
110
+ {% assign inView = 0 %}
111
+ {% assign offsetLeft = forloop.index0 | times: 80 | minus: marginLeft %}
112
+ {% if offsetLeft >= 0 and offsetLeft < 480 %}
113
+ {% assign inView = 1 %}
114
+ {% endif %}
115
+
116
+ <img class="{% if inView == 0 %}lazy-{%endif%}lazyload" src="{{shop.default_img}}" data-src="{{item.src | img_url: '100x' }}" alt="{{ item.alt | default: product.title | escape }}">
117
+ {% assign media = item.src | media_parse %}
118
+ {% if media.mp4 or media.hls %}
119
+ {% include 'video_thumb_icon' %}
120
+ {% endif %}
121
+ </div>
122
+ {% endfor %}
123
+ </div>
124
+ <div class="swiper-button-prev product-image__thumbs_button-prev-{{section.id}} product-image__thumbs_btn sep-font sep-font-angle-left"></div>
125
+ <div class="swiper-button-next product-image__thumbs_button-next-{{section.id}} product-image__thumbs_btn sep-font sep-font-angle-right"></div>
126
+ </div>
127
+ {% endif %}
128
+ {% unless REQUEST_URI contains "view=ajax" %}
129
+ {% if recommendedProductsPosition %}
130
+ <div class="col-12 relative_product_left d-none d-md-block">
131
+ {% if section.settings.relative_title != blank %}
132
+ <div class="relative_product__title dj_skin_title_font position-relative">
133
+ {{ section.settings.relative_title}}
134
+ <span class="relative_product__change d-none">{{ 'i18n.product.product_detail.not_like_these' | t}}</span>
135
+ </div>
136
+ {% endif %}
137
+ <div class="relative_product__content row"></div>
138
+ </div>
139
+ {% endif %}
140
+ {% endunless %}
141
+ {% assign productSelected = selectedVariant | default: product %}
142
+ {% assign priceMinus = productSelected.compare_at_price | minus: productSelected.price %}
143
+ {% include 'product_label', product: product, product_selected: productSelected, is_opacity: true %}
144
+ </div>
145
+
146
+ <form class="product-info product-info-{{product.id}} col-12 col-md-6 properties">
147
+ {% include 'product_info_body' %}
148
+ </form>
149
+ {% unless REQUEST_URI contains "view=ajax" %}
150
+ {% if recommendedProductsPosition%}
151
+ <div class="col-12 relative_product d-block d-md-none">
152
+ {% if section.settings.relative_title != blank %}
153
+ <div class="relative_product__title dj_skin_title_font position-relative">
154
+ {{ section.settings.relative_title}}
155
+ <span class="relative_product__change d-none">{{ 'i18n.product.product_detail.not_like_these' | t}}</span>
156
+ </div>
157
+ {% endif %}
158
+ <div class="relative_product__content row"></div>
159
+ </div>
160
+ {% endif %}
161
+ {% comment %} 定义前端模板 {% endcomment %}
162
+ <script id="relative-product-art-tpl" type="text/html">
163
+ <% for(var i = 0; i < products.length; i++) { %>
164
+ <div class="col-6 <%= colMd %> common__product-gap">
165
+ <% include ('product_art_tpl', {
166
+ product: products[i]
167
+ }) %>
168
+ </div>
169
+ <% } %>
170
+ </script>
171
+ {% endunless %}
172
+ </div>
173
+ </div>
174
+ {%capture inline_js_code%}
175
+ {{settings.inline_js_code}}
176
+ $(function () {
177
+ {% assign ajax = false %}
178
+ {% if REQUEST_URI contains "view=ajax" %}
179
+ {% assign ajax = true %}
180
+ {% endif %}
181
+ $(".product-detail-{{ section.id }}").product_detail({section_id:"{{ section.id }}",default_img:"{{ '0745b09b31974decc653e9a927fb444c.jpg' | img_url }}",product:{{ product | json: "description,meta_description,meta_keyword,meta_title,brief" }}, initialSlide: {{initialSlide}}, ajax: {{ajax}} });
182
+ {% unless REQUEST_URI contains "view=ajax" %}
183
+ {% assign count = section.settings.product_number | default: 3 %}
184
+ {% if recommendedProductsPosition and template.type == 1 %}
185
+ var page = 1, per_page = 30, products = [], related_count = {{section.settings.product_number | default: 3}}, enableChangeCount = 10;
186
+ var $section = $('[data-section-id=' + {{section.id}} + ']');
187
+ {% comment %} 获取异步商品 {% endcomment %}
188
+ $.get('/api/product/similar-products?product_id={{product.id}}'+'&page='+page+'&per_page='+per_page, function(res) {
189
+ if (!(res.state == 0 && res.data)) { return ; }
190
+ products = (res.data.products || []).filter(function(item) { return item.published; });
191
+ {% comment %} 可以切换推荐 {% endcomment %}
192
+ products.length > enableChangeCount && $section.find('.relative_product__change').removeClass('d-none');
193
+ {% if shop.env == 0 %}
194
+ $('.relative_product__title')[products.length?"show":"hide"]();
195
+ {% else %}
196
+ if (products.length < related_count) {
197
+ products = products.concat(Array.apply(null, Array(related_count - products.length)).map(function(){ return {
198
+ image: { src: '{{ '0745b09b31974decc653e9a927fb444c.jpg' | img_url }}', width: 100, height: 100 },
199
+ compare_at_price: '99.99',
200
+ price: '88.88',
201
+ available: true,
202
+ published: true,
203
+ isMock: true,
204
+ title: 'Product Title'
205
+ }; }));
206
+ }
207
+ {% endif %}
208
+ var colMd = 'col-md-6';
209
+ var render = function () {
210
+ var count = 0;
211
+ products.length < related_count ? (count = products.length) : (count = related_count);
212
+ $section.find('.relative_product__content').html(window.template('relative-product-art-tpl', {
213
+ products: new Array(count).fill(0).map(function (item, i) {
214
+ return products[((page-1)*related_count+i)%(products.length)];
215
+ }),
216
+ colMd: colMd
217
+ }));
218
+ page+=1;
219
+ };
220
+ render();
221
+ $(document).on('click', '.relative_product__change', render);
222
+ });
223
+ {% endif %}
224
+ {% endunless %}
225
+ });
226
+
227
+ {%endcapture%}
228
+
229
+ {% gassign settings.inline_js_code = inline_js_code %}
230
+ {% javascript %}{{inline_js_code}}{% endjavascript %}
231
+
232
+ {% schema %}
233
+ {
234
+ "name": "product_detail",
235
+ "max_blocks": 10,
236
+ "contentType": [
237
+ "products"
238
+ ],
239
+ "settings": [
240
+ {
241
+ "type": "checkbox",
242
+ "label": {
243
+ "zh-CN": "推荐商品与商品详情并行",
244
+ "en-US": "Recommended products position below description"
245
+ },
246
+ "id": "recommended_products_position",
247
+ "default": false
248
+ },
249
+ {
250
+ "type": "text",
251
+ "id": "relative_title",
252
+ "visibleOn": "recommended_products_position",
253
+ "label": {
254
+ "en-US": "Heading",
255
+ "zh-CN": "标题"
256
+ },
257
+ "default": "You may also like"
258
+ },
259
+ {
260
+ "type": "range",
261
+ "id": "product_number",
262
+ "visibleOn": "recommended_products_position",
263
+ "step": 1,
264
+ "max": 5,
265
+ "min": 2,
266
+ "label": {
267
+ "zh-CN": "商品总数",
268
+ "en-US": "Products number"
269
+ },
270
+ "default": 4,
271
+ "unit": ""
272
+ }
273
+ ],
274
+ "blocks": [
275
+ {
276
+ "type": "@app"
277
+ },
278
+ {
279
+ "type": "vendor",
280
+ "limit": 1,
281
+ "name": {
282
+ "en-US": "vendor",
283
+ "zh-CN": "供应商"
284
+ },
285
+ "settings": []
286
+ },
287
+ {
288
+ "type": "title",
289
+ "limit": 1,
290
+ "name": {
291
+ "en-US": "Title",
292
+ "zh-CN": "标题"
293
+ },
294
+ "settings": [
295
+ {
296
+ "type": "select",
297
+ "label": {
298
+ "zh-CN": "移动端商品标题样式",
299
+ "en-US": "Product title style on mobile"
300
+ },
301
+ "id": "title_style",
302
+ "options": [
303
+ {
304
+ "value": "full",
305
+ "label": {
306
+ "en-US": "Full display",
307
+ "zh-CN": "完全显示"
308
+ }
309
+ },
310
+ {
311
+ "value": "more_hide",
312
+ "label": {
313
+ "zh-CN": "超过一行隐藏",
314
+ "en-US": "Hide more than one line"
315
+ }
316
+ },
317
+ {
318
+ "value": "hide",
319
+ "label": {
320
+ "zh-CN": "隐藏",
321
+ "en-US": "Hide"
322
+ }
323
+ }
324
+ ],
325
+ "default": "full"
326
+ }
327
+ ]
328
+ },
329
+ {
330
+ "type": "sub_title",
331
+ "limit": 1,
332
+ "name": {
333
+ "en-US": "Subtitle",
334
+ "zh-CN": "副标题"
335
+ },
336
+ "settings": []
337
+ },
338
+ {
339
+ "type": "price",
340
+ "limit": 1,
341
+ "name": {
342
+ "en-US": "Price and volume",
343
+ "zh-CN": "价格&销量"
344
+ },
345
+ "settings": []
346
+ },
347
+ {
348
+ "type": "SKU",
349
+ "limit": 1,
350
+ "name": {
351
+ "en-US": "SKU",
352
+ "zh-CN": "SKU"
353
+ },
354
+ "settings": []
355
+ },
356
+ {
357
+ "type": "variant",
358
+ "limit": 1,
359
+ "name": {
360
+ "en-US": "Variant",
361
+ "zh-CN": "变体"
362
+ },
363
+ "settings": []
364
+ },
365
+ {
366
+ "type": "quantity",
367
+ "limit": 1,
368
+ "name": {
369
+ "en-US": "Quantity field",
370
+ "zh-CN": "数量选择器"
371
+ },
372
+ "settings": []
373
+ },
374
+ {
375
+ "type": "checkout",
376
+ "limit": 1,
377
+ "name": {
378
+ "en-US": "Dynamic checkout",
379
+ "zh-CN": "立即购买"
380
+ },
381
+ "settings": [
382
+ {
383
+ "type": "checkbox",
384
+ "label": {
385
+ "en-US": "Show dynamic checkout button",
386
+ "zh-CN": "开启立即购买"
387
+ },
388
+ "id": "dynamic_checkout",
389
+ "default": true
390
+ },
391
+ {
392
+ "type": "checkbox",
393
+ "label": {
394
+ "en-US": "Show ‘Add to cart’ button",
395
+ "zh-CN": "开启加购按钮"
396
+ },
397
+ "id": "add_to_cart",
398
+ "default": true
399
+ },
400
+ {
401
+ "type": "header",
402
+ "content": {
403
+ "zh-CN": "加购信息补充区域",
404
+ "en-US": "Order information area"
405
+ },
406
+ "info": {
407
+ "zh-CN": "可在购买按钮下方添加文字和图片,来增强网站安全感,展示更多服务信息或产品特性等。",
408
+ "en-US": "Add text and images below the checkout button to enhance the security of the site and show more service information or product features."
409
+ }
410
+ },
411
+ {
412
+ "type": "richtext",
413
+ "id": "additional_text",
414
+ "placeholder": {
415
+ "zh-CN": "输入文本内容",
416
+ "en-US": "Input text"
417
+ },
418
+ "label": {
419
+ "en-US": "Text",
420
+ "zh-CN": "文本"
421
+ },
422
+ "default": ""
423
+ },
424
+ {
425
+ "type": "image_picker",
426
+ "id": "additional_image_pc",
427
+ "label": {
428
+ "en-US": "Desktop image",
429
+ "zh-CN": "PC端图片"
430
+ },
431
+ "info": {
432
+ "en-US": "Recommended resolution (width * height): 570*110px",
433
+ "zh-CN": "建议尺寸(宽*高):570*110px"
434
+ },
435
+ "default": ""
436
+ },
437
+ {
438
+ "type": "image_picker",
439
+ "id": "additional_image_mobile",
440
+ "label": {
441
+ "en-US": "Mobile image",
442
+ "zh-CN": "移动端图片"
443
+ },
444
+ "info": {
445
+ "en-US": "Recommended resolution (width * height): 720*220px",
446
+ "zh-CN": "建议尺寸(宽*高):720*220px"
447
+ },
448
+ "default": ""
449
+ }
450
+ ]
451
+ },
452
+ {
453
+ "type": "description_style",
454
+ "limit": 1,
455
+ "name": {
456
+ "en-US": "Description",
457
+ "zh-CN": "描述"
458
+ },
459
+ "settings": [
460
+ {
461
+ "type": "select",
462
+ "label": {
463
+ "zh-CN": "描述风格",
464
+ "en-US": "Description style"
465
+ },
466
+ "id": "description_style",
467
+ "options": [
468
+ {
469
+ "value": "expandable",
470
+ "label": {
471
+ "en-US": "Expandable",
472
+ "zh-CN": "可展开"
473
+ }
474
+ },
475
+ {
476
+ "value": "visible",
477
+ "label": {
478
+ "zh-CN": "一直可见",
479
+ "en-US": "Always visible "
480
+ }
481
+ }
482
+ ],
483
+ "default": "expandable"
484
+ },
485
+ {
486
+ "type": "page",
487
+ "label": {
488
+ "en-US": "Page for tab 1 - select page",
489
+ "zh-CN": "自定义页面1-选择页面"
490
+ },
491
+ "id": "page1"
492
+ },
493
+ {
494
+ "type": "page",
495
+ "label": {
496
+ "en-US": "Page for tab 2 - select page",
497
+ "zh-CN": "自定义页面2-选择页面"
498
+ },
499
+ "id": "page2"
500
+ },
501
+ {
502
+ "type": "page",
503
+ "label": {
504
+ "en-US": "Page for tab 3 - select page",
505
+ "zh-CN": "自定义页面3-选择页面"
506
+ },
507
+ "id": "page3"
508
+ }
509
+ ]
510
+ },
511
+ {
512
+ "type": "sharing",
513
+ "limit": 1,
514
+ "name": {
515
+ "en-US": "Social sharing",
516
+ "zh-CN": "社交分享"
517
+ },
518
+ "settings": [
519
+ {
520
+ "type": "checkbox",
521
+ "label": {
522
+ "en-US": "Share on Facebook",
523
+ "zh-CN": "可分享到facebook"
524
+ },
525
+ "id": "share_facebook",
526
+ "default": true
527
+ },
528
+ {
529
+ "type": "checkbox",
530
+ "label": {
531
+ "en-US": "Tweet on Twitter",
532
+ "zh-CN": "可分享到Twitter"
533
+ },
534
+ "id": "share_twitter",
535
+ "default": true
536
+ },
537
+ {
538
+ "type": "checkbox",
539
+ "label": {
540
+ "en-US": "Pin on Pinterest",
541
+ "zh-CN": "可分享到Pinterest"
542
+ },
543
+ "id": "share_pinterest",
544
+ "default": true
545
+ }
546
+ ]
547
+ }
548
+ ],
549
+ "presets": [
550
+ {
551
+ "name": "product_detail",
552
+ "cname": {
553
+ "zh-CN": "商品详情",
554
+ "en-US": "Product"
555
+ },
556
+ "category": {
557
+ "zh-CN": "基础",
558
+ "en-US": "Basic"
559
+ },
560
+ "ccategory": {
561
+ "zh-CN": "基础",
562
+ "en-US": "Basic"
563
+ },
564
+ "display": false,
565
+ "blocks": [
566
+ {
567
+ "type": "title",
568
+ "settings": {
569
+ "title_style": "full"
570
+ }
571
+ },
572
+ {
573
+ "type": "sub_title",
574
+ "settings": {}
575
+ },
576
+ {
577
+ "type": "price",
578
+ "settings": {}
579
+ },
580
+ {
581
+ "type": "variant",
582
+ "settings": {}
583
+ },
584
+ {
585
+ "type": "quantity",
586
+ "settings": {}
587
+ },
588
+ {
589
+ "type": "checkout",
590
+ "settings": {
591
+ "dynamic_checkout": true,
592
+ "add_to_cart": true,
593
+ "additional_text": "",
594
+ "additional_image_pc": "",
595
+ "additional_image_mobile": ""
596
+ }
597
+ },
598
+ {
599
+ "type": "sharing",
600
+ "settings": {
601
+ "share_facebook": true,
602
+ "share_twitter": true,
603
+ "share_pinterest": true
604
+ }
605
+ }
606
+ ]
607
+ }
608
+ ]
609
+ }
610
+ {% endschema %}
611
+