zz-shopify-components 0.35.1-beta.3 → 0.35.1-beta.4
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/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
{% assign option_type = option_type | default: 'normal' | downcase | strip %}
|
|
2
|
+
|
|
1
3
|
<div
|
|
2
4
|
class='
|
|
3
|
-
{% if
|
|
5
|
+
{% if option_type == 'color' %}
|
|
4
6
|
tw-grid tw-grid-cols-2 tw-gap-6
|
|
5
7
|
{% else %}
|
|
6
8
|
tw-space-y-[16px]
|
|
@@ -49,14 +51,14 @@
|
|
|
49
51
|
{% comment %} 产品示例图 {% endcomment %}
|
|
50
52
|
<div
|
|
51
53
|
class='
|
|
52
|
-
{% if
|
|
54
|
+
{% if option_type == 'color' %}
|
|
53
55
|
tw-flex tw-flex-col tw-space-y-6
|
|
54
56
|
{% else %}
|
|
55
57
|
tw-flex tw-space-x-[24px]
|
|
56
58
|
{% endif %}
|
|
57
59
|
'
|
|
58
60
|
>
|
|
59
|
-
{% if
|
|
61
|
+
{% if option_type == 'color' %}
|
|
60
62
|
<div
|
|
61
63
|
class=' tw-w-[28px] tw-h-[28px] tw-rounded-full !tw-block {% if option.value != 'Black' %} tw-border-[1.5px] {% endif %} tw-border-[#d9d9d9]'
|
|
62
64
|
style='background: {{ option_value.name }}'
|
|
@@ -5,6 +5,22 @@
|
|
|
5
5
|
class=' tw-space-y-[48px]'
|
|
6
6
|
>
|
|
7
7
|
{% for item in product.options_with_values %}
|
|
8
|
+
{% liquid
|
|
9
|
+
assign option_type_key = 'option_' | append: item.position | append: '_type'
|
|
10
|
+
assign option_type = product.metafields.custom[option_type_key].value | default: ''
|
|
11
|
+
|
|
12
|
+
if option_type == blank
|
|
13
|
+
if item.name == 'Version' or item.name contains 'Bundle and save more'
|
|
14
|
+
assign option_type = 'version'
|
|
15
|
+
elsif item.name == 'Color'
|
|
16
|
+
assign option_type = 'color'
|
|
17
|
+
else
|
|
18
|
+
assign option_type = 'normal'
|
|
19
|
+
endif
|
|
20
|
+
endif
|
|
21
|
+
|
|
22
|
+
assign option_type = option_type | downcase | strip
|
|
23
|
+
%}
|
|
8
24
|
<div>
|
|
9
25
|
<div class='tw-flex tw-flex-col tw-items-start tw-justify-between tw-mb-[18px]'>
|
|
10
26
|
<h2 class='tw-font-medium tw-text-black tw-text-[20px]'>
|
|
@@ -12,14 +28,13 @@
|
|
|
12
28
|
</h2>
|
|
13
29
|
</div>
|
|
14
30
|
|
|
15
|
-
{% if
|
|
16
|
-
or item.name contains 'Bundle and save more'
|
|
17
|
-
%}
|
|
31
|
+
{% if option_type == 'version' %}
|
|
18
32
|
<div id='product-version-selector-container'>
|
|
19
33
|
{% render 'zz-version-selector-simple',
|
|
20
34
|
values: item.values,
|
|
21
35
|
position: item.position,
|
|
22
36
|
option_name: item.name,
|
|
37
|
+
option_type: option_type,
|
|
23
38
|
show_basic: show_basic,
|
|
24
39
|
basic_title: basic_title,
|
|
25
40
|
discount_type: discount_type
|
|
@@ -31,11 +46,11 @@
|
|
|
31
46
|
values: item.values,
|
|
32
47
|
position: item.position,
|
|
33
48
|
option_name: item.name,
|
|
34
|
-
|
|
49
|
+
option_type: option_type,
|
|
50
|
+
show_basic: show_basic
|
|
35
51
|
%}
|
|
36
52
|
</div>
|
|
37
53
|
{% endif %}
|
|
38
|
-
|
|
39
54
|
</div>
|
|
40
55
|
{% endfor %}
|
|
41
56
|
</product-buy-now-selector>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
{% assign option_type = option_type | default: 'version' | downcase | strip %}
|
|
2
|
+
|
|
1
3
|
<div class=' tw-space-y-[16px] ' id='product-version-selector'>
|
|
2
4
|
{%- for value_item in values -%}
|
|
3
5
|
{%- if value_item.variant.metafields.custom.basic == true -%}
|
|
@@ -74,9 +76,7 @@
|
|
|
74
76
|
</h3>
|
|
75
77
|
|
|
76
78
|
{% comment %} version 产品信息 {% endcomment %}
|
|
77
|
-
{% if
|
|
78
|
-
or option_name contains 'Bundle and save more'
|
|
79
|
-
%}
|
|
79
|
+
{% if option_type == 'version' %}
|
|
80
80
|
<div class='tw-space-x-2 tw-flex tw-items-center'>
|
|
81
81
|
<span class='tw-font-medium tw-text-[14px] tw-text-black'>
|
|
82
82
|
{%- if show_basic and basic_variant.price != blank -%}
|
|
@@ -117,11 +117,7 @@
|
|
|
117
117
|
{% endif %}
|
|
118
118
|
</div>
|
|
119
119
|
</div>
|
|
120
|
-
|
|
121
|
-
|
|
122
120
|
</label>
|
|
123
|
-
|
|
124
|
-
|
|
125
121
|
</div>
|
|
126
122
|
{% endfor %}
|
|
127
123
|
</div>
|
|
@@ -165,4 +161,3 @@
|
|
|
165
161
|
border-bottom-right-radius: 12px;
|
|
166
162
|
}
|
|
167
163
|
</style>
|
|
168
|
-
|