@o2vend/theme-cli 1.0.35 → 1.0.37
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 +4 -0
- package/lib/lib/dev-server.js +387 -429
- package/lib/lib/liquid-engine.js +88 -65
- package/lib/lib/liquid-filters.js +10 -29
- package/lib/lib/mock-api-server.js +58 -144
- package/lib/lib/mock-data.js +634 -144
- package/lib/lib/widget-service.js +49 -0
- package/package.json +2 -2
package/lib/lib/mock-data.js
CHANGED
|
@@ -10,29 +10,41 @@
|
|
|
10
10
|
function generateMockData() {
|
|
11
11
|
return {
|
|
12
12
|
store: {
|
|
13
|
-
id:
|
|
13
|
+
id: 1,
|
|
14
|
+
identifier: 'mock-store',
|
|
14
15
|
name: 'My O2VEND Store',
|
|
15
|
-
description: 'A beautiful e-commerce store powered by O2VEND',
|
|
16
16
|
domain: 'localhost:3000',
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
city: 'New York',
|
|
22
|
-
state: 'NY',
|
|
23
|
-
zip: '10001',
|
|
24
|
-
country: 'US'
|
|
25
|
-
},
|
|
17
|
+
companyName: 'My O2VEND Store',
|
|
18
|
+
companyAddress: '123 Main Street, New York, NY 10001',
|
|
19
|
+
companyPhoneNumber: '+1234567890',
|
|
20
|
+
companyEmail: 'store@example.com',
|
|
26
21
|
currency: 'USD',
|
|
27
22
|
currencySymbol: '$',
|
|
28
|
-
locale: 'en-US',
|
|
29
23
|
timezone: 'America/New_York',
|
|
24
|
+
language: 'en',
|
|
25
|
+
logoUrl: '/assets/logo.png',
|
|
26
|
+
favouriteIconUrl: '/favicon.ico',
|
|
30
27
|
settings: {
|
|
28
|
+
currency: 'USD',
|
|
31
29
|
currencySymbol: '$',
|
|
32
30
|
currencyFormat: '#,##0.00',
|
|
33
31
|
currencyDecimalDigits: 2,
|
|
34
32
|
currencyGroupSeparator: ',',
|
|
35
|
-
currencyDecimalSeparator: '.'
|
|
33
|
+
currencyDecimalSeparator: '.',
|
|
34
|
+
currencyGroupSizes: [3],
|
|
35
|
+
deliveryZoneSupport: false,
|
|
36
|
+
deliveryZoneSelection: 0,
|
|
37
|
+
defaultDeliveryZoneZipCode: null,
|
|
38
|
+
loginTypes: null,
|
|
39
|
+
zipcodeSearchEnabled: false,
|
|
40
|
+
referEnabled: false,
|
|
41
|
+
shoppingCartIconType: null,
|
|
42
|
+
timezone: 'America/New_York',
|
|
43
|
+
language: 'en',
|
|
44
|
+
logo: '/assets/logo.png',
|
|
45
|
+
favicon: '/favicon.ico',
|
|
46
|
+
countries: [],
|
|
47
|
+
states: {}
|
|
36
48
|
}
|
|
37
49
|
},
|
|
38
50
|
|
|
@@ -50,8 +62,10 @@ function generateMockData() {
|
|
|
50
62
|
id: 'mock-cart-1',
|
|
51
63
|
items: [],
|
|
52
64
|
total: 0,
|
|
53
|
-
|
|
54
|
-
|
|
65
|
+
subTotal: 0,
|
|
66
|
+
taxAmount: 0,
|
|
67
|
+
shippingAmount: 0,
|
|
68
|
+
itemCount: 0
|
|
55
69
|
}
|
|
56
70
|
};
|
|
57
71
|
}
|
|
@@ -67,21 +81,21 @@ function generateMockProducts(count = 20) {
|
|
|
67
81
|
|
|
68
82
|
// Category mapping - map category names to category IDs (matching generateMockCategories order)
|
|
69
83
|
const categoryMap = {
|
|
70
|
-
'Electronics':
|
|
71
|
-
'Clothing':
|
|
72
|
-
'Accessories':
|
|
73
|
-
'Home & Garden':
|
|
74
|
-
'Home':
|
|
75
|
-
'Sports & Fitness':
|
|
76
|
-
'Sports':
|
|
77
|
-
'Books & Media':
|
|
78
|
-
'Toys & Games':
|
|
79
|
-
'Beauty & Health':
|
|
80
|
-
'Automotive':
|
|
81
|
-
'Food & Beverages':
|
|
82
|
-
'Furniture':
|
|
83
|
-
'Office':
|
|
84
|
-
'Footwear':
|
|
84
|
+
'Electronics': 1,
|
|
85
|
+
'Clothing': 2,
|
|
86
|
+
'Accessories': 3,
|
|
87
|
+
'Home & Garden': 4,
|
|
88
|
+
'Home': 4,
|
|
89
|
+
'Sports & Fitness': 5,
|
|
90
|
+
'Sports': 5,
|
|
91
|
+
'Books & Media': 6,
|
|
92
|
+
'Toys & Games': 7,
|
|
93
|
+
'Beauty & Health': 8,
|
|
94
|
+
'Automotive': 9,
|
|
95
|
+
'Food & Beverages': 10,
|
|
96
|
+
'Furniture': 4,
|
|
97
|
+
'Office': 6,
|
|
98
|
+
'Footwear': 2
|
|
85
99
|
};
|
|
86
100
|
|
|
87
101
|
// Product data with images from picsum.photos (reliable placeholder service)
|
|
@@ -140,7 +154,7 @@ function generateMockProducts(count = 20) {
|
|
|
140
154
|
const productImageId = productTemplate.imageId;
|
|
141
155
|
|
|
142
156
|
// Get categoryId from category name using categoryMap
|
|
143
|
-
const categoryId = categoryMap[productCategory] ||
|
|
157
|
+
const categoryId = categoryMap[productCategory] || 1;
|
|
144
158
|
|
|
145
159
|
// Determine stock quantity - mix of low stock, high stock, and out of stock
|
|
146
160
|
const stockType = i % 5;
|
|
@@ -179,10 +193,10 @@ function generateMockProducts(count = 20) {
|
|
|
179
193
|
const variantPrice = basePrice + (variantIndex % 3 === 0 ? 500 : 0); // Some variants slightly more expensive
|
|
180
194
|
const variantMrp = Math.round(variantPrice * 1.5);
|
|
181
195
|
const variantStock = Math.floor(Math.random() * stock) + (stock > 0 ? 1 : 0);
|
|
182
|
-
const variantProductId = (i + 1) * 1000 + variantIndex;
|
|
196
|
+
const variantProductId = (i + 1) * 1000 + variantIndex;
|
|
183
197
|
variants.push({
|
|
184
198
|
id: `variant-${i + 1}-${variantIndex}`,
|
|
185
|
-
productId: variantProductId,
|
|
199
|
+
productId: variantProductId,
|
|
186
200
|
title: `${size} / ${color}`,
|
|
187
201
|
option1: size,
|
|
188
202
|
option2: color,
|
|
@@ -190,14 +204,15 @@ function generateMockProducts(count = 20) {
|
|
|
190
204
|
option2Name: 'Color',
|
|
191
205
|
price: variantPrice,
|
|
192
206
|
compareAtPrice: variantMrp,
|
|
193
|
-
// prices object required by product-card template
|
|
194
207
|
prices: {
|
|
195
208
|
price: variantPrice,
|
|
196
209
|
mrp: variantMrp
|
|
197
210
|
},
|
|
198
211
|
sku: `SKU-${i + 1}-${size}-${color}`,
|
|
199
212
|
inStock: variantStock > 0,
|
|
200
|
-
|
|
213
|
+
stockQuantity: variantStock,
|
|
214
|
+
stockTrackingIsEnabled: true,
|
|
215
|
+
isAllowToOrder: false,
|
|
201
216
|
available: variantStock > 0
|
|
202
217
|
});
|
|
203
218
|
variantIndex++;
|
|
@@ -206,7 +221,7 @@ function generateMockProducts(count = 20) {
|
|
|
206
221
|
} else if (hasSizeVariations) {
|
|
207
222
|
// Product with size variations only
|
|
208
223
|
sizes.slice(0, 5).forEach((size, idx) => {
|
|
209
|
-
const variantPrice = basePrice + (idx * 200);
|
|
224
|
+
const variantPrice = basePrice + (idx * 200);
|
|
210
225
|
const variantMrp = Math.round(variantPrice * 1.5);
|
|
211
226
|
const variantStock = Math.floor(Math.random() * stock) + (stock > 0 ? 1 : 0);
|
|
212
227
|
const variantProductId = (i + 1) * 1000 + idx + 1;
|
|
@@ -224,14 +239,16 @@ function generateMockProducts(count = 20) {
|
|
|
224
239
|
},
|
|
225
240
|
sku: `SKU-${i + 1}-${size}`,
|
|
226
241
|
inStock: variantStock > 0,
|
|
227
|
-
|
|
242
|
+
stockQuantity: variantStock,
|
|
243
|
+
stockTrackingIsEnabled: true,
|
|
244
|
+
isAllowToOrder: false,
|
|
228
245
|
available: variantStock > 0
|
|
229
246
|
});
|
|
230
247
|
});
|
|
231
248
|
} else if (hasColorVariations) {
|
|
232
249
|
// Product with color variations only
|
|
233
250
|
colors.slice(0, 4).forEach((color, idx) => {
|
|
234
|
-
const variantPrice = basePrice + (idx % 2 === 0 ? 300 : 0);
|
|
251
|
+
const variantPrice = basePrice + (idx % 2 === 0 ? 300 : 0);
|
|
235
252
|
const variantMrp = Math.round(variantPrice * 1.5);
|
|
236
253
|
const variantStock = Math.floor(Math.random() * stock) + (stock > 0 ? 1 : 0);
|
|
237
254
|
const variantProductId = (i + 1) * 1000 + idx + 1;
|
|
@@ -249,7 +266,9 @@ function generateMockProducts(count = 20) {
|
|
|
249
266
|
},
|
|
250
267
|
sku: `SKU-${i + 1}-${color}`,
|
|
251
268
|
inStock: variantStock > 0,
|
|
252
|
-
|
|
269
|
+
stockQuantity: variantStock,
|
|
270
|
+
stockTrackingIsEnabled: true,
|
|
271
|
+
isAllowToOrder: false,
|
|
253
272
|
available: variantStock > 0
|
|
254
273
|
});
|
|
255
274
|
});
|
|
@@ -268,49 +287,44 @@ function generateMockProducts(count = 20) {
|
|
|
268
287
|
},
|
|
269
288
|
sku: `SKU-${i + 1}`,
|
|
270
289
|
inStock: inStock,
|
|
271
|
-
|
|
290
|
+
stockQuantity: stock,
|
|
291
|
+
stockTrackingIsEnabled: true,
|
|
292
|
+
isAllowToOrder: false,
|
|
272
293
|
available: inStock
|
|
273
294
|
});
|
|
274
295
|
}
|
|
275
296
|
|
|
276
|
-
|
|
277
|
-
const totalStock = variants.reduce((sum, v) => sum + (v.stock || 0), 0);
|
|
297
|
+
const totalStock = variants.reduce((sum, v) => sum + (v.stockQuantity || 0), 0);
|
|
278
298
|
const hasAnyStock = variants.some(v => v.inStock || v.available);
|
|
279
299
|
|
|
280
|
-
const productHandle =
|
|
300
|
+
const productHandle = productName.toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, '') + (i > 0 ? `-${i + 1}` : '');
|
|
301
|
+
const productTitle = productName + (i > 0 ? ` ${i + 1}` : '');
|
|
281
302
|
products.push({
|
|
282
|
-
id:
|
|
283
|
-
productId: i + 1,
|
|
284
|
-
title:
|
|
285
|
-
name:
|
|
303
|
+
id: i + 1,
|
|
304
|
+
productId: i + 1,
|
|
305
|
+
title: productTitle,
|
|
306
|
+
name: productTitle,
|
|
286
307
|
handle: productHandle,
|
|
287
308
|
slug: productHandle,
|
|
288
|
-
url:
|
|
289
|
-
link:
|
|
309
|
+
url: productHandle,
|
|
310
|
+
link: productHandle,
|
|
290
311
|
description: `Description for ${productName}. High quality product with excellent features.${hasVariations ? ' Available in multiple options.' : ''}`,
|
|
291
312
|
price: basePrice,
|
|
292
313
|
compareAtPrice: comparePrice,
|
|
293
|
-
// Prices object used by product-card snippet
|
|
294
314
|
prices: {
|
|
295
315
|
price: basePrice,
|
|
296
|
-
mrp: comparePrice
|
|
297
|
-
currency: 'USD'
|
|
316
|
+
mrp: comparePrice
|
|
298
317
|
},
|
|
299
|
-
discountPercentage: Math.floor(((comparePrice - basePrice) / comparePrice) * 100),
|
|
300
|
-
currency: 'USD',
|
|
301
318
|
inStock: hasAnyStock,
|
|
302
|
-
available: hasAnyStock,
|
|
303
|
-
|
|
304
|
-
|
|
319
|
+
available: hasAnyStock,
|
|
320
|
+
stockQuantity: totalStock,
|
|
321
|
+
stockTrackingIsEnabled: true,
|
|
322
|
+
isAllowToOrder: false,
|
|
305
323
|
sku: `SKU-${i + 1}`,
|
|
306
|
-
categoryId: categoryId,
|
|
307
|
-
category:
|
|
308
|
-
brandId:
|
|
309
|
-
|
|
310
|
-
thumbnailImage1: {
|
|
311
|
-
url: `https://picsum.photos/seed/${productImageId}/800/800`,
|
|
312
|
-
altText: productName
|
|
313
|
-
},
|
|
324
|
+
categoryId: categoryId,
|
|
325
|
+
category: { id: categoryId, name: productCategory },
|
|
326
|
+
brandId: (i % 8) + 1,
|
|
327
|
+
thumbnailImage: `https://picsum.photos/seed/${productImageId}/800/800`,
|
|
314
328
|
imageUrl: `https://picsum.photos/seed/${productImageId}/800/800`,
|
|
315
329
|
images: [
|
|
316
330
|
{
|
|
@@ -351,23 +365,235 @@ function generateMockProducts(count = 20) {
|
|
|
351
365
|
: [],
|
|
352
366
|
tags: ['featured', 'new', 'sale'],
|
|
353
367
|
createdAt: new Date(Date.now() - Math.random() * 365 * 24 * 60 * 60 * 1000).toISOString(),
|
|
354
|
-
|
|
355
|
-
productType: 0, // 0 = simple product, 1 = variable, 2 = subscription
|
|
356
|
-
// additionalData uses | default:null without | json, so we use string 'null'
|
|
357
|
-
// This outputs as literal null in JSON (without quotes)
|
|
368
|
+
productType: 0,
|
|
358
369
|
additionalData: 'null',
|
|
359
|
-
// These fields use | json filter, so they should be actual arrays
|
|
360
370
|
combinations: [],
|
|
361
371
|
subscriptions: [],
|
|
362
372
|
shippingMethods: [],
|
|
363
|
-
variations: variants
|
|
373
|
+
variations: variants
|
|
364
374
|
});
|
|
365
375
|
}
|
|
366
376
|
|
|
377
|
+
// Variation product with production-style options structure
|
|
378
|
+
const variationProductId = products.length + 1;
|
|
379
|
+
const variationVariants = [
|
|
380
|
+
{
|
|
381
|
+
id: `variant-var-1`, productId: variationProductId * 1000 + 1, name: 'Wireless Headphones - Black / Standard',
|
|
382
|
+
sku: 'WH-BLK-STD', title: 'Black / Standard',
|
|
383
|
+
prices: { price: 7999, mrp: 9999 }, price: 7999, compareAtPrice: 9999,
|
|
384
|
+
options: [
|
|
385
|
+
{ id: 1, optionId: 1, optionName: 'Color', value: 'Black', displayType: 'color', displayValue: '#000000', sortIndex: 1 },
|
|
386
|
+
{ id: 2, optionId: 2, optionName: 'Edition', value: 'Standard', displayType: 'text', displayValue: '', sortIndex: 1 }
|
|
387
|
+
],
|
|
388
|
+
images: [{ url: 'https://picsum.photos/seed/wh-black/800/800', altText: 'Wireless Headphones Black' }],
|
|
389
|
+
inStock: true, available: true, stockQuantity: 25
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
id: `variant-var-2`, productId: variationProductId * 1000 + 2, name: 'Wireless Headphones - Black / Pro',
|
|
393
|
+
sku: 'WH-BLK-PRO', title: 'Black / Pro',
|
|
394
|
+
prices: { price: 11999, mrp: 14999 }, price: 11999, compareAtPrice: 14999,
|
|
395
|
+
options: [
|
|
396
|
+
{ id: 3, optionId: 1, optionName: 'Color', value: 'Black', displayType: 'color', displayValue: '#000000', sortIndex: 1 },
|
|
397
|
+
{ id: 4, optionId: 2, optionName: 'Edition', value: 'Pro', displayType: 'text', displayValue: '', sortIndex: 2 }
|
|
398
|
+
],
|
|
399
|
+
images: [{ url: 'https://picsum.photos/seed/wh-black-pro/800/800', altText: 'Wireless Headphones Black Pro' }],
|
|
400
|
+
inStock: true, available: true, stockQuantity: 15
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
id: `variant-var-3`, productId: variationProductId * 1000 + 3, name: 'Wireless Headphones - White / Standard',
|
|
404
|
+
sku: 'WH-WHT-STD', title: 'White / Standard',
|
|
405
|
+
prices: { price: 7999, mrp: 9999 }, price: 7999, compareAtPrice: 9999,
|
|
406
|
+
options: [
|
|
407
|
+
{ id: 5, optionId: 1, optionName: 'Color', value: 'White', displayType: 'color', displayValue: '#ffffff', sortIndex: 2 },
|
|
408
|
+
{ id: 6, optionId: 2, optionName: 'Edition', value: 'Standard', displayType: 'text', displayValue: '', sortIndex: 1 }
|
|
409
|
+
],
|
|
410
|
+
images: [{ url: 'https://picsum.photos/seed/wh-white/800/800', altText: 'Wireless Headphones White' }],
|
|
411
|
+
inStock: true, available: true, stockQuantity: 20
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
id: `variant-var-4`, productId: variationProductId * 1000 + 4, name: 'Wireless Headphones - Silver / Pro',
|
|
415
|
+
sku: 'WH-SLV-PRO', title: 'Silver / Pro',
|
|
416
|
+
prices: { price: 12999, mrp: 15999 }, price: 12999, compareAtPrice: 15999,
|
|
417
|
+
options: [
|
|
418
|
+
{ id: 7, optionId: 1, optionName: 'Color', value: 'Silver', displayType: 'color', displayValue: '#c0c0c0', sortIndex: 3 },
|
|
419
|
+
{ id: 8, optionId: 2, optionName: 'Edition', value: 'Pro', displayType: 'text', displayValue: '', sortIndex: 2 }
|
|
420
|
+
],
|
|
421
|
+
images: [{ url: 'https://picsum.photos/seed/wh-silver-pro/800/800', altText: 'Wireless Headphones Silver Pro' }],
|
|
422
|
+
inStock: false, available: false, stockQuantity: 0
|
|
423
|
+
}
|
|
424
|
+
];
|
|
425
|
+
products.push({
|
|
426
|
+
id: variationProductId, productId: variationProductId,
|
|
427
|
+
title: 'Wireless Noise-Cancelling Headphones', name: 'Wireless Noise-Cancelling Headphones',
|
|
428
|
+
handle: 'wireless-noise-cancelling-headphones', slug: 'wireless-noise-cancelling-headphones',
|
|
429
|
+
url: 'wireless-noise-cancelling-headphones', link: 'wireless-noise-cancelling-headphones',
|
|
430
|
+
description: 'Premium wireless headphones with active noise cancellation. Available in multiple colors and editions.',
|
|
431
|
+
price: 7999, compareAtPrice: 9999, prices: { price: 7999, mrp: 9999 },
|
|
432
|
+
inStock: true, available: true, stockQuantity: 60, stockTrackingIsEnabled: true, isAllowToOrder: false,
|
|
433
|
+
sku: 'WH-MAIN', categoryId: 1, category: { id: 1, name: 'Electronics' }, brandId: 1,
|
|
434
|
+
thumbnailImage: 'https://picsum.photos/seed/wh-main/800/800',
|
|
435
|
+
imageUrl: 'https://picsum.photos/seed/wh-main/800/800',
|
|
436
|
+
images: [
|
|
437
|
+
{ id: 'img-var-1', url: 'https://picsum.photos/seed/wh-main/800/800', altText: 'Wireless Headphones' },
|
|
438
|
+
{ id: 'img-var-2', url: 'https://picsum.photos/seed/wh-side/800/800', altText: 'Wireless Headphones Side View' },
|
|
439
|
+
{ id: 'img-var-3', url: 'https://picsum.photos/seed/wh-case/800/800', altText: 'Wireless Headphones with Case' }
|
|
440
|
+
],
|
|
441
|
+
variants: variationVariants, variations: variationVariants,
|
|
442
|
+
options: [
|
|
443
|
+
{ name: 'Color', values: ['Black', 'White', 'Silver'] },
|
|
444
|
+
{ name: 'Edition', values: ['Standard', 'Pro'] }
|
|
445
|
+
],
|
|
446
|
+
tags: ['featured', 'electronics', 'audio'], productType: 0, additionalData: 'null',
|
|
447
|
+
combinations: [], subscriptions: [], shippingMethods: [],
|
|
448
|
+
createdAt: new Date(Date.now() - 10 * 24 * 60 * 60 * 1000).toISOString()
|
|
449
|
+
});
|
|
450
|
+
|
|
451
|
+
// Combination product with group-based add-ons
|
|
452
|
+
const comboProductId = products.length + 1;
|
|
453
|
+
products.push({
|
|
454
|
+
id: comboProductId, productId: comboProductId,
|
|
455
|
+
title: 'Gaming Console Bundle', name: 'Gaming Console Bundle',
|
|
456
|
+
handle: 'gaming-console-bundle', slug: 'gaming-console-bundle',
|
|
457
|
+
url: 'gaming-console-bundle', link: 'gaming-console-bundle',
|
|
458
|
+
description: 'Next-gen gaming console with customizable accessories bundle. Choose your controller, headset, and games.',
|
|
459
|
+
price: 49999, compareAtPrice: 59999, prices: { price: 49999, mrp: 59999 },
|
|
460
|
+
inStock: true, available: true, stockQuantity: 30, stockTrackingIsEnabled: true, isAllowToOrder: false,
|
|
461
|
+
sku: 'GCB-MAIN', categoryId: 1, category: { id: 1, name: 'Electronics' }, brandId: 2,
|
|
462
|
+
thumbnailImage: 'https://picsum.photos/seed/gcb-main/800/800',
|
|
463
|
+
imageUrl: 'https://picsum.photos/seed/gcb-main/800/800',
|
|
464
|
+
images: [
|
|
465
|
+
{ id: 'img-combo-1', url: 'https://picsum.photos/seed/gcb-main/800/800', altText: 'Gaming Console Bundle' },
|
|
466
|
+
{ id: 'img-combo-2', url: 'https://picsum.photos/seed/gcb-box/800/800', altText: 'Gaming Console Box Contents' }
|
|
467
|
+
],
|
|
468
|
+
variants: [{ id: 'variant-combo-1', productId: comboProductId * 1000 + 1, title: 'Default', price: 49999, compareAtPrice: 59999, prices: { price: 49999, mrp: 59999 }, sku: 'GCB-DEF', inStock: true, available: true, stockQuantity: 30 }],
|
|
469
|
+
variations: [],
|
|
470
|
+
options: [],
|
|
471
|
+
combinations: [
|
|
472
|
+
{
|
|
473
|
+
productId: comboProductId * 100 + 1, name: 'Extra Wireless Controller', sku: 'GCB-CTRL',
|
|
474
|
+
prices: { price: 5999, mrp: 6999 }, quantity: 1,
|
|
475
|
+
group: { groupDetail: { groupName: 'Controllers', groupType: 1, minimumSelectable: 0, maximumSelectable: 2, isOptional: true } },
|
|
476
|
+
thumbnailImage1: { url: 'https://picsum.photos/seed/gcb-ctrl/200/200' },
|
|
477
|
+
images: [{ url: 'https://picsum.photos/seed/gcb-ctrl/400/400' }],
|
|
478
|
+
additionalData: null
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
productId: comboProductId * 100 + 2, name: 'Pro Controller (Elite)', sku: 'GCB-CTRL-PRO',
|
|
482
|
+
prices: { price: 12999, mrp: 14999 }, quantity: 1,
|
|
483
|
+
group: { groupDetail: { groupName: 'Controllers', groupType: 1, minimumSelectable: 0, maximumSelectable: 2, isOptional: true } },
|
|
484
|
+
thumbnailImage1: { url: 'https://picsum.photos/seed/gcb-ctrl-pro/200/200' },
|
|
485
|
+
images: [{ url: 'https://picsum.photos/seed/gcb-ctrl-pro/400/400' }],
|
|
486
|
+
additionalData: null
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
productId: comboProductId * 100 + 3, name: 'Gaming Headset 7.1', sku: 'GCB-HS',
|
|
490
|
+
prices: { price: 7999, mrp: 9999 }, quantity: 1,
|
|
491
|
+
group: { groupDetail: { groupName: 'Audio', groupType: 1, minimumSelectable: 1, maximumSelectable: 1, isOptional: false } },
|
|
492
|
+
thumbnailImage1: { url: 'https://picsum.photos/seed/gcb-headset/200/200' },
|
|
493
|
+
images: [{ url: 'https://picsum.photos/seed/gcb-headset/400/400' }],
|
|
494
|
+
additionalData: null
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
productId: comboProductId * 100 + 4, name: 'Racing Game Deluxe', sku: 'GCB-GAME1',
|
|
498
|
+
prices: { price: 3999, mrp: 4999 }, quantity: 1,
|
|
499
|
+
group: { groupDetail: { groupName: 'Games', groupType: 1, minimumSelectable: 1, maximumSelectable: 3, isOptional: false } },
|
|
500
|
+
thumbnailImage1: { url: 'https://picsum.photos/seed/gcb-game1/200/200' },
|
|
501
|
+
images: [{ url: 'https://picsum.photos/seed/gcb-game1/400/400' }],
|
|
502
|
+
additionalData: null
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
productId: comboProductId * 100 + 5, name: 'Adventure Quest RPG', sku: 'GCB-GAME2',
|
|
506
|
+
prices: { price: 4999, mrp: 5999 }, quantity: 1,
|
|
507
|
+
group: { groupDetail: { groupName: 'Games', groupType: 1, minimumSelectable: 1, maximumSelectable: 3, isOptional: false } },
|
|
508
|
+
thumbnailImage1: { url: 'https://picsum.photos/seed/gcb-game2/200/200' },
|
|
509
|
+
images: [{ url: 'https://picsum.photos/seed/gcb-game2/400/400' }],
|
|
510
|
+
additionalData: null
|
|
511
|
+
}
|
|
512
|
+
],
|
|
513
|
+
subscriptions: [],
|
|
514
|
+
tags: ['featured', 'electronics', 'gaming', 'bundle'], productType: 0,
|
|
515
|
+
additionalData: 'null', shippingMethods: [],
|
|
516
|
+
createdAt: new Date(Date.now() - 5 * 24 * 60 * 60 * 1000).toISOString()
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
// Subscription product
|
|
520
|
+
const subProductId = products.length + 1;
|
|
521
|
+
const subscriptionAdditionalData = JSON.stringify({
|
|
522
|
+
settings: {
|
|
523
|
+
isScheduleByCustomer: true, typeOfOrder: 10, shippingClassId: 1,
|
|
524
|
+
perOrderPrice: 1999, startDate: new Date().toISOString(),
|
|
525
|
+
endDate: new Date(Date.now() + 365 * 24 * 60 * 60 * 1000).toISOString(),
|
|
526
|
+
isProductChoiceEnabled: false, isQuantityChangeAllowed: true,
|
|
527
|
+
minSubscriptionProducts: 1, maxSubscriptionProducts: 5
|
|
528
|
+
},
|
|
529
|
+
subscriptionDetails: {
|
|
530
|
+
shippingFeeAmount: 0, paymentFeeAmount: 0, roundOff: 0,
|
|
531
|
+
discountAmount: 500, subscriptionCoupon: null, orderTotal: '1999'
|
|
532
|
+
},
|
|
533
|
+
frequency: { selectedOption: 'monthly', timeFre: '', ordersCount: 12 },
|
|
534
|
+
frequencyData: {
|
|
535
|
+
selectedOption: 'monthly', ordersCount: 12,
|
|
536
|
+
startDate: new Date().toISOString(),
|
|
537
|
+
endDate: new Date(Date.now() + 365 * 24 * 60 * 60 * 1000).toISOString(),
|
|
538
|
+
isDailyFrequency: true, isWeeklyFrequency: true,
|
|
539
|
+
isAlterNativeFrequency: false, isMonthlyFrequency: true, isYearlyFrequency: false
|
|
540
|
+
},
|
|
541
|
+
IsSubscriptionPrice: true,
|
|
542
|
+
items: [
|
|
543
|
+
{ Id: 1, Name: 'Organic Coffee Blend - 250g', Price: 1999, Quantity: 1 },
|
|
544
|
+
{ Id: 2, Name: 'Single Origin Ethiopian - 250g', Price: 2499, Quantity: 1 },
|
|
545
|
+
{ Id: 3, Name: 'Dark Roast Espresso - 250g', Price: 1799, Quantity: 1 }
|
|
546
|
+
]
|
|
547
|
+
});
|
|
548
|
+
products.push({
|
|
549
|
+
id: subProductId, productId: subProductId,
|
|
550
|
+
title: 'Premium Coffee Subscription Box', name: 'Premium Coffee Subscription Box',
|
|
551
|
+
handle: 'premium-coffee-subscription', slug: 'premium-coffee-subscription',
|
|
552
|
+
url: 'premium-coffee-subscription', link: 'premium-coffee-subscription',
|
|
553
|
+
description: 'Get freshly roasted premium coffee delivered to your door. Choose your frequency and customize your selection.',
|
|
554
|
+
price: 1999, compareAtPrice: 2499, prices: { price: 1999, mrp: 2499 },
|
|
555
|
+
inStock: true, available: true, stockQuantity: 999, stockTrackingIsEnabled: false, isAllowToOrder: true,
|
|
556
|
+
sku: 'SUB-COFFEE', categoryId: 10, category: { id: 10, name: 'Food & Beverages' }, brandId: 5,
|
|
557
|
+
thumbnailImage: 'https://picsum.photos/seed/sub-coffee/800/800',
|
|
558
|
+
imageUrl: 'https://picsum.photos/seed/sub-coffee/800/800',
|
|
559
|
+
images: [
|
|
560
|
+
{ id: 'img-sub-1', url: 'https://picsum.photos/seed/sub-coffee/800/800', altText: 'Coffee Subscription Box' },
|
|
561
|
+
{ id: 'img-sub-2', url: 'https://picsum.photos/seed/sub-beans/800/800', altText: 'Premium Coffee Beans' },
|
|
562
|
+
{ id: 'img-sub-3', url: 'https://picsum.photos/seed/sub-cup/800/800', altText: 'Fresh Brewed Coffee' }
|
|
563
|
+
],
|
|
564
|
+
variants: [{ id: 'variant-sub-1', productId: subProductId * 1000 + 1, title: 'Monthly Box', price: 1999, compareAtPrice: 2499, prices: { price: 1999, mrp: 2499 }, sku: 'SUB-COFFEE-M', inStock: true, available: true, stockQuantity: 999 }],
|
|
565
|
+
variations: [],
|
|
566
|
+
options: [],
|
|
567
|
+
combinations: [],
|
|
568
|
+
subscriptions: [
|
|
569
|
+
{
|
|
570
|
+
productId: subProductId * 100 + 1, name: 'Organic Coffee Blend - 250g', sku: 'SUB-BLEND',
|
|
571
|
+
prices: { price: 1999, mrp: 2499 }, quantity: 1,
|
|
572
|
+
specification: 'Premium organic blend, medium roast',
|
|
573
|
+
images: [{ url: 'https://picsum.photos/seed/sub-blend/400/400' }], additionalData: null
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
productId: subProductId * 100 + 2, name: 'Single Origin Ethiopian - 250g', sku: 'SUB-ETHIOP',
|
|
577
|
+
prices: { price: 2499, mrp: 2999 }, quantity: 1,
|
|
578
|
+
specification: 'Light roast, fruity notes',
|
|
579
|
+
images: [{ url: 'https://picsum.photos/seed/sub-ethiop/400/400' }], additionalData: null
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
productId: subProductId * 100 + 3, name: 'Dark Roast Espresso - 250g', sku: 'SUB-ESPRESSO',
|
|
583
|
+
prices: { price: 1799, mrp: 2199 }, quantity: 1,
|
|
584
|
+
specification: 'Bold and intense espresso blend',
|
|
585
|
+
images: [{ url: 'https://picsum.photos/seed/sub-espresso/400/400' }], additionalData: null
|
|
586
|
+
}
|
|
587
|
+
],
|
|
588
|
+
tags: ['subscription', 'coffee', 'food'], productType: 90,
|
|
589
|
+
additionalData: subscriptionAdditionalData, shippingMethods: [],
|
|
590
|
+
createdAt: new Date(Date.now() - 3 * 24 * 60 * 60 * 1000).toISOString()
|
|
591
|
+
});
|
|
592
|
+
|
|
367
593
|
// Log summary
|
|
368
594
|
const productsWithVariations = products.filter(p => (p.variants?.length || 0) > 1).length;
|
|
369
595
|
const productsWithOptions = products.filter(p => (p.options?.length || 0) > 0).length;
|
|
370
|
-
const outOfStock = products.filter(p => !p.inStock || (p.
|
|
596
|
+
const outOfStock = products.filter(p => !p.inStock || (p.stockQuantity || 0) === 0).length;
|
|
371
597
|
|
|
372
598
|
// Log category distribution
|
|
373
599
|
const categoryDistribution = {};
|
|
@@ -410,14 +636,24 @@ function generateMockCategories(count = 10) {
|
|
|
410
636
|
|
|
411
637
|
for (let i = 0; i < count; i++) {
|
|
412
638
|
const catData = categoryData[i] || { name: `Category ${i + 1}`, imageId: 60 + i, description: `Products in Category ${i + 1}` };
|
|
639
|
+
const catHandle = catData.name.toLowerCase().replace(/\s+/g, '-').replace(/&/g, 'and');
|
|
640
|
+
const catImageUrl = `https://picsum.photos/seed/cat${catData.imageId}/400/300`;
|
|
413
641
|
categories.push({
|
|
414
|
-
id:
|
|
642
|
+
id: i + 1,
|
|
643
|
+
categoryId: i + 1,
|
|
415
644
|
name: catData.name,
|
|
416
|
-
|
|
645
|
+
displayName: catData.name,
|
|
646
|
+
handle: catHandle,
|
|
647
|
+
slug: catHandle,
|
|
417
648
|
description: catData.description,
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
649
|
+
thumbnailImage: { url: catImageUrl },
|
|
650
|
+
bannerImage: { url: catImageUrl },
|
|
651
|
+
menuImage: { url: catImageUrl },
|
|
652
|
+
displayOrder: i + 1,
|
|
653
|
+
parentCategoryId: i > 5 ? Math.floor(Math.random() * 5) + 1 : null,
|
|
654
|
+
parentName: i > 5 ? categoryData[Math.floor(Math.random() * 5)]?.name || null : null,
|
|
655
|
+
products: [],
|
|
656
|
+
productsCount: Math.floor(Math.random() * 50) + 5
|
|
421
657
|
});
|
|
422
658
|
}
|
|
423
659
|
|
|
@@ -447,9 +683,11 @@ function generateMockBrands(count = 10) {
|
|
|
447
683
|
for (let i = 0; i < count; i++) {
|
|
448
684
|
const brand = brandData[i] || { name: `Brand ${i + 1}`, tagline: 'Quality Products', imageId: 80 + i };
|
|
449
685
|
brands.push({
|
|
450
|
-
id:
|
|
686
|
+
id: i + 1,
|
|
687
|
+
brandId: i + 1,
|
|
451
688
|
name: brand.name,
|
|
452
689
|
handle: brand.name.toLowerCase().replace(/\s+/g, '-'),
|
|
690
|
+
slug: brand.name.toLowerCase().replace(/\s+/g, '-'),
|
|
453
691
|
description: `${brand.tagline}. Premium products from ${brand.name}`,
|
|
454
692
|
logo: `https://picsum.photos/seed/brand${brand.imageId}/200/100`,
|
|
455
693
|
image: `https://picsum.photos/seed/brand${brand.imageId}/400/200`,
|
|
@@ -473,6 +711,7 @@ function generateMockWidgets() {
|
|
|
473
711
|
type: 'Header',
|
|
474
712
|
section: 'header',
|
|
475
713
|
sectionName: 'header',
|
|
714
|
+
pageId: 'all',
|
|
476
715
|
status: 'active',
|
|
477
716
|
Position: 1,
|
|
478
717
|
settings: {
|
|
@@ -494,6 +733,7 @@ function generateMockWidgets() {
|
|
|
494
733
|
type: 'HeaderMenu',
|
|
495
734
|
section: 'header',
|
|
496
735
|
sectionName: 'header',
|
|
736
|
+
pageId: 'all',
|
|
497
737
|
status: 'active',
|
|
498
738
|
Position: 2,
|
|
499
739
|
settings: {
|
|
@@ -514,6 +754,7 @@ function generateMockWidgets() {
|
|
|
514
754
|
type: 'Carousel',
|
|
515
755
|
section: 'hero',
|
|
516
756
|
sectionName: 'hero',
|
|
757
|
+
pageId: 'home',
|
|
517
758
|
status: 'active',
|
|
518
759
|
Position: 1,
|
|
519
760
|
settings: {
|
|
@@ -584,6 +825,7 @@ function generateMockWidgets() {
|
|
|
584
825
|
type: 'SpaceBar',
|
|
585
826
|
section: 'hero',
|
|
586
827
|
sectionName: 'hero',
|
|
828
|
+
pageId: 'home',
|
|
587
829
|
status: 'active',
|
|
588
830
|
Position: 2,
|
|
589
831
|
settings: {
|
|
@@ -654,6 +896,7 @@ function generateMockWidgets() {
|
|
|
654
896
|
type: 'CategoryList',
|
|
655
897
|
section: 'content',
|
|
656
898
|
sectionName: 'content',
|
|
899
|
+
pageId: 'home',
|
|
657
900
|
status: 'active',
|
|
658
901
|
Position: 1,
|
|
659
902
|
Title: 'Shop by Category',
|
|
@@ -701,6 +944,7 @@ function generateMockWidgets() {
|
|
|
701
944
|
type: 'ProductCarousel',
|
|
702
945
|
section: 'content',
|
|
703
946
|
sectionName: 'content',
|
|
947
|
+
pageId: 'home',
|
|
704
948
|
status: 'active',
|
|
705
949
|
Position: 2,
|
|
706
950
|
Title: 'Featured Products',
|
|
@@ -739,6 +983,7 @@ function generateMockWidgets() {
|
|
|
739
983
|
type: 'ProductCarousel',
|
|
740
984
|
section: 'content',
|
|
741
985
|
sectionName: 'content',
|
|
986
|
+
pageId: 'home',
|
|
742
987
|
status: 'active',
|
|
743
988
|
Position: 3,
|
|
744
989
|
Title: 'Best Sellers',
|
|
@@ -775,6 +1020,7 @@ function generateMockWidgets() {
|
|
|
775
1020
|
type: 'ProductCarousel',
|
|
776
1021
|
section: 'content',
|
|
777
1022
|
sectionName: 'content',
|
|
1023
|
+
pageId: 'home',
|
|
778
1024
|
status: 'active',
|
|
779
1025
|
Position: 4,
|
|
780
1026
|
Title: 'New Arrivals',
|
|
@@ -810,6 +1056,7 @@ function generateMockWidgets() {
|
|
|
810
1056
|
type: 'ProductCarousel',
|
|
811
1057
|
section: 'content',
|
|
812
1058
|
sectionName: 'content',
|
|
1059
|
+
pageId: 'home',
|
|
813
1060
|
status: 'active',
|
|
814
1061
|
Position: 5,
|
|
815
1062
|
Title: 'On Sale',
|
|
@@ -847,6 +1094,7 @@ function generateMockWidgets() {
|
|
|
847
1094
|
type: 'ProductCarousel',
|
|
848
1095
|
section: 'content',
|
|
849
1096
|
sectionName: 'content',
|
|
1097
|
+
pageId: 'home',
|
|
850
1098
|
status: 'active',
|
|
851
1099
|
Position: 6,
|
|
852
1100
|
Title: 'Trending Now',
|
|
@@ -882,6 +1130,7 @@ function generateMockWidgets() {
|
|
|
882
1130
|
type: 'ProductCarousel',
|
|
883
1131
|
section: 'content',
|
|
884
1132
|
sectionName: 'content',
|
|
1133
|
+
pageId: 'home',
|
|
885
1134
|
status: 'active',
|
|
886
1135
|
Position: 7,
|
|
887
1136
|
Title: 'Electronics',
|
|
@@ -918,6 +1167,7 @@ function generateMockWidgets() {
|
|
|
918
1167
|
type: 'ProductCarousel',
|
|
919
1168
|
section: 'content',
|
|
920
1169
|
sectionName: 'content',
|
|
1170
|
+
pageId: 'home',
|
|
921
1171
|
status: 'active',
|
|
922
1172
|
Position: 8,
|
|
923
1173
|
Title: 'Fashion',
|
|
@@ -954,6 +1204,7 @@ function generateMockWidgets() {
|
|
|
954
1204
|
type: 'ProductCarousel',
|
|
955
1205
|
section: 'content',
|
|
956
1206
|
sectionName: 'content',
|
|
1207
|
+
pageId: 'product',
|
|
957
1208
|
status: 'active',
|
|
958
1209
|
Position: 9,
|
|
959
1210
|
Title: 'You May Also Like',
|
|
@@ -988,6 +1239,7 @@ function generateMockWidgets() {
|
|
|
988
1239
|
type: 'ProductCarousel',
|
|
989
1240
|
section: 'content',
|
|
990
1241
|
sectionName: 'content',
|
|
1242
|
+
pageId: 'product',
|
|
991
1243
|
status: 'active',
|
|
992
1244
|
Position: 10,
|
|
993
1245
|
Title: 'Frequently Bought Together',
|
|
@@ -1023,6 +1275,7 @@ function generateMockWidgets() {
|
|
|
1023
1275
|
type: 'ProductCarousel',
|
|
1024
1276
|
section: 'content',
|
|
1025
1277
|
sectionName: 'content',
|
|
1278
|
+
pageId: 'home',
|
|
1026
1279
|
status: 'active',
|
|
1027
1280
|
Position: 11,
|
|
1028
1281
|
Title: "Editor's Choice",
|
|
@@ -1060,6 +1313,7 @@ function generateMockWidgets() {
|
|
|
1060
1313
|
type: 'ProductGrid',
|
|
1061
1314
|
section: 'content',
|
|
1062
1315
|
sectionName: 'content',
|
|
1316
|
+
pageId: 'home',
|
|
1063
1317
|
status: 'active',
|
|
1064
1318
|
Position: 12,
|
|
1065
1319
|
Title: 'Shop All Products',
|
|
@@ -1082,7 +1336,8 @@ function generateMockWidgets() {
|
|
|
1082
1336
|
Limit: 12,
|
|
1083
1337
|
Columns: 4,
|
|
1084
1338
|
Products: []
|
|
1085
|
-
}
|
|
1339
|
+
},
|
|
1340
|
+
products: []
|
|
1086
1341
|
},
|
|
1087
1342
|
content: JSON.stringify({
|
|
1088
1343
|
NumberOfProducts: 12,
|
|
@@ -1096,6 +1351,7 @@ function generateMockWidgets() {
|
|
|
1096
1351
|
type: 'ProductGrid',
|
|
1097
1352
|
section: 'content',
|
|
1098
1353
|
sectionName: 'content',
|
|
1354
|
+
pageId: 'home',
|
|
1099
1355
|
status: 'active',
|
|
1100
1356
|
Position: 13,
|
|
1101
1357
|
Title: 'Featured Collection',
|
|
@@ -1118,7 +1374,8 @@ function generateMockWidgets() {
|
|
|
1118
1374
|
Columns: 3,
|
|
1119
1375
|
IsFeatured: true,
|
|
1120
1376
|
Products: []
|
|
1121
|
-
}
|
|
1377
|
+
},
|
|
1378
|
+
products: []
|
|
1122
1379
|
},
|
|
1123
1380
|
content: JSON.stringify({
|
|
1124
1381
|
NumberOfProducts: 6,
|
|
@@ -1133,6 +1390,7 @@ function generateMockWidgets() {
|
|
|
1133
1390
|
type: 'Banner',
|
|
1134
1391
|
section: 'content',
|
|
1135
1392
|
sectionName: 'content',
|
|
1393
|
+
pageId: 'home',
|
|
1136
1394
|
status: 'active',
|
|
1137
1395
|
Position: 4,
|
|
1138
1396
|
Title: 'Special Offers',
|
|
@@ -1171,6 +1429,7 @@ function generateMockWidgets() {
|
|
|
1171
1429
|
type: 'SimpleProduct',
|
|
1172
1430
|
section: 'content',
|
|
1173
1431
|
sectionName: 'content',
|
|
1432
|
+
pageId: 'home',
|
|
1174
1433
|
status: 'active',
|
|
1175
1434
|
Position: 5,
|
|
1176
1435
|
Title: 'Best Sellers',
|
|
@@ -1195,6 +1454,7 @@ function generateMockWidgets() {
|
|
|
1195
1454
|
type: 'SingleProduct',
|
|
1196
1455
|
section: 'content',
|
|
1197
1456
|
sectionName: 'content',
|
|
1457
|
+
pageId: 'home',
|
|
1198
1458
|
status: 'active',
|
|
1199
1459
|
Position: 6,
|
|
1200
1460
|
Title: 'Deal of the Day',
|
|
@@ -1217,6 +1477,7 @@ function generateMockWidgets() {
|
|
|
1217
1477
|
type: 'RecentlyViewed',
|
|
1218
1478
|
section: 'content',
|
|
1219
1479
|
sectionName: 'content',
|
|
1480
|
+
pageId: 'product',
|
|
1220
1481
|
status: 'active',
|
|
1221
1482
|
Position: 7,
|
|
1222
1483
|
Title: 'Recently Viewed',
|
|
@@ -1228,7 +1489,8 @@ function generateMockWidgets() {
|
|
|
1228
1489
|
show_add_to_cart: false
|
|
1229
1490
|
},
|
|
1230
1491
|
data: {
|
|
1231
|
-
products: []
|
|
1492
|
+
products: [],
|
|
1493
|
+
content: { products: [], Products: [] }
|
|
1232
1494
|
}
|
|
1233
1495
|
},
|
|
1234
1496
|
|
|
@@ -1238,6 +1500,7 @@ function generateMockWidgets() {
|
|
|
1238
1500
|
type: 'BrandCarousel',
|
|
1239
1501
|
section: 'content',
|
|
1240
1502
|
sectionName: 'content',
|
|
1503
|
+
pageId: 'home',
|
|
1241
1504
|
status: 'active',
|
|
1242
1505
|
Position: 8,
|
|
1243
1506
|
Title: 'Our Brands',
|
|
@@ -1283,6 +1546,7 @@ function generateMockWidgets() {
|
|
|
1283
1546
|
type: 'Gallery',
|
|
1284
1547
|
section: 'content',
|
|
1285
1548
|
sectionName: 'content',
|
|
1549
|
+
pageId: 'home',
|
|
1286
1550
|
status: 'active',
|
|
1287
1551
|
Position: 4,
|
|
1288
1552
|
Title: 'Instagram Gallery',
|
|
@@ -1323,6 +1587,7 @@ function generateMockWidgets() {
|
|
|
1323
1587
|
type: 'TestimonialCarousel',
|
|
1324
1588
|
section: 'content',
|
|
1325
1589
|
sectionName: 'content',
|
|
1590
|
+
pageId: 'home',
|
|
1326
1591
|
status: 'active',
|
|
1327
1592
|
Position: 5,
|
|
1328
1593
|
Title: 'What Our Customers Say',
|
|
@@ -1335,71 +1600,294 @@ function generateMockWidgets() {
|
|
|
1335
1600
|
hideDot: false
|
|
1336
1601
|
},
|
|
1337
1602
|
data: {
|
|
1338
|
-
content:
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1603
|
+
content: {
|
|
1604
|
+
Items: [
|
|
1605
|
+
{
|
|
1606
|
+
Title: 'Amazing Quality!',
|
|
1607
|
+
title: 'Amazing Quality!',
|
|
1608
|
+
Description: 'I\'ve been shopping here for years and the quality never disappoints. Fast shipping and excellent customer service too!',
|
|
1609
|
+
description: 'I\'ve been shopping here for years and the quality never disappoints. Fast shipping and excellent customer service too!',
|
|
1610
|
+
PersonName: 'Sarah Johnson',
|
|
1611
|
+
personName: 'Sarah Johnson',
|
|
1612
|
+
CompanyName: 'Verified Buyer',
|
|
1613
|
+
companyName: 'Verified Buyer',
|
|
1614
|
+
Rating: 5,
|
|
1615
|
+
rating: 5,
|
|
1616
|
+
ImageUrl: 'https://picsum.photos/seed/user1/100/100',
|
|
1617
|
+
imageUrl: 'https://picsum.photos/seed/user1/100/100'
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
Title: 'Great Experience',
|
|
1621
|
+
title: 'Great Experience',
|
|
1622
|
+
Description: 'The customer service team went above and beyond to help me find exactly what I needed. Highly recommend!',
|
|
1623
|
+
description: 'The customer service team went above and beyond to help me find exactly what I needed. Highly recommend!',
|
|
1624
|
+
PersonName: 'Michael Chen',
|
|
1625
|
+
personName: 'Michael Chen',
|
|
1626
|
+
CompanyName: 'Regular Customer',
|
|
1627
|
+
companyName: 'Regular Customer',
|
|
1628
|
+
Rating: 5,
|
|
1629
|
+
rating: 5,
|
|
1630
|
+
ImageUrl: 'https://picsum.photos/seed/user2/100/100',
|
|
1631
|
+
imageUrl: 'https://picsum.photos/seed/user2/100/100'
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
Title: 'Will Shop Again',
|
|
1635
|
+
title: 'Will Shop Again',
|
|
1636
|
+
Description: 'Love the variety of products and the prices are very competitive. The website is easy to navigate too.',
|
|
1637
|
+
description: 'Love the variety of products and the prices are very competitive. The website is easy to navigate too.',
|
|
1638
|
+
PersonName: 'Emily Davis',
|
|
1639
|
+
personName: 'Emily Davis',
|
|
1640
|
+
CompanyName: 'Fashion Enthusiast',
|
|
1641
|
+
companyName: 'Fashion Enthusiast',
|
|
1642
|
+
Rating: 5,
|
|
1643
|
+
rating: 5,
|
|
1644
|
+
ImageUrl: 'https://picsum.photos/seed/user3/100/100',
|
|
1645
|
+
imageUrl: 'https://picsum.photos/seed/user3/100/100'
|
|
1646
|
+
},
|
|
1647
|
+
{
|
|
1648
|
+
Title: 'Fast Delivery',
|
|
1649
|
+
title: 'Fast Delivery',
|
|
1650
|
+
Description: 'Ordered on Monday, received on Wednesday! The packaging was perfect and the product exceeded expectations.',
|
|
1651
|
+
description: 'Ordered on Monday, received on Wednesday! The packaging was perfect and the product exceeded expectations.',
|
|
1652
|
+
PersonName: 'David Wilson',
|
|
1653
|
+
personName: 'David Wilson',
|
|
1654
|
+
CompanyName: 'Tech Reviewer',
|
|
1655
|
+
companyName: 'Tech Reviewer',
|
|
1656
|
+
Rating: 4,
|
|
1657
|
+
rating: 4,
|
|
1658
|
+
ImageUrl: 'https://picsum.photos/seed/user4/100/100',
|
|
1659
|
+
imageUrl: 'https://picsum.photos/seed/user4/100/100'
|
|
1660
|
+
}
|
|
1661
|
+
]
|
|
1662
|
+
}
|
|
1663
|
+
},
|
|
1664
|
+
content: JSON.stringify({
|
|
1665
|
+
Items: [
|
|
1666
|
+
{ Title: 'Amazing Quality!', Description: 'The quality never disappoints.', PersonName: 'Sarah Johnson', CompanyName: 'Verified Buyer', Rating: 5, ImageUrl: 'https://picsum.photos/seed/user1/100/100' },
|
|
1667
|
+
{ Title: 'Great Experience', Description: 'Excellent customer service.', PersonName: 'Michael Chen', CompanyName: 'Regular Customer', Rating: 5, ImageUrl: 'https://picsum.photos/seed/user2/100/100' },
|
|
1668
|
+
{ Title: 'Will Shop Again', Description: 'Love the variety.', PersonName: 'Emily Davis', CompanyName: 'Fashion Enthusiast', Rating: 5, ImageUrl: 'https://picsum.photos/seed/user3/100/100' },
|
|
1669
|
+
{ Title: 'Fast Delivery', Description: 'Quick and perfect packaging.', PersonName: 'David Wilson', CompanyName: 'Tech Reviewer', Rating: 4, ImageUrl: 'https://picsum.photos/seed/user4/100/100' }
|
|
1395
1670
|
]
|
|
1671
|
+
})
|
|
1672
|
+
},
|
|
1673
|
+
|
|
1674
|
+
// DiscountTime Widget
|
|
1675
|
+
{
|
|
1676
|
+
id: 'widget-discount-time-1',
|
|
1677
|
+
type: 'DiscountTime',
|
|
1678
|
+
section: 'content',
|
|
1679
|
+
sectionName: 'content',
|
|
1680
|
+
pageId: 'home',
|
|
1681
|
+
status: 'active',
|
|
1682
|
+
Position: 14,
|
|
1683
|
+
Title: 'Limited Time Offer',
|
|
1684
|
+
settings: {
|
|
1685
|
+
title: 'Limited Time Offer',
|
|
1686
|
+
textColor: '#ffffff',
|
|
1687
|
+
backgroundColor: '#1f2937',
|
|
1688
|
+
background_from: '#1f2937',
|
|
1689
|
+
background_to: '#111827',
|
|
1690
|
+
cta_label: 'Shop Now',
|
|
1691
|
+
cta_link: '/products',
|
|
1692
|
+
cta_background: '#ef4444',
|
|
1693
|
+
cta_text: '#ffffff'
|
|
1396
1694
|
},
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1695
|
+
data: {
|
|
1696
|
+
content: {
|
|
1697
|
+
couponValid: true,
|
|
1698
|
+
coupon: {
|
|
1699
|
+
discountAmount: 25,
|
|
1700
|
+
couponCode: 'SAVE25',
|
|
1701
|
+
description: 'Get 25% off on all products! Limited time only.',
|
|
1702
|
+
endOn: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString(),
|
|
1703
|
+
startOn: new Date().toISOString(),
|
|
1704
|
+
ruleToApply: 'by_percent',
|
|
1705
|
+
fileName: '',
|
|
1706
|
+
imageUrl: 'https://picsum.photos/seed/discount-banner/1200/400'
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
},
|
|
1711
|
+
|
|
1712
|
+
// Product Widget (uses product-grid shared template)
|
|
1713
|
+
{
|
|
1714
|
+
id: 'widget-product-1',
|
|
1715
|
+
type: 'Product',
|
|
1716
|
+
section: 'content',
|
|
1717
|
+
sectionName: 'content',
|
|
1718
|
+
pageId: 'home',
|
|
1719
|
+
status: 'active',
|
|
1720
|
+
Position: 15,
|
|
1721
|
+
Title: 'Our Products',
|
|
1722
|
+
settings: {
|
|
1723
|
+
title: 'Our Products',
|
|
1724
|
+
subtitle: 'Top picks for you',
|
|
1725
|
+
columns: 4,
|
|
1726
|
+
showWidgetTitle: 'Yes',
|
|
1727
|
+
widgetTitleAlignment: 'center',
|
|
1728
|
+
show_add_to_cart: true
|
|
1729
|
+
},
|
|
1730
|
+
data: {
|
|
1731
|
+
content: {
|
|
1732
|
+
products: [],
|
|
1733
|
+
Products: []
|
|
1734
|
+
},
|
|
1735
|
+
products: []
|
|
1736
|
+
}
|
|
1737
|
+
},
|
|
1738
|
+
|
|
1739
|
+
// ProductCanvas Widget
|
|
1740
|
+
{
|
|
1741
|
+
id: 'widget-product-canvas-1',
|
|
1742
|
+
type: 'ProductCanvas',
|
|
1743
|
+
section: 'content',
|
|
1744
|
+
sectionName: 'content',
|
|
1745
|
+
pageId: 'home',
|
|
1746
|
+
status: 'active',
|
|
1747
|
+
Position: 16,
|
|
1748
|
+
Title: 'Shop the Look',
|
|
1749
|
+
settings: {
|
|
1750
|
+
title: 'Shop the Look',
|
|
1751
|
+
showContainer: 'Yes',
|
|
1752
|
+
showWidgetBottomMargin: 'Yes',
|
|
1753
|
+
backgroundColor: '#f9fafb'
|
|
1754
|
+
},
|
|
1755
|
+
data: {
|
|
1756
|
+
content: {
|
|
1757
|
+
ImageUrl: 'https://picsum.photos/seed/canvas-main/1200/600',
|
|
1758
|
+
imageUrl: 'https://picsum.photos/seed/canvas-main/1200/600',
|
|
1759
|
+
ShowContainer: 'Yes',
|
|
1760
|
+
ShowWidgetBottomMargin: 'Yes',
|
|
1761
|
+
Items: [
|
|
1762
|
+
{ X: 25, Y: 30, x: 25, y: 30, TargetUrl: '/products', targetUrl: '/products', Url: '/products', url: '/products' },
|
|
1763
|
+
{ X: 55, Y: 45, x: 55, y: 45, TargetUrl: '/products', targetUrl: '/products', Url: '/products', url: '/products' },
|
|
1764
|
+
{ X: 75, Y: 60, x: 75, y: 60, TargetUrl: '/products', targetUrl: '/products', Url: '/products', url: '/products' }
|
|
1765
|
+
]
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
},
|
|
1769
|
+
|
|
1770
|
+
// Splash Widget
|
|
1771
|
+
{
|
|
1772
|
+
id: 'widget-splash-1',
|
|
1773
|
+
type: 'Splash',
|
|
1774
|
+
section: 'content',
|
|
1775
|
+
sectionName: 'content',
|
|
1776
|
+
pageId: 'home',
|
|
1777
|
+
status: 'active',
|
|
1778
|
+
Position: 17,
|
|
1779
|
+
Title: 'Welcome Offer',
|
|
1780
|
+
settings: {
|
|
1781
|
+
backgroundColor: '#ffffff',
|
|
1782
|
+
textColor: '#111111',
|
|
1783
|
+
seconds: 3,
|
|
1784
|
+
showOnce: true,
|
|
1785
|
+
overlayColor: 'rgba(0,0,0,0.6)',
|
|
1786
|
+
eventType: 'Onload'
|
|
1787
|
+
},
|
|
1788
|
+
data: {
|
|
1789
|
+
content: {
|
|
1790
|
+
ImageUrl: 'https://picsum.photos/seed/splash-promo/600/400',
|
|
1791
|
+
imageUrl: 'https://picsum.photos/seed/splash-promo/600/400',
|
|
1792
|
+
Title: 'Welcome to Our Store!',
|
|
1793
|
+
title: 'Welcome to Our Store!',
|
|
1794
|
+
Description: 'Sign up and get 15% off your first order. Use code WELCOME15 at checkout.',
|
|
1795
|
+
description: 'Sign up and get 15% off your first order. Use code WELCOME15 at checkout.',
|
|
1796
|
+
LinkText: 'Shop Now',
|
|
1797
|
+
linkText: 'Shop Now',
|
|
1798
|
+
ButtonText: 'Shop Now',
|
|
1799
|
+
buttonText: 'Shop Now',
|
|
1800
|
+
TargetUrl: '/products',
|
|
1801
|
+
targetUrl: '/products',
|
|
1802
|
+
Link: '/products',
|
|
1803
|
+
link: '/products',
|
|
1804
|
+
BackgroundColor: '#ffffff',
|
|
1805
|
+
backgroundColor: '#ffffff',
|
|
1806
|
+
TextColor: '#111111',
|
|
1807
|
+
textColor: '#111111',
|
|
1808
|
+
Seconds: 3,
|
|
1809
|
+
seconds: 3,
|
|
1810
|
+
DelaySeconds: 3,
|
|
1811
|
+
delaySeconds: 3,
|
|
1812
|
+
ShowOnce: true,
|
|
1813
|
+
showOnce: true,
|
|
1814
|
+
OverlayColor: 'rgba(0,0,0,0.6)',
|
|
1815
|
+
overlayColor: 'rgba(0,0,0,0.6)',
|
|
1816
|
+
EventType: 'Onload',
|
|
1817
|
+
eventType: 'Onload'
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
},
|
|
1821
|
+
|
|
1822
|
+
// SpaceBarCarousel Widget
|
|
1823
|
+
{
|
|
1824
|
+
id: 'widget-spacebar-carousel-1',
|
|
1825
|
+
type: 'SpaceBarCarousel',
|
|
1826
|
+
section: 'content',
|
|
1827
|
+
sectionName: 'content',
|
|
1828
|
+
pageId: 'home',
|
|
1829
|
+
status: 'active',
|
|
1830
|
+
Position: 18,
|
|
1831
|
+
Title: 'Why Shop With Us',
|
|
1832
|
+
settings: {
|
|
1833
|
+
title: 'Why Shop With Us',
|
|
1834
|
+
subtitle: 'We deliver excellence',
|
|
1835
|
+
showWidgetTitle: 'Yes',
|
|
1836
|
+
widgetTitleAlignment: 'center',
|
|
1837
|
+
backgroundColor: '#f8f9fa',
|
|
1838
|
+
textColor: '#111',
|
|
1839
|
+
hideDot: false,
|
|
1840
|
+
hideArrow: false,
|
|
1841
|
+
priorityCount: 4
|
|
1842
|
+
},
|
|
1843
|
+
data: {
|
|
1844
|
+
content: {
|
|
1845
|
+
Items: [
|
|
1846
|
+
{
|
|
1847
|
+
Title: 'Free Shipping', title: 'Free Shipping',
|
|
1848
|
+
Description: 'On orders over $50', description: 'On orders over $50',
|
|
1849
|
+
IconHtml: '<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="1" y="3" width="15" height="13"></rect><polygon points="16 8 20 8 23 11 23 16 16 16 16 8"></polygon><circle cx="5.5" cy="18.5" r="2.5"></circle><circle cx="18.5" cy="18.5" r="2.5"></circle></svg>',
|
|
1850
|
+
ImageUrl: 'https://picsum.photos/seed/feat-ship/100/100', imageUrl: 'https://picsum.photos/seed/feat-ship/100/100',
|
|
1851
|
+
Link: '/shipping-info', link: '/shipping-info'
|
|
1852
|
+
},
|
|
1853
|
+
{
|
|
1854
|
+
Title: '24/7 Support', title: '24/7 Support',
|
|
1855
|
+
Description: 'Dedicated support team', description: 'Dedicated support team',
|
|
1856
|
+
IconHtml: '<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72"></path></svg>',
|
|
1857
|
+
ImageUrl: 'https://picsum.photos/seed/feat-support/100/100', imageUrl: 'https://picsum.photos/seed/feat-support/100/100',
|
|
1858
|
+
Link: '/contact', link: '/contact'
|
|
1859
|
+
},
|
|
1860
|
+
{
|
|
1861
|
+
Title: 'Secure Payment', title: 'Secure Payment',
|
|
1862
|
+
Description: '100% secure checkout', description: '100% secure checkout',
|
|
1863
|
+
IconHtml: '<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>',
|
|
1864
|
+
ImageUrl: 'https://picsum.photos/seed/feat-secure/100/100', imageUrl: 'https://picsum.photos/seed/feat-secure/100/100',
|
|
1865
|
+
Link: '/security', link: '/security'
|
|
1866
|
+
},
|
|
1867
|
+
{
|
|
1868
|
+
Title: 'Easy Returns', title: 'Easy Returns',
|
|
1869
|
+
Description: '30-day return policy', description: '30-day return policy',
|
|
1870
|
+
IconHtml: '<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="1 4 1 10 7 10"></polyline><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path></svg>',
|
|
1871
|
+
ImageUrl: 'https://picsum.photos/seed/feat-return/100/100', imageUrl: 'https://picsum.photos/seed/feat-return/100/100',
|
|
1872
|
+
Link: '/returns', link: '/returns'
|
|
1873
|
+
},
|
|
1874
|
+
{
|
|
1875
|
+
Title: 'Loyalty Rewards', title: 'Loyalty Rewards',
|
|
1876
|
+
Description: 'Earn points on every purchase', description: 'Earn points on every purchase',
|
|
1877
|
+
IconHtml: '<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="8" r="7"></circle><polyline points="8.21 13.89 7 23 12 20 17 23 15.79 13.88"></polyline></svg>',
|
|
1878
|
+
ImageUrl: 'https://picsum.photos/seed/feat-loyalty/100/100', imageUrl: 'https://picsum.photos/seed/feat-loyalty/100/100',
|
|
1879
|
+
Link: '/loyalty', link: '/loyalty'
|
|
1880
|
+
},
|
|
1881
|
+
{
|
|
1882
|
+
Title: 'Quality Assured', title: 'Quality Assured',
|
|
1883
|
+
Description: 'Premium products guaranteed', description: 'Premium products guaranteed',
|
|
1884
|
+
IconHtml: '<svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path><polyline points="22 4 12 14.01 9 11.01"></polyline></svg>',
|
|
1885
|
+
ImageUrl: 'https://picsum.photos/seed/feat-quality/100/100', imageUrl: 'https://picsum.photos/seed/feat-quality/100/100',
|
|
1886
|
+
Link: '/about', link: '/about'
|
|
1887
|
+
}
|
|
1888
|
+
]
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1403
1891
|
},
|
|
1404
1892
|
|
|
1405
1893
|
// ==================== FOOTER SECTION ====================
|
|
@@ -1408,6 +1896,7 @@ function generateMockWidgets() {
|
|
|
1408
1896
|
type: 'Footer',
|
|
1409
1897
|
section: 'footer',
|
|
1410
1898
|
sectionName: 'footer',
|
|
1899
|
+
pageId: 'all',
|
|
1411
1900
|
status: 'active',
|
|
1412
1901
|
Position: 1,
|
|
1413
1902
|
settings: {
|
|
@@ -1475,6 +1964,7 @@ function generateMockWidgets() {
|
|
|
1475
1964
|
type: 'FooterMenu',
|
|
1476
1965
|
section: 'footer',
|
|
1477
1966
|
sectionName: 'footer',
|
|
1967
|
+
pageId: 'all',
|
|
1478
1968
|
status: 'active',
|
|
1479
1969
|
Position: 2,
|
|
1480
1970
|
settings: {
|