@o2vend/theme-cli 1.0.37 → 1.0.38
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/lib/lib/dev-server.js +309 -40
- package/lib/lib/liquid-engine.js +3 -1
- package/lib/lib/mock-data.js +36 -124
- package/lib/lib/widget-service.js +12 -4
- package/package.json +1 -1
- package/test-theme/assets/async-sections.js +32 -24
- package/test-theme/assets/cart-drawer.js +20 -22
- package/test-theme/assets/cart-manager.js +1 -15
- package/test-theme/assets/checkout-price-handler.js +12 -11
- package/test-theme/assets/checkout.css +1415 -0
- package/test-theme/assets/checkout.js +3174 -0
- package/test-theme/assets/components.css +178 -29
- package/test-theme/assets/delivery-zone.js +1 -1
- package/test-theme/assets/product-detail.css +1050 -0
- package/test-theme/assets/product-detail.js +2940 -0
- package/test-theme/assets/theme.css +95 -120
- package/test-theme/assets/theme.js +781 -186
- package/test-theme/layout/theme.liquid +91 -17
- package/test-theme/sections/content.liquid +64 -57
- package/test-theme/sections/footer-fallback.liquid +57 -7
- package/test-theme/sections/footer.liquid +63 -12
- package/test-theme/sections/header-fallback.liquid +41 -41
- package/test-theme/sections/header.liquid +41 -51
- package/test-theme/sections/hero-fallback.liquid +1 -1
- package/test-theme/sections/hero.liquid +159 -136
- package/test-theme/snippets/account-sidebar.liquid +121 -29
- package/test-theme/snippets/add-to-cart-modal.liquid +258 -206
- package/test-theme/snippets/breadcrumbs.liquid +98 -11
- package/test-theme/snippets/cart-drawer.liquid +93 -0
- package/test-theme/snippets/delivery-zone-city-selector.liquid +101 -15
- package/test-theme/snippets/delivery-zone-modal.liquid +529 -84
- package/test-theme/snippets/delivery-zone-search.liquid +104 -18
- package/test-theme/snippets/login-modal.liquid +269 -82
- package/test-theme/snippets/mega-menu.liquid +130 -43
- package/test-theme/snippets/news-thumbnail.liquid +120 -28
- package/test-theme/snippets/pagination.liquid +1 -1
- package/test-theme/snippets/price.liquid +100 -9
- package/test-theme/snippets/product-card-related.liquid +22 -4
- package/test-theme/snippets/product-card-simple.liquid +521 -25
- package/test-theme/snippets/product-card.liquid +145 -232
- package/test-theme/snippets/rating.liquid +100 -9
- package/test-theme/snippets/skeleton-collection-grid.liquid +94 -8
- package/test-theme/snippets/skeleton-product-card.liquid +102 -16
- package/test-theme/snippets/skeleton-product-grid.liquid +87 -1
- package/test-theme/snippets/social-sharing.liquid +133 -32
- package/test-theme/templates/account/dashboard.liquid +30 -0
- package/test-theme/templates/account/loyalty-redemption.liquid +29 -28
- package/test-theme/templates/account/loyalty.liquid +45 -43
- package/test-theme/templates/account/order-detail.liquid +15 -8
- package/test-theme/templates/account/orders.liquid +189 -35
- package/test-theme/templates/account/profile.liquid +509 -114
- package/test-theme/templates/account/register.liquid +18 -8
- package/test-theme/templates/account/return-orders.liquid +31 -30
- package/test-theme/templates/account/store-credit.liquid +27 -26
- package/test-theme/templates/account/subscriptions.liquid +22 -5
- package/test-theme/templates/account/wishlist.liquid +88 -19
- package/test-theme/templates/address-book.liquid +166 -69
- package/test-theme/templates/categories.liquid +90 -30
- package/test-theme/templates/checkout.liquid +137 -3834
- package/test-theme/templates/error.liquid +23 -21
- package/test-theme/templates/index.liquid +29 -0
- package/test-theme/templates/login.liquid +33 -6
- package/test-theme/templates/order-confirmation.liquid +67 -9
- package/test-theme/templates/page.liquid +418 -206
- package/test-theme/templates/product-detail.liquid +124 -3878
- package/test-theme/templates/products.liquid +155 -30
- package/test-theme/templates/search.liquid +739 -225
- package/test-theme/widgets/brand-carousel.liquid +102 -82
- package/test-theme/widgets/brand.liquid +78 -50
- package/test-theme/widgets/carousel.liquid +253 -121
- package/test-theme/widgets/category-list-carousel.liquid +32 -8
- package/test-theme/widgets/category-list.liquid +21 -6
- package/test-theme/widgets/category.liquid +104 -37
- package/test-theme/widgets/discount-time.liquid +326 -119
- package/test-theme/widgets/footer-menu.liquid +115 -23
- package/test-theme/widgets/footer.liquid +118 -5
- package/test-theme/widgets/gallery.liquid +29 -5
- package/test-theme/widgets/header-menu.liquid +25 -13
- package/test-theme/widgets/header.liquid +64 -26
- package/test-theme/widgets/html.liquid +29 -6
- package/test-theme/widgets/news.liquid +6 -0
- package/test-theme/widgets/product-canvas.liquid +20 -12
- package/test-theme/widgets/product-carousel.liquid +118 -56
- package/test-theme/widgets/shared/product-grid.liquid +12 -0
- package/test-theme/widgets/single-product.liquid +688 -250
- package/test-theme/widgets/spacebar-carousel.liquid +39 -10
- package/test-theme/widgets/spacebar.liquid +77 -6
- package/test-theme/widgets/splash.liquid +40 -30
- package/test-theme/widgets/testimonial-carousel.liquid +111 -67
|
@@ -95,6 +95,16 @@
|
|
|
95
95
|
</div>
|
|
96
96
|
|
|
97
97
|
<style>
|
|
98
|
+
:root {
|
|
99
|
+
--color-white: #ffffff;
|
|
100
|
+
--color-surface: {{ settings.color_surface | default: '#f5f5f5' }};
|
|
101
|
+
--color-border: {{ settings.color_border | default: '#cccccc' }};
|
|
102
|
+
--color-error-light: {{ settings.color_error | default: '#ef4444' }};
|
|
103
|
+
--color-error: {{ settings.color_error | default: '#ef4444' }};
|
|
104
|
+
--color-error-dark: {{ settings.color_error | default: '#ef4444' }};
|
|
105
|
+
--shadow-sm: var(--shadow-sm);
|
|
106
|
+
}
|
|
107
|
+
|
|
98
108
|
.customer-register {
|
|
99
109
|
min-height: 60vh;
|
|
100
110
|
display: flex;
|
|
@@ -128,10 +138,10 @@
|
|
|
128
138
|
}
|
|
129
139
|
|
|
130
140
|
.customer-register-form-wrapper {
|
|
131
|
-
background:
|
|
141
|
+
background: var(--color-surface);
|
|
132
142
|
padding: 2rem;
|
|
133
143
|
border-radius: 0.5rem;
|
|
134
|
-
box-shadow:
|
|
144
|
+
box-shadow: var(--shadow-sm);
|
|
135
145
|
}
|
|
136
146
|
|
|
137
147
|
.form-group {
|
|
@@ -148,7 +158,7 @@
|
|
|
148
158
|
.form-input {
|
|
149
159
|
width: 100%;
|
|
150
160
|
padding: 0.75rem 1rem;
|
|
151
|
-
border: 1px solid
|
|
161
|
+
border: 1px solid var(--color-border);
|
|
152
162
|
border-radius: 0.375rem;
|
|
153
163
|
font-size: 1rem;
|
|
154
164
|
transition: border-color 0.2s ease;
|
|
@@ -183,15 +193,15 @@
|
|
|
183
193
|
}
|
|
184
194
|
|
|
185
195
|
.form-errors {
|
|
186
|
-
background:
|
|
187
|
-
border: 1px solid
|
|
196
|
+
background: var(--color-error-light);
|
|
197
|
+
border: 1px solid var(--color-error);
|
|
188
198
|
border-radius: 0.375rem;
|
|
189
199
|
padding: 1rem;
|
|
190
200
|
margin-bottom: 1.5rem;
|
|
191
201
|
}
|
|
192
202
|
|
|
193
203
|
.form-error {
|
|
194
|
-
color:
|
|
204
|
+
color: var(--color-error-dark);
|
|
195
205
|
margin: 0;
|
|
196
206
|
font-size: 0.875rem;
|
|
197
207
|
}
|
|
@@ -204,7 +214,7 @@
|
|
|
204
214
|
text-align: center;
|
|
205
215
|
margin-top: 1.5rem;
|
|
206
216
|
padding-top: 1.5rem;
|
|
207
|
-
border-top: 1px solid
|
|
217
|
+
border-top: 1px solid var(--color-border);
|
|
208
218
|
}
|
|
209
219
|
|
|
210
220
|
.customer-register-footer a {
|
|
@@ -218,7 +228,7 @@
|
|
|
218
228
|
</style>
|
|
219
229
|
|
|
220
230
|
<script>
|
|
221
|
-
document.getElementById('customer-register-form')?.addEventListener('submit',
|
|
231
|
+
document.getElementById('customer-register-form')?.addEventListener('submit', (e) => {
|
|
222
232
|
const password = document.getElementById('customer-password-register').value;
|
|
223
233
|
const passwordConfirm = document.getElementById('customer-password-confirm').value;
|
|
224
234
|
|
|
@@ -99,35 +99,36 @@
|
|
|
99
99
|
align-items: center;
|
|
100
100
|
}
|
|
101
101
|
:root {
|
|
102
|
-
--color-primary: #
|
|
103
|
-
--color-primary-hover: #
|
|
104
|
-
--color-primary-light: #
|
|
105
|
-
--color-success: #
|
|
106
|
-
--color-success-light: #
|
|
107
|
-
--color-success-dark: #
|
|
108
|
-
--color-warning: #f59e0b;
|
|
109
|
-
--color-warning-light: #
|
|
110
|
-
--color-warning-dark: #
|
|
111
|
-
--color-danger: #ef4444;
|
|
112
|
-
--color-danger-light: #
|
|
113
|
-
--color-danger-dark: #
|
|
114
|
-
--color-info: #3b82f6;
|
|
115
|
-
--color-info-light: #
|
|
116
|
-
--color-info-dark: #
|
|
117
|
-
--color-text: #
|
|
118
|
-
--color-text-light: #
|
|
119
|
-
--color-background: #
|
|
120
|
-
--color-card-bg: #
|
|
121
|
-
--color-border: #
|
|
122
|
-
--
|
|
123
|
-
--shadow-
|
|
124
|
-
--shadow-
|
|
125
|
-
--
|
|
126
|
-
--radius-
|
|
127
|
-
--
|
|
128
|
-
--spacing-
|
|
129
|
-
--spacing-
|
|
130
|
-
--spacing-
|
|
102
|
+
--color-primary: {{ settings.color_primary | default: '#000000' }};
|
|
103
|
+
--color-primary-hover: {{ settings.color_primary_dark | default: '#333333' }};
|
|
104
|
+
--color-primary-light: {{ settings.color_primary_light | default: '#666666' }};
|
|
105
|
+
--color-success: {{ settings.color_success | default: '#22c55e' }};
|
|
106
|
+
--color-success-light: {{ settings.color_success | default: '#22c55e' }};
|
|
107
|
+
--color-success-dark: {{ settings.color_success | default: '#22c55e' }};
|
|
108
|
+
--color-warning: {{ settings.color_warning | default: '#f59e0b' }};
|
|
109
|
+
--color-warning-light: {{ settings.color_warning | default: '#f59e0b' }};
|
|
110
|
+
--color-warning-dark: {{ settings.color_warning | default: '#f59e0b' }};
|
|
111
|
+
--color-danger: {{ settings.color_error | default: '#ef4444' }};
|
|
112
|
+
--color-danger-light: {{ settings.color_error | default: '#ef4444' }};
|
|
113
|
+
--color-danger-dark: {{ settings.color_error | default: '#ef4444' }};
|
|
114
|
+
--color-info: {{ settings.color_info | default: '#3b82f6' }};
|
|
115
|
+
--color-info-light: {{ settings.color_info | default: '#3b82f6' }};
|
|
116
|
+
--color-info-dark: {{ settings.color_info | default: '#3b82f6' }};
|
|
117
|
+
--color-text: {{ settings.color_text | default: '#000000' }};
|
|
118
|
+
--color-text-light: {{ settings.color_text_light | default: '#999999' }};
|
|
119
|
+
--color-background: {{ settings.color_background | default: '#ffffff' }};
|
|
120
|
+
--color-card-bg: {{ settings.color_surface | default: '#f5f5f5' }};
|
|
121
|
+
--color-border: {{ settings.color_border | default: '#cccccc' }};
|
|
122
|
+
--color-white: #ffffff;
|
|
123
|
+
--shadow-sm: var(--shadow-sm);
|
|
124
|
+
--shadow-md: var(--shadow-md);
|
|
125
|
+
--shadow-lg: var(--shadow-lg);
|
|
126
|
+
--radius-md: var(--radius-lg);
|
|
127
|
+
--radius-lg: var(--radius-xl);
|
|
128
|
+
--spacing-sm: var(--space-4);
|
|
129
|
+
--spacing-md: var(--space-6);
|
|
130
|
+
--spacing-lg: var(--space-8);
|
|
131
|
+
--spacing-xl: var(--space-12);
|
|
131
132
|
}
|
|
132
133
|
|
|
133
134
|
.account-page {
|
|
@@ -222,7 +223,7 @@
|
|
|
222
223
|
align-items: center;
|
|
223
224
|
padding: 1.25rem 1.5rem;
|
|
224
225
|
border-radius: 12px;
|
|
225
|
-
border: 1px solid
|
|
226
|
+
border: 1px solid var(--color-border);
|
|
226
227
|
box-sizing: border-box;
|
|
227
228
|
}
|
|
228
229
|
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
</div>
|
|
94
94
|
<p class="empty-title">No Eligible Orders</p>
|
|
95
95
|
<p class="empty-description">You don't have any orders eligible for return at the moment.</p>
|
|
96
|
-
<a href="/
|
|
96
|
+
<a href="/categories" class="btn btn-primary">Continue Shopping</a>
|
|
97
97
|
</div>
|
|
98
98
|
{% endif %}
|
|
99
99
|
</div>
|
|
@@ -109,28 +109,29 @@
|
|
|
109
109
|
|
|
110
110
|
<style>
|
|
111
111
|
:root {
|
|
112
|
-
--color-primary: #
|
|
113
|
-
--color-primary-hover: #
|
|
114
|
-
--color-primary-light: #
|
|
115
|
-
--color-success: #
|
|
116
|
-
--color-success-light: #
|
|
117
|
-
--color-success-dark: #
|
|
118
|
-
--color-text: #
|
|
119
|
-
--color-text-light: #
|
|
120
|
-
--color-background: #
|
|
121
|
-
--color-card-bg: #
|
|
122
|
-
--color-border: #
|
|
123
|
-
--
|
|
124
|
-
--shadow-
|
|
125
|
-
--shadow-
|
|
126
|
-
--
|
|
127
|
-
--radius-
|
|
128
|
-
--radius-
|
|
129
|
-
--
|
|
130
|
-
--spacing-
|
|
131
|
-
--spacing-
|
|
132
|
-
--spacing-
|
|
133
|
-
--spacing-
|
|
112
|
+
--color-primary: {{ settings.color_primary | default: '#000000' }};
|
|
113
|
+
--color-primary-hover: {{ settings.color_primary_dark | default: '#333333' }};
|
|
114
|
+
--color-primary-light: {{ settings.color_primary_light | default: '#666666' }};
|
|
115
|
+
--color-success: {{ settings.color_success | default: '#22c55e' }};
|
|
116
|
+
--color-success-light: {{ settings.color_success | default: '#22c55e' }};
|
|
117
|
+
--color-success-dark: {{ settings.color_success | default: '#22c55e' }};
|
|
118
|
+
--color-text: {{ settings.color_text | default: '#000000' }};
|
|
119
|
+
--color-text-light: {{ settings.color_text_light | default: '#999999' }};
|
|
120
|
+
--color-background: {{ settings.color_background | default: '#ffffff' }};
|
|
121
|
+
--color-card-bg: {{ settings.color_surface | default: '#f5f5f5' }};
|
|
122
|
+
--color-border: {{ settings.color_border | default: '#cccccc' }};
|
|
123
|
+
--color-white: #ffffff;
|
|
124
|
+
--shadow-sm: var(--shadow-sm);
|
|
125
|
+
--shadow-md: var(--shadow-md);
|
|
126
|
+
--shadow-lg: var(--shadow-lg);
|
|
127
|
+
--radius-sm: var(--radius-md);
|
|
128
|
+
--radius-md: var(--radius-lg);
|
|
129
|
+
--radius-lg: var(--radius-xl);
|
|
130
|
+
--spacing-xs: var(--space-2);
|
|
131
|
+
--spacing-sm: var(--space-4);
|
|
132
|
+
--spacing-md: var(--space-6);
|
|
133
|
+
--spacing-lg: var(--space-8);
|
|
134
|
+
--spacing-xl: var(--space-12);
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
.account-page {
|
|
@@ -209,11 +210,11 @@
|
|
|
209
210
|
}
|
|
210
211
|
|
|
211
212
|
.store-credit-balance {
|
|
212
|
-
background: linear-gradient(135deg, var(--color-success) 0%,
|
|
213
|
+
background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-dark) 100%);
|
|
213
214
|
border-radius: var(--radius-lg);
|
|
214
215
|
padding: var(--spacing-xl);
|
|
215
216
|
text-align: center;
|
|
216
|
-
color: white;
|
|
217
|
+
color: var(--color-white);
|
|
217
218
|
box-shadow: var(--shadow-lg);
|
|
218
219
|
position: relative;
|
|
219
220
|
overflow: hidden;
|
|
@@ -387,7 +388,7 @@
|
|
|
387
388
|
|
|
388
389
|
.btn-primary {
|
|
389
390
|
background: var(--color-primary);
|
|
390
|
-
color: white;
|
|
391
|
+
color: var(--color-white);
|
|
391
392
|
border: 2px solid var(--color-primary);
|
|
392
393
|
}
|
|
393
394
|
|
|
@@ -124,7 +124,24 @@
|
|
|
124
124
|
</div>
|
|
125
125
|
|
|
126
126
|
<style>
|
|
127
|
-
|
|
127
|
+
:root {
|
|
128
|
+
--bg: var(--color-background);
|
|
129
|
+
--card: var(--color-surface);
|
|
130
|
+
--border: var(--color-border);
|
|
131
|
+
--text: var(--color-text);
|
|
132
|
+
--muted: var(--color-text-muted);
|
|
133
|
+
--primary: var(--color-primary);
|
|
134
|
+
--radius: var(--radius-lg);
|
|
135
|
+
--shadow: var(--shadow-md);
|
|
136
|
+
--shadow-xl: var(--shadow-xl);
|
|
137
|
+
--success-bg: var(--color-success-light);
|
|
138
|
+
--success-text: var(--color-success-dark);
|
|
139
|
+
--warning-bg: var(--color-warning-light);
|
|
140
|
+
--warning-text: var(--color-warning-dark);
|
|
141
|
+
--danger-bg: var(--color-error-light);
|
|
142
|
+
--danger-text: var(--color-error-dark);
|
|
143
|
+
--color-white: #ffffff;
|
|
144
|
+
}
|
|
128
145
|
|
|
129
146
|
.account-page {
|
|
130
147
|
background: var(--bg);
|
|
@@ -266,7 +283,7 @@
|
|
|
266
283
|
padding: .5rem 1rem;
|
|
267
284
|
border-radius: 8px;
|
|
268
285
|
border: 1px solid var(--border);
|
|
269
|
-
background: white;
|
|
286
|
+
background: var(--color-white);
|
|
270
287
|
color: var(--text);
|
|
271
288
|
text-decoration: none;
|
|
272
289
|
font-size: 1.4rem;
|
|
@@ -277,7 +294,7 @@
|
|
|
277
294
|
|
|
278
295
|
.btn-outline:hover {
|
|
279
296
|
background: var(--primary);
|
|
280
|
-
color:
|
|
297
|
+
color: var(--color-white);
|
|
281
298
|
border-color: var(--primary);
|
|
282
299
|
}
|
|
283
300
|
|
|
@@ -327,7 +344,7 @@
|
|
|
327
344
|
position: relative;
|
|
328
345
|
background: var(--card);
|
|
329
346
|
border-radius: var(--radius);
|
|
330
|
-
box-shadow:
|
|
347
|
+
box-shadow: var(--shadow-xl);
|
|
331
348
|
max-width: 600px;
|
|
332
349
|
width: 100%;
|
|
333
350
|
max-height: 90vh;
|
|
@@ -593,7 +610,7 @@ function closeFrequencyModal() {
|
|
|
593
610
|
}
|
|
594
611
|
|
|
595
612
|
// Close modal on Escape key
|
|
596
|
-
document.addEventListener('keydown',
|
|
613
|
+
document.addEventListener('keydown', (e) => {
|
|
597
614
|
if (e.key === 'Escape') {
|
|
598
615
|
closeFrequencyModal();
|
|
599
616
|
}
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
{% for item in wishlist.items %}
|
|
30
30
|
<article class="product-card">
|
|
31
31
|
<div class="product-card-image">
|
|
32
|
-
{% if item.
|
|
33
|
-
<img src="{{ item.
|
|
32
|
+
{% if item.productImageUrl %}
|
|
33
|
+
<img src="{{ item.productImageUrl }}" alt="{{ item.productName | default: item.title }}" loading="lazy">
|
|
34
34
|
{% else %}
|
|
35
35
|
<div class="product-placeholder">
|
|
36
36
|
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
</svg>
|
|
41
41
|
</div>
|
|
42
42
|
{% endif %}
|
|
43
|
-
<button class="remove-wishlist-btn" data-item-id="{{ item.
|
|
43
|
+
<button class="remove-wishlist-btn" data-item-id="{{ item.productId }}" title="Remove from wishlist">
|
|
44
44
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
45
45
|
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
46
46
|
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
@@ -49,23 +49,23 @@
|
|
|
49
49
|
</div>
|
|
50
50
|
|
|
51
51
|
<div class="product-card-content">
|
|
52
|
-
<a href="{{ item.
|
|
53
|
-
<h3 class="product-card-title">{{ item.
|
|
52
|
+
<a href="{{ item.url | default: '#' }}" class="product-card-link">
|
|
53
|
+
<h3 class="product-card-title">{{ item.productName | default: item.title }}</h3>
|
|
54
54
|
</a>
|
|
55
55
|
|
|
56
|
-
{% if item.
|
|
56
|
+
{% if item.price %}
|
|
57
57
|
<div class="product-card-price">
|
|
58
|
-
{% if item.
|
|
59
|
-
<span class="price-compare">{{ item.
|
|
60
|
-
<span class="price-current sale">{{ item.
|
|
58
|
+
{% if item.compareAtPrice and item.compareAtPrice > item.price %}
|
|
59
|
+
<span class="price-compare">{{ item.compareAtPrice | money_with_settings: shop.settings }}</span>
|
|
60
|
+
<span class="price-current sale">{{ item.price | money_with_settings: shop.settings }}</span>
|
|
61
61
|
{% else %}
|
|
62
|
-
<span class="price-current">{{ item.
|
|
62
|
+
<span class="price-current">{{ item.price | money_with_settings: shop.settings }}</span>
|
|
63
63
|
{% endif %}
|
|
64
64
|
</div>
|
|
65
65
|
{% endif %}
|
|
66
66
|
|
|
67
|
-
{% if item.
|
|
68
|
-
<button class="btn btn-primary btn-block add-to-cart" data-product-id="{{ item.
|
|
67
|
+
{% if item.isInStock %}
|
|
68
|
+
<button class="btn btn-primary btn-block add-to-cart add-to-cart-btn" data-product-id="{{ item.productId }}">
|
|
69
69
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
70
70
|
<circle cx="9" cy="21" r="1"></circle>
|
|
71
71
|
<circle cx="20" cy="21" r="1"></circle>
|
|
@@ -95,12 +95,81 @@
|
|
|
95
95
|
</div>
|
|
96
96
|
{% hook 'account_wishlist_after' %}
|
|
97
97
|
</div>
|
|
98
|
+
<!-- Pagination -->
|
|
99
|
+
{% include 'snippets/pagination', pagination: pagination %}
|
|
98
100
|
</div>
|
|
99
101
|
</div>
|
|
102
|
+
|
|
103
|
+
<script>
|
|
104
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
105
|
+
document.querySelectorAll('.remove-wishlist-btn').forEach((btn) => {
|
|
106
|
+
if (btn.dataset.wishlistBound === '1') return;
|
|
107
|
+
btn.dataset.wishlistBound = '1';
|
|
108
|
+
|
|
109
|
+
btn.addEventListener('click', async (e) => {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
const productId = btn.getAttribute('data-item-id');
|
|
112
|
+
if (!productId) return;
|
|
113
|
+
|
|
114
|
+
btn.disabled = true;
|
|
115
|
+
const article = btn.closest('article');
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
// Use dedicated remove behavior on account wishlist page.
|
|
119
|
+
// Calling Theme.toggleWishlist here can show the wrong toast because this button
|
|
120
|
+
// does not carry `.in-wishlist` state used by the shared toggle handler.
|
|
121
|
+
const res = await fetch('/webstoreapi/wishlist/toggle', {
|
|
122
|
+
method: 'POST',
|
|
123
|
+
headers: { 'Content-Type': 'application/json', 'X-Requested-With': 'XMLHttpRequest' },
|
|
124
|
+
body: JSON.stringify({ productId: productId })
|
|
125
|
+
});
|
|
126
|
+
const data = await res.json();
|
|
127
|
+
if (!data.success) throw new Error(data.error || data.message || 'Failed to remove from wishlist');
|
|
128
|
+
if (window.Theme && typeof window.Theme.showNotification === 'function') {
|
|
129
|
+
window.Theme.showNotification('Removed from wishlist', 'success');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Remove item from DOM with a small transition
|
|
133
|
+
if (article) {
|
|
134
|
+
article.style.transition = 'opacity 200ms ease';
|
|
135
|
+
article.style.opacity = '0';
|
|
136
|
+
setTimeout(() => {
|
|
137
|
+
if (article && article.parentNode) article.remove();
|
|
138
|
+
|
|
139
|
+
// Update items count
|
|
140
|
+
const countEl = document.querySelector('.items-count');
|
|
141
|
+
if (countEl) {
|
|
142
|
+
const m = countEl.textContent.match(/(\d+)/);
|
|
143
|
+
if (m) {
|
|
144
|
+
let count = Math.max(0, parseInt(m[1], 10) - 1);
|
|
145
|
+
if (count === 0) {
|
|
146
|
+
// reload to show empty state
|
|
147
|
+
window.location.reload();
|
|
148
|
+
} else {
|
|
149
|
+
countEl.textContent = count + ' item' + (count !== 1 ? 's' : '');
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}, 220);
|
|
154
|
+
}
|
|
155
|
+
} catch (err) {
|
|
156
|
+
console.error('[wishlist] remove failed', err);
|
|
157
|
+
if (window.Theme && typeof window.Theme.showNotification === 'function') {
|
|
158
|
+
window.Theme.showNotification('Failed to remove item from wishlist. Please try again.', 'error');
|
|
159
|
+
}
|
|
160
|
+
btn.disabled = false;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
</script>
|
|
100
166
|
</section>
|
|
101
167
|
|
|
102
168
|
<style>
|
|
103
|
-
|
|
169
|
+
:root {
|
|
170
|
+
--color-white: #ffffff;
|
|
171
|
+
--color-danger: {{ settings.color_error | default: '#ef4444' }};
|
|
172
|
+
}
|
|
104
173
|
|
|
105
174
|
.account-page {
|
|
106
175
|
padding: var(--spacing-section) var(--spacing-small);
|
|
@@ -248,7 +317,7 @@
|
|
|
248
317
|
display: flex;
|
|
249
318
|
align-items: center;
|
|
250
319
|
justify-content: center;
|
|
251
|
-
background: white;
|
|
320
|
+
background: var(--color-white);
|
|
252
321
|
border: none;
|
|
253
322
|
border-radius: 50%;
|
|
254
323
|
cursor: pointer;
|
|
@@ -259,7 +328,7 @@
|
|
|
259
328
|
|
|
260
329
|
.remove-wishlist-btn:hover {
|
|
261
330
|
background: var(--color-danger);
|
|
262
|
-
color: white;
|
|
331
|
+
color: var(--color-white);
|
|
263
332
|
transform: scale(1.1);
|
|
264
333
|
}
|
|
265
334
|
|
|
@@ -276,7 +345,7 @@
|
|
|
276
345
|
}
|
|
277
346
|
|
|
278
347
|
.product-card-title {
|
|
279
|
-
font-size:
|
|
348
|
+
font-size: 2rem;
|
|
280
349
|
font-weight: 600;
|
|
281
350
|
color: var(--color-text);
|
|
282
351
|
margin: 0;
|
|
@@ -321,7 +390,7 @@
|
|
|
321
390
|
justify-content: center;
|
|
322
391
|
gap: 0.5rem;
|
|
323
392
|
padding: 0.625rem 1.5rem;
|
|
324
|
-
font-size: 1.
|
|
393
|
+
font-size: 1.6rem;
|
|
325
394
|
font-weight: 500;
|
|
326
395
|
text-decoration: none;
|
|
327
396
|
border-radius: var(--radius-md);
|
|
@@ -333,7 +402,7 @@
|
|
|
333
402
|
|
|
334
403
|
.btn-primary {
|
|
335
404
|
background: var(--color-primary);
|
|
336
|
-
color: white;
|
|
405
|
+
color: var(--color-white);
|
|
337
406
|
border: 2px solid var(--color-primary);
|
|
338
407
|
}
|
|
339
408
|
|
|
@@ -416,4 +485,4 @@
|
|
|
416
485
|
grid-template-columns: 1fr;
|
|
417
486
|
}
|
|
418
487
|
}
|
|
419
|
-
</style>
|
|
488
|
+
</style>
|