${(function(){ const get_random_six_digits = () => { return Math.random().toString().slice(-6) }; const wholesale_enabled = true; const setting_product_image_display = "natural"; const product_image = data.image; const secondary_image = data.secondImage; const image_width = product_image.width || 600; let image_height = product_image.height || 600; if(setting_product_image_display == '100%'){ image_height = image_width }else if(setting_product_image_display == '133.33%'){ image_height = image_width * 1.3333; }; let product_image_hover_on = false; const has_save_label = true && ((+data.compare_at_price) > (+data.price)); const is_single_variant = data.variants.length == 1; const min_price_variant_href = (data.min_price_variant && data.min_price_variant.available) ? data.min_price_variant.withinUrl : data.withinUrl; const retail_price_max = data.retail_price_max || data.compare_at_price_max; const THUMBNAILS_MAX_SIZE = 3; const thumbnails = data.thumbVariants.slice(0, THUMBNAILS_MAX_SIZE); const image_wrap_id = 'image_wrap_' + get_random_six_digits(); const image_carousel_id = 'image_carousel_' + get_random_six_digits(); const thumbnails_selector_id = 'thumbnails_selector_' + get_random_six_digits(); const form_id = 'form_' + get_random_six_digits() + ""; const mixed_wholesale = data.mixed_wholesale; return `
Mixed Lot
${data.title}
-
Retail
+${data.remainInvisibleThumbCount}
` })()}
class SpzCustomLabelScript extends SPZ.BaseElement { constructor(element) { super(element); } isLayoutSupported(layout) { return true; } mountCallback() { const script = this.element; const boxEl = script.closest('.product_snippet_label_area'); const labelEl = boxEl.querySelector('.product_snippet__label'); if(!labelEl) return; const observer = new ResizeObserver((entries) => { const labelEls = boxEl.querySelectorAll('.product_snippet__label'); const offsetWidth = Math.max(...Array.from(labelEls).map(el => el.offsetWidth)); if(offsetWidth>0){ const padding = offsetWidth / 2 + 8 + 'px'; boxEl.style.left = padding; boxEl.style.right = padding; boxEl.style.visibility = 'visible'; } }); observer.observe(labelEl); } } SPZ.defineElement('spz-custom-label-script', SpzCustomLabelScript);
(function () { class SPZCustomEventTrack extends SPZ.BaseElement { constructor(element) { super(element); this.action_ = SPZServices.actionServiceForDoc(this.element); } isLayoutSupported(layout) { return true; } buildCallback() { this.setupAction_(); } track(key, value) { console.log('tracking...', key, value); if(window.sa){ window.sa.track(key, value); }else{ let sa = null; Object.defineProperty(window, 'sa',{ get: function() { return sa; }, set(val){ sa = val; sa.track(key, value); } }) } } setupAction_() { const clickParams = { business_type: 'product_theme', event_name: 'function_click', function_name: 'Farida', plugin_name: 'Farida', template_name: "page", template_type: 3, module: 'online_store', module_type: 'online_store', tab_name: '', card_name: '', event_developer: 'ccbGolumn', event_type: 'click', }; this.registerAction('trackClick', (e) => { const event_info = e.args || {}; this.track('function_click', { ...clickParams, event_info: JSON.stringify(event_info), }); }); this.registerAction('trackExpose', (e) => { const event_info = e.args || {}; this.track('function_expose', { ...clickParams, event_name: 'function_expose', event_type: 'expose', event_info: JSON.stringify(event_info), }); }); } } SPZ.defineElement('spz-custom-event-track', SPZCustomEventTrack); }())
Hassle-free returns. 30-day postage paid returns
Hassle-free returns. 30-day postage paid returns
Hassle-free returns. 30-day postage paid returns
Hassle-free returns. 30-day postage paid returns
Search
Search
Search
Search
Search
Log in
Create an account
${data.data && data.data.count}
Home
1
7777
4
55
已上架商品
已上架商品
Album
Manual Album
test2
测试子专辑1
测试子专辑2
测试子专辑3
测试子专辑4
测试三级菜单
测试绑定专辑详情
1
2
3
4
5
6
7
8
9
11
13
13
14
15
16
17
177
18
20
19
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
65
56
57
58
59
60
61
111
1111
11111
555
555
555
66666
666
66
Smart Album
test1
查询订单
测试子专辑4
测试绑定专辑详情
16
测试商户商品图
$19.00
-
$35.00
Retail
$63.99
New Arrivals
Collection
素材中心链接
尺码表
2
3
Product
jewelry
特殊t
查询订单
1111
22222
33333
44444
55555
66666
666666
33333
More links
${(function(){ const formatLinks = (links) => { return links.map(link => { link.tag = tags[link.title.toUpperCase()] || {}; link.target_attr = link.target == '_blank' ? 'target="_blank"' : ''; link.href_attr = link.url ? `href="${link.url}"` : ''; if(link.children && link.children.length){ link.children = formatLinks(link.children); } return link; }) }; const tags = "{}"; let linkList = [ { id: 80381681, title: "Home", url: "\/pages\/1112", target: "", levels: 1, product0: { id: (null) }, children: [ { title: "1", url: "\/pages\/12", target: "", levels: 0, cover: '', children: [ ] }, { title: "7777", url: "\/pages\/777", target: "", levels: 0, cover: '', children: [ ] }, { title: "4", url: "\/pages\/4", target: "", levels: 0, cover: '', children: [ ] }, { title: "55", url: "\/pages\/55", target: "", levels: 0, cover: '', children: [ ] }, ] }, { id: 80381715, title: "\u5df2\u4e0a\u67b6\u5546\u54c1", url: "https:\/\/rainy-shoplazza.myshoplaza.com\/collections\/\u5df2\u4e0a\u67b6\u5546\u54c1", target: "", levels: 1, product0: { id: (null) }, children: [ { title: "\u5df2\u4e0a\u67b6\u5546\u54c1", url: "\/collections\/\u5df2\u4e0a\u67b6\u5546\u54c1", target: "", levels: 0, cover: ' <spz-img src="//img.staticdj.com/50f08b32641af77d283e3d4c452c7e8d.png" layout="responsive" width="1344" height="672" alt="已上架商品" loading="lazy" class="block mb-2 boder-radius" object-fit="cover" auto-fit="600" ></spz-img> ', children: [ ] }, ] }, { id: 80381683, title: "Album", url: "\/collections\/\u6d4b\u8bd5\u5ba2\u6237\u5546\u54c1", target: "", levels: 2, product0: { id: ("6bb6a746-cad9-4bcf-bb54-6fc02cb67b35") }, children: [ { title: "Manual Album", url: "\/collections\/collections-\u624b\u52a8", target: "", levels: 1, cover: ' <spz-img src="//img.staticdj.com/free/760d09e83efb609463f943673a380a6b.jpeg" layout="responsive" width="3000" height="1500" alt="/collections/手动" loading="lazy" class="block mb-2 boder-radius" object-fit="cover" auto-fit="600" ></spz-img> ', children: [ { title: "test2", url: "\/collections\/\u5df2\u4e0a\u67b6\u5546\u54c1", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u5b50\u4e13\u8f911", url: "\/collections\/\u6d4b\u8bd5\u5ba2\u6237\u5546\u54c1", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u5b50\u4e13\u8f912", url: "\/collections\/collections-\u624b\u52a8", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u5b50\u4e13\u8f913", url: "\/collections\/\u667a\u80fd", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u5b50\u4e13\u8f914", url: "\/collections\/\u5546\u54c1\u5217\u8868", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u4e09\u7ea7\u83dc\u5355", url: "\/collections\/\u5df2\u4e0a\u67b6\u5546\u54c1", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u7ed1\u5b9a\u4e13\u8f91\u8be6\u60c5", url: "\/collections\/testcustom22", target: "", levels: 0, }, { title: "1", url: "", target: "", levels: 0, }, { title: "2", url: "", target: "", levels: 0, }, { title: "3", url: "", target: "", levels: 0, }, { title: "4", url: "", target: "", levels: 0, }, { title: "5", url: "", target: "", levels: 0, }, { title: "6", url: "", target: "", levels: 0, }, { title: "7", url: "", target: "", levels: 0, }, { title: "8", url: "", target: "", levels: 0, }, { title: "9", url: "", target: "", levels: 0, }, { title: "11", url: "", target: "", levels: 0, }, { title: "13", url: "", target: "", levels: 0, }, { title: "13", url: "", target: "", levels: 0, }, { title: "14", url: "", target: "", levels: 0, }, { title: "15", url: "", target: "", levels: 0, }, { title: "16", url: "", target: "", levels: 0, }, { title: "17", url: "", target: "", levels: 0, }, { title: "177", url: "", target: "", levels: 0, }, { title: "18", url: "", target: "", levels: 0, }, { title: "20", url: "", target: "", levels: 0, }, { title: "19", url: "", target: "", levels: 0, }, { title: "21", url: "", target: "", levels: 0, }, { title: "22", url: "", target: "", levels: 0, }, { title: "23", url: "", target: "", levels: 0, }, { title: "24", url: "", target: "", levels: 0, }, { title: "25", url: "", target: "", levels: 0, }, { title: "26", url: "", target: "", levels: 0, }, { title: "27", url: "", target: "", levels: 0, }, { title: "28", url: "", target: "", levels: 0, }, { title: "29", url: "", target: "", levels: 0, }, { title: "30", url: "", target: "", levels: 0, }, { title: "31", url: "", target: "", levels: 0, }, { title: "32", url: "", target: "", levels: 0, }, { title: "33", url: "", target: "", levels: 0, }, { title: "34", url: "", target: "", levels: 0, }, { title: "35", url: "", target: "", levels: 0, }, { title: "36", url: "", target: "", levels: 0, }, { title: "37", url: "", target: "", levels: 0, }, { title: "38", url: "", target: "", levels: 0, }, { title: "39", url: "", target: "", levels: 0, }, { title: "40", url: "", target: "", levels: 0, }, { title: "41", url: "", target: "", levels: 0, }, { title: "42", url: "", target: "", levels: 0, }, { title: "43", url: "", target: "", levels: 0, }, { title: "44", url: "", target: "", levels: 0, }, { title: "45", url: "", target: "", levels: 0, }, { title: "46", url: "", target: "", levels: 0, }, { title: "47", url: "", target: "", levels: 0, }, { title: "48", url: "", target: "", levels: 0, }, { title: "49", url: "", target: "", levels: 0, }, { title: "50", url: "", target: "", levels: 0, }, { title: "51", url: "", target: "", levels: 0, }, { title: "52", url: "", target: "", levels: 0, }, { title: "53", url: "", target: "", levels: 0, }, { title: "54", url: "", target: "", levels: 0, }, { title: "55", url: "", target: "", levels: 0, }, { title: "65", url: "", target: "", levels: 0, }, { title: "56", url: "", target: "", levels: 0, }, { title: "57", url: "", target: "", levels: 0, }, { title: "58", url: "", target: "", levels: 0, }, { title: "59", url: "", target: "", levels: 0, }, { title: "60", url: "", target: "", levels: 0, }, { title: "61", url: "", target: "", levels: 0, }, { title: "111", url: "", target: "", levels: 0, }, { title: "1111", url: "", target: "", levels: 0, }, { title: "11111", url: "", target: "", levels: 0, }, { title: "555", url: "", target: "", levels: 0, }, { title: "555", url: "", target: "", levels: 0, }, { title: "555", url: "", target: "", levels: 0, }, { title: "66666", url: "", target: "", levels: 0, }, { title: "666", url: "", target: "", levels: 0, }, { title: "66", url: "", target: "", levels: 0, }, ] }, { title: "Smart Album", url: "\/collections\/\u667a\u80fd", target: "", levels: 0, cover: ' <spz-img src="//img.staticdj.com/free/2c103478d73d0fc16774d6a8a031d2ce.jpeg" layout="responsive" width="3000" height="1500" alt="智能" loading="lazy" class="block mb-2 boder-radius" object-fit="cover" auto-fit="600" ></spz-img> ', children: [ ] }, { title: "test1", url: "\/collections\/\u5df2\u4e0b\u67b6\u5546\u54c1-\u6d4b\u8bd5\u4e13\u8f91\u5e8f\u53f7", target: "", levels: 0, cover: ' <spz-img src="//img.staticdj.com/557adcb4434e991831f96eb1900982d0.png" layout="responsive" width="1024" height="512" alt="已下架商品,测试专辑序号" loading="lazy" class="block mb-2 boder-radius" object-fit="cover" auto-fit="600" ></spz-img> ', children: [ ] }, { title: "\u67e5\u8be2\u8ba2\u5355", url: "", target: "", levels: 0, cover: '', children: [ ] }, { title: "\u6d4b\u8bd5\u5b50\u4e13\u8f914", url: "", target: "", levels: 0, cover: '', children: [ ] }, { title: "\u6d4b\u8bd5\u7ed1\u5b9a\u4e13\u8f91\u8be6\u60c5", url: "", target: "", levels: 0, cover: '', children: [ ] }, { title: "16", url: "", target: "", levels: 0, cover: '', children: [ ] }, ] }, { id: 80381703, title: "New Arrivals", url: "\/", target: "", levels: 2, product0: { id: (null) }, children: [ { title: "Collection", url: "\/", target: "", levels: 1, cover: '', children: [ { title: "\u7d20\u6750\u4e2d\u5fc3\u94fe\u63a5", url: "https:\/\/img.staticdj.com\/7d89f7a7d026a7b78b5cf1054d58e063.png", target: "", levels: 0, }, ] }, { title: "\u5c3a\u7801\u8868", url: "", target: "", levels: 0, cover: '', children: [ ] }, { title: "2", url: "", target: "", levels: 0, cover: '', children: [ ] }, { title: "3", url: "", target: "", levels: 0, cover: '', children: [ ] }, ] }, { id: 80381709, title: "Product", url: "\/", target: "", levels: 2, product0: { id: (null) }, children: [ { title: "jewelry", url: "\/products\/so-and-so", target: "", levels: 1, cover: '', children: [ { title: "\u7279\u6b8at", url: "", target: "", levels: 0, }, ] }, ] }, { id: 83001277, title: "\u67e5\u8be2\u8ba2\u5355", url: "\/account\/order-lookup", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83001279, title: "1111", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83001281, title: "22222", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83010453, title: "33333", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83010455, title: "44444", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83010457, title: "55555", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83010459, title: "66666", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83846927, title: "666666", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83846929, title: "33333", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, ].slice(offset); linkList = formatLinks(linkList); const hasChild = linkList.some(link => !!(link.children && link.children.length || link.product0.id)); for (const item of linkList) { if (item.children?.length > 0) { item.active = 'active'; break; } } return `
${link.title}
${link.tag.label}
${second_link.cover}
${second_link.title}
${second_link.tag.label}
${third_links.title}
${third_links.tag.label}
${link.title}
${link.tag.label}
` })()}
Home
1
7777
4
55
已上架商品
已上架商品
Album
Manual Album
test2
测试子专辑1
测试子专辑2
测试子专辑3
测试子专辑4
测试三级菜单
测试绑定专辑详情
1
2
3
4
5
6
7
8
9
11
13
13
14
15
16
17
177
18
20
19
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
65
56
57
58
59
60
61
111
1111
11111
555
555
555
66666
666
66
Smart Album
test1
查询订单
测试子专辑4
测试绑定专辑详情
16
测试商户商品图
$19.00
-
$35.00
Retail
$63.99
New Arrivals
Collection
素材中心链接
尺码表
2
3
Product
jewelry
特殊t
查询订单
1111
22222
33333
44444
55555
66666
666666
33333
More links
${(function(){ const formatLinks = (links) => { return links.map(link => { link.tag = tags[link.title.toUpperCase()] || {}; link.target_attr = link.target == '_blank' ? 'target="_blank"' : ''; link.href_attr = link.url ? `href="${link.url}"` : ''; if(link.children && link.children.length){ link.children = formatLinks(link.children); } return link; }) }; const tags = "{}"; let linkList = [ { id: 80381681, title: "Home", url: "\/pages\/1112", target: "", levels: 1, product0: { id: (null) }, children: [ { title: "1", url: "\/pages\/12", target: "", levels: 0, cover: '', children: [ ] }, { title: "7777", url: "\/pages\/777", target: "", levels: 0, cover: '', children: [ ] }, { title: "4", url: "\/pages\/4", target: "", levels: 0, cover: '', children: [ ] }, { title: "55", url: "\/pages\/55", target: "", levels: 0, cover: '', children: [ ] }, ] }, { id: 80381715, title: "\u5df2\u4e0a\u67b6\u5546\u54c1", url: "https:\/\/rainy-shoplazza.myshoplaza.com\/collections\/\u5df2\u4e0a\u67b6\u5546\u54c1", target: "", levels: 1, product0: { id: (null) }, children: [ { title: "\u5df2\u4e0a\u67b6\u5546\u54c1", url: "\/collections\/\u5df2\u4e0a\u67b6\u5546\u54c1", target: "", levels: 0, cover: ' <spz-img src="//img.staticdj.com/50f08b32641af77d283e3d4c452c7e8d.png" layout="responsive" width="1344" height="672" alt="已上架商品" loading="lazy" class="block mb-2 boder-radius" object-fit="cover" auto-fit="600" ></spz-img> ', children: [ ] }, ] }, { id: 80381683, title: "Album", url: "\/collections\/\u6d4b\u8bd5\u5ba2\u6237\u5546\u54c1", target: "", levels: 2, product0: { id: ("6bb6a746-cad9-4bcf-bb54-6fc02cb67b35") }, children: [ { title: "Manual Album", url: "\/collections\/collections-\u624b\u52a8", target: "", levels: 1, cover: ' <spz-img src="//img.staticdj.com/free/760d09e83efb609463f943673a380a6b.jpeg" layout="responsive" width="3000" height="1500" alt="/collections/手动" loading="lazy" class="block mb-2 boder-radius" object-fit="cover" auto-fit="600" ></spz-img> ', children: [ { title: "test2", url: "\/collections\/\u5df2\u4e0a\u67b6\u5546\u54c1", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u5b50\u4e13\u8f911", url: "\/collections\/\u6d4b\u8bd5\u5ba2\u6237\u5546\u54c1", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u5b50\u4e13\u8f912", url: "\/collections\/collections-\u624b\u52a8", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u5b50\u4e13\u8f913", url: "\/collections\/\u667a\u80fd", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u5b50\u4e13\u8f914", url: "\/collections\/\u5546\u54c1\u5217\u8868", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u4e09\u7ea7\u83dc\u5355", url: "\/collections\/\u5df2\u4e0a\u67b6\u5546\u54c1", target: "", levels: 0, }, { title: "\u6d4b\u8bd5\u7ed1\u5b9a\u4e13\u8f91\u8be6\u60c5", url: "\/collections\/testcustom22", target: "", levels: 0, }, { title: "1", url: "", target: "", levels: 0, }, { title: "2", url: "", target: "", levels: 0, }, { title: "3", url: "", target: "", levels: 0, }, { title: "4", url: "", target: "", levels: 0, }, { title: "5", url: "", target: "", levels: 0, }, { title: "6", url: "", target: "", levels: 0, }, { title: "7", url: "", target: "", levels: 0, }, { title: "8", url: "", target: "", levels: 0, }, { title: "9", url: "", target: "", levels: 0, }, { title: "11", url: "", target: "", levels: 0, }, { title: "13", url: "", target: "", levels: 0, }, { title: "13", url: "", target: "", levels: 0, }, { title: "14", url: "", target: "", levels: 0, }, { title: "15", url: "", target: "", levels: 0, }, { title: "16", url: "", target: "", levels: 0, }, { title: "17", url: "", target: "", levels: 0, }, { title: "177", url: "", target: "", levels: 0, }, { title: "18", url: "", target: "", levels: 0, }, { title: "20", url: "", target: "", levels: 0, }, { title: "19", url: "", target: "", levels: 0, }, { title: "21", url: "", target: "", levels: 0, }, { title: "22", url: "", target: "", levels: 0, }, { title: "23", url: "", target: "", levels: 0, }, { title: "24", url: "", target: "", levels: 0, }, { title: "25", url: "", target: "", levels: 0, }, { title: "26", url: "", target: "", levels: 0, }, { title: "27", url: "", target: "", levels: 0, }, { title: "28", url: "", target: "", levels: 0, }, { title: "29", url: "", target: "", levels: 0, }, { title: "30", url: "", target: "", levels: 0, }, { title: "31", url: "", target: "", levels: 0, }, { title: "32", url: "", target: "", levels: 0, }, { title: "33", url: "", target: "", levels: 0, }, { title: "34", url: "", target: "", levels: 0, }, { title: "35", url: "", target: "", levels: 0, }, { title: "36", url: "", target: "", levels: 0, }, { title: "37", url: "", target: "", levels: 0, }, { title: "38", url: "", target: "", levels: 0, }, { title: "39", url: "", target: "", levels: 0, }, { title: "40", url: "", target: "", levels: 0, }, { title: "41", url: "", target: "", levels: 0, }, { title: "42", url: "", target: "", levels: 0, }, { title: "43", url: "", target: "", levels: 0, }, { title: "44", url: "", target: "", levels: 0, }, { title: "45", url: "", target: "", levels: 0, }, { title: "46", url: "", target: "", levels: 0, }, { title: "47", url: "", target: "", levels: 0, }, { title: "48", url: "", target: "", levels: 0, }, { title: "49", url: "", target: "", levels: 0, }, { title: "50", url: "", target: "", levels: 0, }, { title: "51", url: "", target: "", levels: 0, }, { title: "52", url: "", target: "", levels: 0, }, { title: "53", url: "", target: "", levels: 0, }, { title: "54", url: "", target: "", levels: 0, }, { title: "55", url: "", target: "", levels: 0, }, { title: "65", url: "", target: "", levels: 0, }, { title: "56", url: "", target: "", levels: 0, }, { title: "57", url: "", target: "", levels: 0, }, { title: "58", url: "", target: "", levels: 0, }, { title: "59", url: "", target: "", levels: 0, }, { title: "60", url: "", target: "", levels: 0, }, { title: "61", url: "", target: "", levels: 0, }, { title: "111", url: "", target: "", levels: 0, }, { title: "1111", url: "", target: "", levels: 0, }, { title: "11111", url: "", target: "", levels: 0, }, { title: "555", url: "", target: "", levels: 0, }, { title: "555", url: "", target: "", levels: 0, }, { title: "555", url: "", target: "", levels: 0, }, { title: "66666", url: "", target: "", levels: 0, }, { title: "666", url: "", target: "", levels: 0, }, { title: "66", url: "", target: "", levels: 0, }, ] }, { title: "Smart Album", url: "\/collections\/\u667a\u80fd", target: "", levels: 0, cover: ' <spz-img src="//img.staticdj.com/free/2c103478d73d0fc16774d6a8a031d2ce.jpeg" layout="responsive" width="3000" height="1500" alt="智能" loading="lazy" class="block mb-2 boder-radius" object-fit="cover" auto-fit="600" ></spz-img> ', children: [ ] }, { title: "test1", url: "\/collections\/\u5df2\u4e0b\u67b6\u5546\u54c1-\u6d4b\u8bd5\u4e13\u8f91\u5e8f\u53f7", target: "", levels: 0, cover: ' <spz-img src="//img.staticdj.com/557adcb4434e991831f96eb1900982d0.png" layout="responsive" width="1024" height="512" alt="已下架商品,测试专辑序号" loading="lazy" class="block mb-2 boder-radius" object-fit="cover" auto-fit="600" ></spz-img> ', children: [ ] }, { title: "\u67e5\u8be2\u8ba2\u5355", url: "", target: "", levels: 0, cover: '', children: [ ] }, { title: "\u6d4b\u8bd5\u5b50\u4e13\u8f914", url: "", target: "", levels: 0, cover: '', children: [ ] }, { title: "\u6d4b\u8bd5\u7ed1\u5b9a\u4e13\u8f91\u8be6\u60c5", url: "", target: "", levels: 0, cover: '', children: [ ] }, { title: "16", url: "", target: "", levels: 0, cover: '', children: [ ] }, ] }, { id: 80381703, title: "New Arrivals", url: "\/", target: "", levels: 2, product0: { id: (null) }, children: [ { title: "Collection", url: "\/", target: "", levels: 1, cover: '', children: [ { title: "\u7d20\u6750\u4e2d\u5fc3\u94fe\u63a5", url: "https:\/\/img.staticdj.com\/7d89f7a7d026a7b78b5cf1054d58e063.png", target: "", levels: 0, }, ] }, { title: "\u5c3a\u7801\u8868", url: "", target: "", levels: 0, cover: '', children: [ ] }, { title: "2", url: "", target: "", levels: 0, cover: '', children: [ ] }, { title: "3", url: "", target: "", levels: 0, cover: '', children: [ ] }, ] }, { id: 80381709, title: "Product", url: "\/", target: "", levels: 2, product0: { id: (null) }, children: [ { title: "jewelry", url: "\/products\/so-and-so", target: "", levels: 1, cover: '', children: [ { title: "\u7279\u6b8at", url: "", target: "", levels: 0, }, ] }, ] }, { id: 83001277, title: "\u67e5\u8be2\u8ba2\u5355", url: "\/account\/order-lookup", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83001279, title: "1111", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83001281, title: "22222", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83010453, title: "33333", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83010455, title: "44444", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83010457, title: "55555", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83010459, title: "66666", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83846927, title: "666666", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, { id: 83846929, title: "33333", url: "", target: "", levels: 0, product0: { id: (null) }, children: [ ] }, ].slice(offset); linkList = formatLinks(linkList); const hasChild = linkList.some(link => !!(link.children && link.children.length || link.product0.id)); for (const item of linkList) { if (item.children?.length > 0) { item.active = 'active'; break; } } return `
${link.title}
${link.tag.label}
${second_link.cover}
${second_link.title}
${second_link.tag.label}
${third_links.title}
${third_links.tag.label}
${link.title}
${link.tag.label}
` })()}
Search
Search
Search
Search
Search
Search
Search
Search
Search
Search
Log in
Create an account
${data.data && data.data.count}
Home
1
7777
4
55
已上架商品
已上架商品
Album
Manual Album
test2
测试子专辑1
测试子专辑2
测试子专辑3
测试子专辑4
测试三级菜单
测试绑定专辑详情
1
2
3
4
5
6
7
8
9
11
13
13
14
15
16
17
177
18
20
19
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
65
56
57
58
59
60
61
111
1111
11111
555
555
555
66666
666
66
Smart Album
test1
查询订单
测试子专辑4
测试绑定专辑详情
16
New Arrivals
Collection
素材中心链接
尺码表
2
3
Product
jewelry
特殊t
查询订单
1111
22222
33333
44444
55555
66666
666666
33333
Search
Search
Search
Search
Search
Log in
(function () { let w = window.innerWidth; function setHeaderCssVar() { const headerEle = document.getElementById( "shoplaza-section-header", ); if (!headerEle) { return; } document.body.style.setProperty( "--window-height", `${window.innerHeight}px`, ); document.body.style.setProperty( "--header-height", `${headerEle.clientHeight}px`, ); const mdScorllHideEle = headerEle.querySelector( ".header__mobile .header__scroll_hide", ); if (mdScorllHideEle) { document.body.style.setProperty( "--header-scroll-hide-height-md", `${mdScorllHideEle.clientHeight}px`, ); } const pcScorllHideEle = headerEle.querySelector( ".header__desktop .header__scroll_hide", ); if (pcScorllHideEle) { document.body.style.setProperty( "--header-scroll-hide-height-pc", `${pcScorllHideEle.clientHeight}px`, ); } } function handlResize() { if (w == window.innerWidth) { return; } w = window.innerWidth; setHeaderCssVar(); } function init() { setHeaderCssVar(); window.removeEventListener("resize", window._theme_header_listener); window._theme_header_listener = handlResize; window.addEventListener("resize", window._theme_header_listener); } init(); })();
Paid benefits
Ways to redeem points
Ways to earn points
(function() { const STATUS = { LOADING: 'loading', FINISH: 'finish' }; const RESULT = { EMPTY: 'data-empty' }; class SPZCustomCartSku extends SPZ.BaseElement { renderData = []; /** * add to cart reselect item, and delete process: * 1. record reselect id before show reselect modal * 2. add to cart success, mark `needDeleteReselectRecord` to true * 3. close reselect modal / drawer * 4. spz-cart re-render, triggered mounted event * 5. call refresh */ // mark delete reselect id recordReselectId = null; // mark should delete reselect record after spz-cart mounted event needDeleteReselectRecord = false; refreshLock = false; addToCartSuccess = false; // cache paused refresh data refreshDataCache = []; // cache similar products data, for manual add to cart similarData = []; constructor(element) { super(element); this.xhr_ = SPZServices.xhrFor(this.win); this.action_ = SPZServices.actionServiceForDoc(this.element); } setupAction_() { this.registerAction('refresh', (invocation) => { const data = invocation && invocation.args && invocation.args.data || {}; this.refresh(data); }); this.registerAction('deleteReselect', SPZCore.Types.debounce( this.win, (invocation) => { this.deleteReselect(invocation?.args?.id); }, 200 )); this.registerAction('deleteInvalid', SPZCore.Types.debounce( this.win, (invocation) => { this.deleteInvalid(invocation?.args?.id); }, 200 )); this.registerAction('setReselectRecordId', (invocation) => { this.setReselectRecordId(invocation?.args?.id); }); this.registerAction('clearNeedReselectRecord', (invocation) => { this.clearNeedReselectRecord(); }); this.registerAction('registerDeleteReselectTask', (invocation) => { this.registerDeleteReselectTask(invocation?.args?.data); }); this.registerAction('lockRefresh', (invocation) => { this.lockRefresh(); }); this.registerAction('releaseRefreshLock', (invocation) => { this.releaseRefreshLock(); }); this.registerAction('manualAddToCart', (invocation) => { this.manualAddToCart(invocation?.args?.id); }); this.registerAction('syncSimilarData', (invocation) => { this.syncSimilarData(invocation?.args?.data); }); // DEBUG this.registerAction('log', (invocation) => { const data = invocation && invocation.args && invocation.args.data || {}; console.log('log', invocation); }); } buildCallback() { this.setupAction_(); } isLayoutSupported(layout) { return true; } /** * 数据去重 * @param {Array} data */ uniq_(data) { const result = []; for(let i = 0; i < data.length; i++) { if(!result.includes(data[i])) { result.push(data[i]); } } return result; } checkRefreshLock() { if (this.refreshLock) { return false; } return true; } setLoading(isLoading) { SPZCore.Dom.toggleAttribute(this.element, STATUS.LOADING, isLoading); SPZCore.Dom.toggleAttribute(this.element, STATUS.FINISH, !isLoading); } setDataResult(data) { const isDataEmpty = !data.reselectSkus.length && !data.invalidSkus.length && !data.line_items.length; SPZCore.Dom.toggleAttribute(this.element, RESULT.EMPTY, isDataEmpty); } // 存在多次请求顺序问题 async refresh(_data) { // 接口失败时返回数据不为对象 if ((typeof _data !== 'object' || !Array.isArray(_data.line_items))) { const newData = { line_items: [], reselectSkus: [], invalidSkus: [], displayInvalidSkus: [] }; this.trigger_('refreshError', newData); this.setLoading(false); return; } if (!this.checkRefreshLock()) { this.setRefreshCache(_data); return; } this.setLoading(true); let data = _data; if (this.needDeleteReselectRecord && this.recordReselectId) { let hasError = false; try { data = await this.deleteReselectRecordBeforeRefresh(_data); } catch (e) { hasError = true; console.error(e); const newData = { ...data, reselectSkus: [], invalidSkus: [], displayInvalidSkus: [] }; this.trigger_('refreshError', newData); this.setLoading(false); this.setDataResult(newData); return; } this.needDeleteReselectRecord = false; if (hasError) { return; } } // 获取失效商品 const invisibleItems = data.ineffectives; // 获取失效商品内仅售罄商品的sku const soldOutItems = invisibleItems.filter(item => item.reason === "line_item_sold_out"); // 通过失效 sku 获取 spu, 注意去重 const soldOutSpuIds = this.uniq_(soldOutItems.map(item => item.product_id)); const querySpuIds = soldOutSpuIds.map(spuId => `ids[]=${spuId}`).join('&'); if (!soldOutSpuIds.length) { const newData = { ...data, reselectSkus: [], invalidSkus: [], displayInvalidSkus: [] }; this.trigger_('refreshSuccess', newData); this.renderData = newData; this.setLoading(false); this.setDataResult(newData); return; } // 请求 spu 下其他 sku 库存 this.xhr_.fetchJson(`/api/product/list?limit=${soldOutSpuIds.length}&${querySpuIds}`) .then(res => { const reselectSkus = []; const invalidSkus = []; // spu 维度展示 const displayInvalidSkus = []; res.data.list.forEach(product => { // spu 匹配, 存在多 sku 情况 const soldOutSkus = soldOutItems.filter(item => item.product_id === product.id); if (!soldOutSkus.length) { return; } // 通过失效 sku 获取 spu 下其他 sku 库存, 存在其他可用库存时标记为 "Reselect" 按钮可用 //const allowReselect = product.variants // .filter(variant => variant.option1 === soldOutProduct.variant.option1 && variant.option2 === soldOutProduct.variant.option2 && variant.option3 === soldOutProduct.variant.option3) // .some(variant => variant.available); // 查询售罄 sku 对应商品是否可加购, 标记为 Reselect 可用项 if (product.available) { reselectSkus.push(...soldOutSkus); // 若商品不可用(全部 sku 售罄), 归纳到失效商品列表 } else { invalidSkus.push(...soldOutSkus); // spu 维度, 仅添加一项 sku displayInvalidSkus.push(soldOutSkus[0]); } }); const newData = { ...data, reselectSkus, invalidSkus, displayInvalidSkus }; this.trigger_('refreshSuccess', newData); this.renderData = newData; this.setLoading(false); this.setDataResult(newData); }) .catch(err => { this.setLoading(false); console.error(err); this.trigger_('refreshError', data); }).finally(() => { }); } async deleteReselect(id, ignoreEmit) { if (!id) { return; } const targetSku = this.renderData.reselectSkus.find(item => item.id === id); try { const res = await this.xhr_.fetchJson(`/api/cart/${targetSku.variant_id}`, { method: 'DELETE', body: { id: targetSku.id, product_id: targetSku.product_id, variant_id: targetSku.variant_id, } }); const newData = { ...this.renderData, reselectSkus: this.renderData.reselectSkus.filter(item => item.id !== id), }; this.renderData = newData; !ignoreEmit && this.trigger_('deleteSuccess', newData); } catch (err) { console.error(err); !ignoreEmit && this.trigger_('deleteError', err); } } deleteInvalid(id) { if (!id) { return; } const targetSku = this.renderData.invalidSkus.find(item => item.id === id); this.xhr_.fetchJson(`/api/cart/${targetSku.variant_id}`, { method: 'DELETE', body: { id: targetSku.id, product_id: targetSku.product_id, variant_id: targetSku.variant_id, } }) .then(res => { const newData = { ...this.renderData, invalidSkus: this.renderData.invalidSkus.filter(item => item.id !== id), displayInvalidSkus: this.renderData.displayInvalidSkus.filter(item => item.id !== id), }; this.trigger_('deleteSuccess', newData); this.renderData = newData; }) .catch(err => { console.error(err); this.trigger_('deleteError', err); }); } // record reselect sku id before show reselect modal setReselectRecordId(id) { if (!id) { return; } this.recordReselectId = id; } async deleteReselectRecordBeforeRefresh(data) { if (!this.recordReselectId) { return; } await this.deleteReselect(this.recordReselectId, true); return { ...data, ineffectives: data.ineffectives.filter(item => item.id !== this.recordReselectId) } } clearNeedReselectRecord() { this.needDeleteReselectRecord = false; } registerDeleteReselectTask(productData) { const targetSku = this.renderData.reselectSkus.find(item => item.id === this.recordReselectId); if (targetSku?.variant_id && productData?.variant.id) { if (targetSku.variant_id === productData?.variant.id) { this.needDeleteReselectRecord = false; return; } } this.needDeleteReselectRecord = true; } // pause cart refresh(trigger by similar products) lockRefresh() { if (this.refreshLock) { return; } this.refreshLock = true; } releaseRefreshLock() { if (!this.refreshLock) { return; } this.refreshLock = false; this.refreshWithCache(); } // direct add_to_cart(trigger by similar products) async manualAddToCart(id) { const target = this.similarData.find(item => item.id === id); this.lockRefresh(); try { const res = await this.xhr_.fetchJson(`/api/cart`, { method: 'POST', body: { note: '', product_id: target.id, quantity: '1', variant_id: target.variants[0].id, refer_info: { source: 'add_to_cart' } } }); const newCartItems = res.data.items; this.setRefreshCache(newCartItems, true); } catch (err) { console.error(err); } } syncSimilarData(data) { this.similarData = data.data; } setRefreshCache(data, patch) { if (patch) { this.refreshDataCache = { ...this.refreshDataCache, line_items: [...this.refreshDataCache.line_items, ...data] }; } else { this.refreshDataCache = data; } } refreshWithCache() { this.refresh(this.refreshDataCache); } mountCallback() { } unmountCallback() { } /** * trigger event * @param {Object} data */ trigger_(name, data) { const event = SPZUtils.Event.create(this.win, `spz-custom-cart-sku.${name}`, { data, }); this.action_.trigger(this.element, name, event); } } SPZ.defineElement('spz-custom-cart-sku', SPZCustomCartSku); }())
(function () { class SPZCustomCartTrack extends SPZ.BaseElement { constructor(element) { super(element); this.action_ = SPZServices.actionServiceForDoc(this.element); } isLayoutSupported(layout) { return true; } buildCallback() { this.setupAction_(); } hash(val) { const hashKey = Object.keys(val).sort((a, b) => a - b).reduce((acc, k) => { acc += `{'${k}':'${val[k]}'}`; return acc; }, ''); return hashKey; } trackExtra(key, value) { console.log('trackExtra...', key, value); if (!window.sa) { return; } const hashKey = this.hash(value); let hasExtraInfo = false; if (window.sa.eventInfo && window.sa.eventInfo[key] && window.sa.eventInfo[key].extra_properties) { hasExtraInfo = window.sa.eventInfo[key].extra_properties.some(p => { return hashKey === this.hash(p); }); } if (hasExtraInfo) { return; } window.sa && window.sa.registerExtraInfo(key, value); } delExtraTrack(key, value) { const hashKey = this.hash(value); if (window.sa.eventInfo && window.sa.eventInfo[key] && window.sa.eventInfo[key].extra_properties) { window.sa.eventInfo[key].extra_properties = window.sa.eventInfo[key].extra_properties.filter(p => hashKey !== this.hash(p)); } } track(key, value) { console.log('tracking...', key, value); window.sa && window.sa.track(key, value); } setupAction_() { this.registerAction('registerReselectAtc', () => { this.trackExtra('add_to_cart', { function_name: 'Farida', action_type: 'reselect' }); }); this.registerAction('clearReselectAtc', () => { this.delExtraTrack('add_to_cart', { function_name: 'Farida', action_type: 'reselect' }); }); this.registerAction('registerSimilarAtc', () => { this.trackExtra('add_to_cart', { function_name: 'Farida', action_type: 'similar_product' }); }); this.registerAction('clearSimilarAtc', () => { this.delExtraTrack('add_to_cart', { function_name: 'Farida', action_type: 'similar_product' }); }); const clickParams = { business_type: 'product_plugin', event_name: 'function_click', function_name: 'Farida', plugin_name: 'Farida', template_name: 'cart', template_type: '13', module: 'online_store', module_type: 'online_store', tab_name: '', card_name: '', event_developer: 'ccbken', event_type: 'click', }; this.registerAction('trackDelReselect', () => { this.track('function_click', { ...clickParams, event_info: JSON.stringify({ action_type: 'cart_delete', element_type: 'sku' }) }); }); this.registerAction('trackClickReselect', () => { this.track('function_click', { ...clickParams, event_info: JSON.stringify({ action_type: 'reselect', element_type: 'sku' }) }); }); this.registerAction('trackDelSimilar', () => { this.track('function_click', { ...clickParams, event_info: JSON.stringify({ action_type: 'cart_delete', element_type: 'spu' }) }); }); this.registerAction('trackClickSimilar', () => { this.track('function_click', { ...clickParams, event_info: JSON.stringify({ action_type: 'reselect', element_type: 'spu' }) }); }); this.registerAction('trackOpenSimilar', () => { this.track('function_expose', { ...clickParams, event_name: 'function_expose', event_type: 'expose', event_info: JSON.stringify({ popup_name: 'farida_product_popup' }) }); }); } } SPZ.defineElement('spz-custom-cart-track', SPZCustomCartTrack); }())
Cart ${function() { const show = data && data.line_items && data.line_items.length > 0; const count = show ? data.line_items.reduce((acc, line) => { acc += parseInt(line.quantity); return acc; }, 0) : 0; return `
(${count})
`; }()}
Invalid
(${data.invalidSkus.length})
Sold out
${item.product_title}
${item.options.map(option => option.value).join('/')}
${propertie.name}/${propertie.isImage ? `
View image
` : propertie.value}
Free gift
Mixed Lot
${item.item_text}
Similar products
Similar products
${item.product_title}
${item.options.map(option => option.value).join('/')}
${propertie.name}/${propertie.isImage ? `
View image
` : propertie.value}
Free gift
Mixed Lot
*${item.quantity}
${item.item_text}
${discount_item.title}
(-
)
${item.product_title}
${item.options.map(option => option.value).join('/')}
${propertie.name}/${propertie.isImage ? `
View image
` : propertie.value}
Free gift
Mixed Lot
${item.item_text}
Reselect
Reselect product specialfications
Reselect
Reselect product specialfications
Your shopping cart is empty
Continue shopping
Total:
${function() { const textArray = ("Save {{save_amount}}").split(/\{\{\s*save_amount\}\}/); if (textArray.length > 0 && textArray.length < 2) { textArray.push(''); } return textArray.map((text, index) => { if (index == 0) { return `
${text}
`; } return `
${text}
`; }).join(''); }()}
${function() { const textArray = ("Save {{save_amount}}").split(/\{\{\s*save_amount\}\}/); if (textArray.length > 0 && textArray.length < 2) { textArray.push(''); } return textArray.map((text, index) => { if (index == 0) { return `
${text}
`; } return `
${text}
`; }).join(''); }()}
${discount_application.title}:
-
${data.invalid_msg}
Taxes and shipping cost are calculated at checkout
Check out
${data.invalid_msg}
Total:
${function() { const textArray = ("Save {{save_amount}}").split(/\{\{\s*save_amount\}\}/); if (textArray.length > 0 && textArray.length < 2) { textArray.push(''); } return textArray.map((text, index) => { if (index == 0) { return `
${text}
`; } return `
${text}
`; }).join(''); }()}
${function() { const textArray = ("Save {{save_amount}}").split(/\{\{\s*save_amount\}\}/); if (textArray.length > 0 && textArray.length < 2) { textArray.push(''); } return textArray.map((text, index) => { if (index == 0) { return `
${text}
`; } return `
${text}
`; }).join(''); }()}
${function() { const textArray = ("Save {{save_amount}}").split(/\{\{\s*save_amount\}\}/); if (textArray.length > 0 && textArray.length < 2) { textArray.push(''); } return textArray.map((text, index) => { if (index == 0) { return `
${text}
`; } return `
${text}
`; }).join(''); }()}
${discount_application.title}:
-
Check out
${data.invalid_msg}
Check out
Taxes and shipping cost are calculated at checkout
Subtotal:
Save:
-
${discount_application.title}:
-
Total:
Check out
Taxes and shipping cost are calculated at checkout
const summaryStickyRender = document.querySelector('#cart-drawer-summary-sticky-render'); if (summaryStickyRender) { document.body.style.setProperty('--cart-drawer-summary-sticky-height', summaryStickyRender.clientHeight + 'px'); }
${function() { const currentProduct = data.product; // fix default selected variant let selected = {}; if (!(data.selectedOptions || []).length) { const selectedVariant = currentProduct.variants.find(v => v.available) || currentProduct.variants[0]; if (selectedVariant) { selectedVariant.options.forEach((option, idx) => { if (!selected[option.name]) { selected[option.name] = []; } if (selected[option.name].indexOf(option.value) === -1) { selected[option.name].push(option.value); } }); } } else { selected = selected.reduce((acc, item) => { acc[item.name] = item.value; return acc; }, {}); } return (currentProduct.options || []).map((option, index) => { const optionName = option.name || ''; const position = `option${index + 1}`; const isThumbImage = !!option.showThumbImage; const variantType = "button"; const thumbStyle = "image_with_text"; const getThumbImage = (value) => { const options = data.product.options || []; const option = options.find(o => o.name === optionName); if (option.thumbImages) { const thumbImage = option.thumbImages.find(t => t.value === value); if (thumbImage && thumbImage.image) { return { src: thumbImage.image.src, alt: thumbImage.image.alt }; } } return {src: '', alt: ''}; }; return `
${optionName}:
${selected[optionName] && selected[optionName].length && selected[optionName][0]}
${option.values.map((value, idx) => { return `
${value}
` }).join('')}
${optionName}
${option.values.map(value => { const selected = data.selectedValues[optionName] == value ? 'selected' : ''; return `
${value}
` }).join('')}
` }).join(''); }()}
${data.value}
${data.index + 1}/${data.total}
${Array(data.total).fill(0).map((num, index) => { return `
`; }).join('')}
${function(){ const wholesale_enabled = true; const qty = data.quantity || 1; const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const productVariant = null; const variantData = currentSelectVariant || defaultVariant || productVariant; const wholesale_price = variantData.wholesale_price || []; if(wholesale_enabled && wholesale_price.length > 0) { let wholesaleIndex = wholesale_price.findIndex(item => { return item.min_quantity > qty; }); if(wholesaleIndex < 0){ wholesaleIndex = wholesale_price.length - 1; }else if(wholesaleIndex > 0){ wholesaleIndex = wholesaleIndex - 1; } const wholesalePrice = wholesale_price[wholesaleIndex] || ''; return `
` }else { const price = variantData && variantData.price; return price != undefined ? `
` : '
'; } }()}
${function() { const selectedVariant = data.variant; const isSoldOut = ((selectedVariant && !selectedVariant.available) || (!selectedVariant && !productData.available)); const statusLan = isSoldOut ? "Sold out" : "Add to cart"; return `
${statusLan}
`; }()}
const summaryStickyRender = document.querySelector('#cart-reselect-drawer-summary-sticky-render'); if (summaryStickyRender) { document.body.style.setProperty('--cart-reselect-drawer-summary-sticky-height', summaryStickyRender.clientHeight + 'px'); }
Back
${function(){ const productData = data.product; const product_options = productData.options.filter(Boolean) || []; const selectedVariant = productData.variants.find(v => v.available) || productData.variants[0]; const statusLan = ((selectedVariant && !selectedVariant.available) || (!selectedVariant && !productData.available)) ? "Sold out" : "Add to cart"; const mobSelectedVariant = productData.variants.find(v => v.available) || productData.variants[0]; const mobInitialSlideIndex = productData.images.findIndex((item) => item.src === selectedVariant.image.src); const mobImages = productData.images; const mobImageSize = productData.images.length; const stickyEvent = "cart-reselect-drawer-summary-sticky-render.toggleClass(class='visible', force=false);cart-reselect-drawer-summary-sticky-compensation-container.toggleClass(class='visible', force=false);cart-reselect-drawer-observer.restart();cart-reselect-drawer-summary-sticky-render.rerender(data=event);"; return `
${function() { const force_image_size = 'natural'; const thumbnailPosition = 'below'; const selectedVariant = data.product.variants.find(v => v.available) || data.product.variants[0]; const initialSlideIndex = data.product.images.findIndex((item) => item.src === selectedVariant.image.src); const images = data.product.images; const imageSize = data.product.images.length; return `
${data.product.images.map((item, index0) => { const extra = index0 === initialSlideIndex ? 'ssr size-ratio="2"' : ''; return `
`; }).join('')}
${imageSize > 1 ? `
${images.map((index1) => { return `
`; }).join('')}
` : ''}
${imageSize > 1 ? `
${images.map((imageItem, index1) => { const extra2 = initialSlideIndex == index1 ? 'selected' : ''; return`
`; }).join('')}
` : ''}`; }()}
${productData.title}
${productData.title}
Quantity
Mixed Lot
${statusLan}
`; }()}
${function(){ const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const variantData = currentSelectVariant || defaultVariant || data; const retail_price = variantData.retail_price || 0; return `
Retail
` }()}
${function(){ const wholesale_enabled = true; const qty = data.quantity || 1; const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const productVariant = null; const variantData = currentSelectVariant || defaultVariant || productVariant; const wholesale_price = variantData.wholesale_price || []; if(wholesale_enabled && wholesale_price.length > 0) { let wholesaleIndex = wholesale_price.findIndex(item => { return item.min_quantity > qty; }); if(wholesaleIndex < 0){ wholesaleIndex = wholesale_price.length - 1; }else if(wholesaleIndex > 0){ wholesaleIndex = wholesaleIndex - 1; } const wholesalePrice = wholesale_price[wholesaleIndex] || ''; return `
` }else { const price = variantData && variantData.price; return price != undefined ? `
` : '
'; } }()}
${function() { const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const productVariant = null; const variantData = currentSelectVariant || defaultVariant || productVariant; const wholesalePrice = variantData.wholesale_price || []; const wholesaleQuantity = +data.quantity || 0; let hasHighlight = false; return `
${wholesalePrice.map((item, index) => { const nextWholesale = wholesalePrice[index + 1] || {}; let isHighlight = false; let quantity_html = ''; if(wholesalePrice.length > (index + 1)){ quantity_html = item.min_quantity + "-" + (nextWholesale.min_quantity - 1); if( wholesaleQuantity < +nextWholesale.min_quantity && !hasHighlight ){ isHighlight = true; hasHighlight = true; }; }else{ quantity_html = ">=" + item.min_quantity; if( !hasHighlight ){ isHighlight = true; hasHighlight = true; }; }; return `
${quantity_html}
Pieces
` }).join('')}
`; }()}
You may also like
${(function(){ const get_random_six_digits = () => { return Math.random().toString().slice(-6) }; const wholesale_enabled = true; const setting_product_image_display = "natural"; const product_image = data.image; const secondary_image = data.secondImage; const image_width = product_image.width; let image_height = product_image.height; if(setting_product_image_display == '100%'){ image_height = image_width; }else if(setting_product_image_display == '133.33%'){ image_height = image_width * 1.3333; }; let product_image_hover_on = false; const has_save_label = true && ((+data.compare_at_price) > (+data.price)); const is_single_variant = data.variants.length == 1; const min_price_variant_href = (data.min_price_variant && data.min_price_variant.available) ? data.min_price_variant.withinUrl : data.withinUrl; const retail_price_max = data.retail_price_max || data.compare_at_price_max; const THUMBNAILS_MAX_SIZE = 3; const thumbnails = data.thumbVariants.slice(0, THUMBNAILS_MAX_SIZE); const image_wrap_id = 'image_wrap_' + get_random_six_digits(); const image_carousel_id = 'image_carousel_' + get_random_six_digits(); const thumbnails_selector_id = 'thumbnails_selector_' + get_random_six_digits(); const form_id = 'form_' + get_random_six_digits(); const mixed_wholesale = data.mixed_wholesale; let atc_handler = ''; if (data.has_only_default_variant) { atc_handler = `custom-cart-drawer-sku.manualAddToCart(id=${data.id});add-card-toast-success.showToast(content='Added successfully');`; } else { atc_handler = `cart-invalid-drawer-quick-shop-render.render(src='/api/products/${data.id}',redo=true);cart-invalid-product-detail-drawer.open();`; } return `
Mixed Lot
${data.title}
-
Retail
+${data.remainInvisibleThumbCount}
` })()}
${function() { const isEmpty = data && data.length === 0; if (isEmpty) { return `
oops! There are currently no similar products in the store
`; } return `
`; }()}
Back
${Array(data.total).fill(0).map((num, index) => { return `
`; }).join('')}
${function() { let variantImageShowed = false; const currentProduct = data.product; // fix default selected variant let selectedValues = data.selectedValues; if (Object.keys(data.selectedValues.length === 0)) { const selectedVariant = currentProduct.variants.find(v => v.available) || currentProduct.variants[0]; if (selectedVariant) { selectedVariant.options.forEach((option, idx) => { if (!selectedValues[option.name]) { selectedValues[option.name] = []; } if (selectedValues[option.name].indexOf(option.value) === -1) { selectedValues[option.name].push(option.value); } }); } } return (currentProduct.options || []).map((option, index) => { const optionName = option.name || ''; const position = `option${index + 1}`; let isThumbImage = false; if (currentProduct.need_variant_image && !variantImageShowed) { const variantNames = ["color"] || []; for (let i = 0, len = variantNames.length; i < len; i++) { const name = variantNames[i].toLowerCase(); if (name === optionName.toLowerCase()) { isThumbImage = true; variantImageShowed = true; } } } const variantType = "button"; const thumbStyle = "image_with_text"; return `
${optionName}:
${option.values.map((value, idx) => { const selected = data.selectedValues[optionName] == value ? 'checked' : ''; let thumbImage = null; if (isThumbImage) { const variants = currentProduct.variants; for (let i = 0, len = variants.length; i < len; i++) { const variant = variants[i]; if (variant[position] == value && thumbImage == null) { thumbImage = variant.image; break; } } } return `
${value}
` }).join('')}
${optionName}
${option.values.map(value => { const selected = data.selectedValues[optionName] == value ? 'selected' : ''; return `
${value}
` }).join('')}
` }).join(''); }()}
${data.originData && data.originData.value || data.value}
${function() { const variantData = data.variant || data.product.variants.find(v => v.available) || data.product.variants[0]; const saveType = "amount"; const productLabelDiscountOn = true; return `
${saveType == 'percentage' ? `-${variantData.off_ratio}%` : `
-
` }
`; }()}
See detail
${function(){ const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const variantData = currentSelectVariant || defaultVariant || data; const retail_price = variantData.retail_price || 0; return `
Retail
` }()}
${function(){ const wholesale_enabled = true; const qty = data.quantity || 1; const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const productVariant = null; const variantData = currentSelectVariant || defaultVariant || productVariant; const wholesale_price = variantData.wholesale_price || []; if(wholesale_enabled && wholesale_price.length > 0) { let wholesaleIndex = wholesale_price.findIndex(item => { return item.min_quantity > qty; }); if(wholesaleIndex < 0){ wholesaleIndex = wholesale_price.length - 1; }else if(wholesaleIndex > 0){ wholesaleIndex = wholesaleIndex - 1; } const wholesalePrice = wholesale_price[wholesaleIndex] || ''; return `
` }else { const price = variantData && variantData.price; return price != undefined ? `
` : '
'; } }()}
${function() { const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const productVariant = null; const variantData = currentSelectVariant || defaultVariant || productVariant; const wholesalePrice = variantData.wholesale_price || []; const wholesaleQuantity = +data.quantity || 0; let hasHighlight = false; return `
${wholesalePrice.map((item, index) => { const nextWholesale = wholesalePrice[index + 1] || {}; let isHighlight = false; let quantity_html = ''; if(wholesalePrice.length > (index + 1)){ quantity_html = item.min_quantity + "-" + (nextWholesale.min_quantity - 1); if( wholesaleQuantity < +nextWholesale.min_quantity && !hasHighlight ){ isHighlight = true; hasHighlight = true; }; }else{ quantity_html = ">=" + item.min_quantity; if( !hasHighlight ){ isHighlight = true; hasHighlight = true; }; }; return `
${quantity_html}
Pieces
` }).join('')}
`; }()}
${function(){ const wholesale_enabled = true; const qty = data.quantity || 1; const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const productVariant = null; const variantData = currentSelectVariant || defaultVariant || productVariant; const wholesale_price = variantData.wholesale_price || []; if(wholesale_enabled && wholesale_price.length > 0) { let wholesaleIndex = wholesale_price.findIndex(item => { return item.min_quantity > qty; }); if(wholesaleIndex < 0){ wholesaleIndex = wholesale_price.length - 1; }else if(wholesaleIndex > 0){ wholesaleIndex = wholesaleIndex - 1; } const wholesalePrice = wholesale_price[wholesaleIndex] || ''; return `
` }else { const price = variantData && variantData.price; return price != undefined ? `
` : '
'; } }()}
${function() { const selectedVariant = data.variant; const isSoldOut = ((selectedVariant && !selectedVariant.available) || (!selectedVariant && !productData.available)); const statusLan = isSoldOut ? "Sold out" : "Add to cart"; return `
${statusLan}
`; }()}
const summaryStickyRender = document.querySelector('#cart-invalid-drawer-quick-shop-summary-sticky-render'); if (summaryStickyRender) { document.body.style.setProperty('--cart-product-drawer-summary-sticky-height', summaryStickyRender.clientHeight + 'px'); }
${function() { const variantData = data.variant || data.product.variants.find(v => v.available) || data.product.variants[0]; const saveType = "amount"; const productLabelDiscountOn = true; return `
${saveType == 'percentage' ? `-${variantData.off_ratio}%` : `
-
` }
`; }()}
See detail
${function(){ const productData = data.product; let product_change_event = '', mouse_over_event = ' ', mouse_out_event = ''; const product_options = productData.options.filter(Boolean) || []; for (let opt of product_options) { product_change_event = product_change_event + `cart-invalid-drawer-quick-shop-selected-variant-${opt.name}.rerender(data=event.selectedValues.${opt.name});`; mouse_out_event = mouse_out_event + `cart-invalid-drawer-quick-shop-selected-variant-${opt.name}.rerender(data=event.selectData.${opt.name});`; mouse_over_event = mouse_over_event + `@${opt.name}Mouseover="cart-invalid-drawer-quick-shop-selected-variant-${opt.name}.rerender(data=event);"`; } const selectedVariant = productData.variants.find(v => v.available) || productData.variants[0]; const statusLan = ((selectedVariant && !selectedVariant.available) || (!selectedVariant && !productData.available)) ? "Sold out" : "Add to cart"; const mobSelectedVariant = productData.variants.find(v => v.available) || productData.variants[0]; const mobInitialSlideIndex = productData.images.findIndex((item) => item.src === selectedVariant.image.src); const mobImages = productData.images; const mobImageSize = productData.images.length; const stickyEvent = "cart-invalid-drawer-quick-shop-summary-sticky-render.toggleClass(class='visible', force=false);cart-invalid-drawer-quick-shop-summary-sticky-compensation-container.toggleClass(class='visible', force=false);cart-invalid-drawer-quick-shop-observer.restart();cart-invalid-drawer-quick-shop-summary-sticky-render.rerender(data=event);"; return `
${function() { const force_image_size = 'natural'; const thumbnailPosition = 'below'; const selectedVariant = data.product.variants.find(v => v.available) || data.product.variants[0]; let initialSlideIndex = data.product.images.findIndex((item) => item.src === selectedVariant.image.src); if (initialSlideIndex === -1) { initialSlideIndex = 0; } const images = data.product.images; const imageSize = data.product.images.length; console.log('cart-product-drawer product images render', data, selectedVariant, initialSlideIndex, images, imageSize); return `
${images.map((item, index0) => { const extra = index0 === initialSlideIndex ? 'ssr size-ratio="2"' : ''; return `
`; }).join('')}
${imageSize > 1 ? `
${images.map((index1) => { return `
`; }).join('')}
` : ''}
${imageSize > 1 ? `
${images.map((imageItem, index1) => { const extra2 = initialSlideIndex == index1 ? 'selected' : ''; return`
`; }).join('')}
` : ''}`; }()}
${productData.title}
${productData.title}
Quantity
Mixed Lot
${statusLan}
`; }()}
View Cart
${function(){ const productData = data.product; const product_options = productData.options.filter(Boolean) || []; const selectedVariant = productData.variants.find(v => v.available) || productData.variants[0]; const statusLan = ((selectedVariant && !selectedVariant.available) || (!selectedVariant && !productData.available)) ? "Sold out" : "Add to cart"; return `
Quantity
Mixed Lot
${statusLan}
` }()}
${function(){ const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const variantData = currentSelectVariant || defaultVariant || data; const retail_price = variantData.retail_price || 0; return `
Retail
` }()}
${function(){ const wholesale_enabled = true; const qty = data.quantity || 1; const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const productVariant = null; const variantData = currentSelectVariant || defaultVariant || productVariant; const wholesale_price = variantData.wholesale_price || []; if(wholesale_enabled && wholesale_price.length > 0) { let wholesaleIndex = wholesale_price.findIndex(item => { return item.min_quantity > qty; }); if(wholesaleIndex < 0){ wholesaleIndex = wholesale_price.length - 1; }else if(wholesaleIndex > 0){ wholesaleIndex = wholesaleIndex - 1; } const wholesalePrice = wholesale_price[wholesaleIndex] || ''; return `
` }else { const price = variantData && variantData.price; return price != undefined ? `
` : '
'; } }()}
${function() { const currentSelectVariant = data.variant; const defaultVariant = (data.product && data.product.variants && data.product.variants[0]); const productVariant = null; const variantData = currentSelectVariant || defaultVariant || productVariant; const wholesalePrice = variantData.wholesale_price || []; const wholesaleQuantity = +data.quantity || 0; let hasHighlight = false; return `
${wholesalePrice.map((item, index) => { const nextWholesale = wholesalePrice[index + 1] || {}; let isHighlight = false; let quantity_html = ''; if(wholesalePrice.length > (index + 1)){ quantity_html = item.min_quantity + "-" + (nextWholesale.min_quantity - 1); if( wholesaleQuantity < +nextWholesale.min_quantity && !hasHighlight ){ isHighlight = true; hasHighlight = true; }; }else{ quantity_html = ">=" + item.min_quantity; if( !hasHighlight ){ isHighlight = true; hasHighlight = true; }; }; return `
${quantity_html}
Pieces
` }).join('')}
`; }()}
${function(){ return data.product.options.map((option, index) => { const optionName = option.name || ''; const optionId = option.id || ''; let isThumbImage = !!option.showThumbImage; const thumbStyle = "image_with_text"; const variantType = "button"; const isSelected = (value) => { const selected = (data.selectedOptions || []).find(v => v.name === optionName); return selected && selected.value.length && selected.value[0] == value; }; const getThumbImage = (value) => { const options = data.product.options || []; const option = options.find(o => o.name === optionName); if (option.thumbImages) { const thumbImage = option.thumbImages.find(t => t.value === value); if (thumbImage && thumbImage.image) { return { src: thumbImage.image.src, alt: thumbImage.image.alt }; } } return {src: '', alt: ''}; }; return `
${optionName}:
${data.selectedOptions && data.selectedOptions.length && data.selectedOptions.find(v => v.name === optionName).value[0]}
${option.values.map((value, idx) => { return `
${value}
`; }).join('')}
${optionName}
${option.values.map(value => { const selected = data.selectedValues[optionName] == value ? 'selected' : ''; return `
${value}
` }).join('')}
` }).join(''); }()}
${data.value}