-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart.liquid
193 lines (183 loc) · 4.64 KB
/
cart.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
{{ "cart.css" | asset_url | stylesheet_tag }}
{%- assign color_scheme = section.settings.color_scheme -%}
{%- assign padding_top = section.settings.padding_top -%}
{%- assign padding_bottom = section.settings.padding_bottom -%}
{%- assign padding_top_mobile = section.settings.padding_top_mobile -%}
{%- assign padding_bottom_mobile = section.settings.padding_bottom_mobile -%}
{% comment %} CSS variables start {% endcomment %}
{%- capture variables -%}
{%- case padding_top -%}
{%- when 'small' -%}
--padding-top: 24px;
{%- when 'medium' -%}
--padding-top: 68px;
{%- when 'large' -%}
--padding-top: 112px;
{%- endcase -%}
{%- case padding_bottom -%}
{%- when 'small' -%}
--padding-bottom: 24px;
{%- when 'medium' -%}
--padding-bottom: 68px;
{%- when 'large' -%}
--padding-bottom: 112px;
{%- endcase -%}
{%- case padding_top_mobile -%}
{%- when 'small' -%}
--padding-top-mobile: 24px;
{%- when 'medium' -%}
--padding-top-mobile: 40px;
{%- when 'large' -%}
--padding-top-mobile: 60px;
{%- endcase -%}
{%- case padding_bottom_mobile -%}
{%- when 'small' -%}
--padding-bottom-mobile: 24px;
{%- when 'medium' -%}
--padding-bottom-mobile: 40px;
{%- when 'large' -%}
--padding-bottom-mobile: 60px;
{%- endcase -%}
{%- endcapture -%}
{%- render 'variables-cart-lines' -%}
{%- render 'variables-cart-services' -%}
{%- render 'variables-cart-totals' -%}
{% comment %} CSS variables end {% endcomment %}
<div class="cart__wrapper color-{{ color_scheme.id }}" style="{{- variables | escape -}}">
<div class="cart__container container{% if padding_top != blank or padding_top_mobile != blank %} cart__container--padding-top{% endif %}{% if padding_bottom != blank or padding_bottom_mobile != blank %} cart__container--padding-bottom{%- endif -%}">
<div class="cart__lines">
{{ cart | lines }}
</div>
<div class="cart__footer">
{{ cart | services }}
{{ cart | totals }}
</div>
</div>
</div>
{% schema %}
{
"name": "Cart",
"description": "Display all necessary information about the cart",
"tag": "section",
"class": "cart",
"settings": [
{
"type": "header",
"content": "General settings"
},
{
"type": "color_scheme",
"id": "color_scheme",
"label": "Color scheme",
"default": "set-1"
},
{
"type": "header",
"content": "Desktop settings"
},
{
"type": "select",
"id": "padding_top",
"label": "Padding top",
"options": [
{
"value": "none",
"label": "None"
},
{
"value": "small",
"label": "Small"
},
{
"value": "medium",
"label": "Medium"
},
{
"value": "large",
"label": "Large"
}
],
"default": "small"
},
{
"type": "select",
"id": "padding_bottom",
"label": "Padding bottom",
"options": [
{
"value": "none",
"label": "None"
},
{
"value": "small",
"label": "Small"
},
{
"value": "medium",
"label": "Medium"
},
{
"value": "large",
"label": "Large"
}
],
"default": "none"
},
{
"type": "header",
"content": "Mobile settings"
},
{
"type": "select",
"id": "padding_top_mobile",
"label": "Padding top",
"options": [
{
"value": "none",
"label": "None"
},
{
"value": "small",
"label": "Small"
},
{
"value": "medium",
"label": "Medium"
},
{
"value": "large",
"label": "Large"
}
],
"default": "small"
},
{
"type": "select",
"id": "padding_bottom_mobile",
"label": "Padding bottom",
"options": [
{
"value": "none",
"label": "None"
},
{
"value": "small",
"label": "Small"
},
{
"value": "medium",
"label": "Medium"
},
{
"value": "large",
"label": "Large"
}
],
"default": "none"
}
],
"templates": ["cart"],
"unique": true,
"important": true
}
{% endschema %}