$product = {"id":7164414853219,"title":"iPhone 15 Clear (MagSafe 兼容) Snoopy 史努比 Chill moment","handle":"iphone-15-jellytint-magsafe-pl58","description":null,"published_at":"2024-01-30T23:28:48+08:00","created_at":"2024-01-30T23:28:31+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師JellyTint專區-Snoopy 史努比","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-snoopy","device-iPhone 15","merge","reseller-snoopy"],"price":168000,"price_min":168000,"price_max":168000,"available":true,"price_varies":false,"compare_at_price":null,"compare_at_price_min":0,"compare_at_price_max":0,"compare_at_price_varies":false,"variants":[{"id":41237528313955,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MCN012950G-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580609101923,"product_id":7164414853219,"position":14,"created_at":"2026-04-02T11:23:42+08:00","updated_at":"2026-04-02T11:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd_57f21268-b791-408c-a084-9067b9ac2daf.webp?v=1775100224","variant_ids":[41237528313955]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) Snoopy 史努比 Chill moment - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":168000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950G-PL58","featured_media":{"alt":null,"id":27113230696547,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd_57f21268-b791-408c-a084-9067b9ac2daf.webp?v=1775100224"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41237528346723,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"MCN012950H-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580608839779,"product_id":7164414853219,"position":13,"created_at":"2026-04-02T11:23:42+08:00","updated_at":"2026-04-02T11:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59695bd81f2bbc41c092bbce37c6ab58d8b84305_6071a5f0-4d6e-471a-88bd-4958cd118312.webp?v=1775100224","variant_ids":[41237528346723]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) Snoopy 史努比 Chill moment - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":168000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950H-PL58","featured_media":{"alt":null,"id":27113230434403,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59695bd81f2bbc41c092bbce37c6ab58d8b84305_6071a5f0-4d6e-471a-88bd-4958cd118312.webp?v=1775100224"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41237528412259,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"MCN012950J-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580608675939,"product_id":7164414853219,"position":12,"created_at":"2026-04-02T11:23:41+08:00","updated_at":"2026-04-02T11:23:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ee46061836f6529a2414a671af0a18bee45400f_5a15f3e8-1c94-41d1-80b7-4f9c50f9cb21.webp?v=1775100223","variant_ids":[41237528412259]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) Snoopy 史努比 Chill moment - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":168000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950J-PL58","featured_media":{"alt":null,"id":27113230270563,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ee46061836f6529a2414a671af0a18bee45400f_5a15f3e8-1c94-41d1-80b7-4f9c50f9cb21.webp?v=1775100223"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b335cf2825f92366a7b4ef804ca9245c33245a2c_3dfe481b-3b84-40cb-bbe2-755be313dcd0.webp?v=1706628514","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/031e1c76b5803eb246035e9f257897892b698919_5a2f3ef0-c03a-4690-acf4-0bf47bd83ae3.webp?v=1706628517","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02ab8ed1d4fb218b59a33b54a072524f2de29c94_5f006113-b4cc-4f5d-a60b-56d9004d33fc.webp?v=1706628519","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6be59a63c0d3cd386896690d8989d49b0233a39_bf5e1338-16f7-4510-b127-09ce3083aba4.webp?v=1706628522","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e4d5388e373b27ab86c7765d698ada3ab38b5b3_3085e2cf-9b32-44ab-8331-bd58de0c9f8e.webp?v=1706628525","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/299b36e164543b873e918dae818c838890215eae_b71c550a-737b-43bb-b898-bed7ec1fd0fa.webp?v=1706628528","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd.webp?v=1774939416","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59695bd81f2bbc41c092bbce37c6ab58d8b84305.webp?v=1774939416","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ee46061836f6529a2414a671af0a18bee45400f.webp?v=1774939417","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c85b75eba21684f5f3d9b28a8b3b207b744b17fd.webp?v=1774939418","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c85b75eba21684f5f3d9b28a8b3b207b744b17fd_cc65ee54-f574-4646-a420-c0a24c43e86c.webp?v=1775100222","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ee46061836f6529a2414a671af0a18bee45400f_5a15f3e8-1c94-41d1-80b7-4f9c50f9cb21.webp?v=1775100223","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59695bd81f2bbc41c092bbce37c6ab58d8b84305_6071a5f0-4d6e-471a-88bd-4958cd118312.webp?v=1775100224","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd_57f21268-b791-408c-a084-9067b9ac2daf.webp?v=1775100224"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b335cf2825f92366a7b4ef804ca9245c33245a2c_3dfe481b-3b84-40cb-bbe2-755be313dcd0.webp?v=1706628514","options":["color"],"media":[{"alt":null,"id":23240305672291,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b335cf2825f92366a7b4ef804ca9245c33245a2c_3dfe481b-3b84-40cb-bbe2-755be313dcd0.webp?v=1706628514"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b335cf2825f92366a7b4ef804ca9245c33245a2c_3dfe481b-3b84-40cb-bbe2-755be313dcd0.webp?v=1706628514","width":2000},{"alt":null,"id":23240306131043,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/031e1c76b5803eb246035e9f257897892b698919_5a2f3ef0-c03a-4690-acf4-0bf47bd83ae3.webp?v=1706628517"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/031e1c76b5803eb246035e9f257897892b698919_5a2f3ef0-c03a-4690-acf4-0bf47bd83ae3.webp?v=1706628517","width":2000},{"alt":null,"id":23240306688099,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02ab8ed1d4fb218b59a33b54a072524f2de29c94_5f006113-b4cc-4f5d-a60b-56d9004d33fc.webp?v=1706628519"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/02ab8ed1d4fb218b59a33b54a072524f2de29c94_5f006113-b4cc-4f5d-a60b-56d9004d33fc.webp?v=1706628519","width":2000},{"alt":null,"id":23240307277923,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6be59a63c0d3cd386896690d8989d49b0233a39_bf5e1338-16f7-4510-b127-09ce3083aba4.webp?v=1706628522"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6be59a63c0d3cd386896690d8989d49b0233a39_bf5e1338-16f7-4510-b127-09ce3083aba4.webp?v=1706628522","width":2000},{"alt":null,"id":23240307769443,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e4d5388e373b27ab86c7765d698ada3ab38b5b3_3085e2cf-9b32-44ab-8331-bd58de0c9f8e.webp?v=1706628525"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e4d5388e373b27ab86c7765d698ada3ab38b5b3_3085e2cf-9b32-44ab-8331-bd58de0c9f8e.webp?v=1706628525","width":2000},{"alt":null,"id":23240308228195,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/299b36e164543b873e918dae818c838890215eae_b71c550a-737b-43bb-b898-bed7ec1fd0fa.webp?v=1706628528"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/299b36e164543b873e918dae818c838890215eae_b71c550a-737b-43bb-b898-bed7ec1fd0fa.webp?v=1706628528","width":2000},{"alt":null,"id":27102284611683,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd.webp?v=1774939416"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd.webp?v=1774939416","width":2000},{"alt":null,"id":27102284808291,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59695bd81f2bbc41c092bbce37c6ab58d8b84305.webp?v=1774939416"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59695bd81f2bbc41c092bbce37c6ab58d8b84305.webp?v=1774939416","width":2000},{"alt":null,"id":27102284972131,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ee46061836f6529a2414a671af0a18bee45400f.webp?v=1774939417"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ee46061836f6529a2414a671af0a18bee45400f.webp?v=1774939417","width":2000},{"alt":null,"id":27102285201507,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c85b75eba21684f5f3d9b28a8b3b207b744b17fd.webp?v=1774939418"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c85b75eba21684f5f3d9b28a8b3b207b744b17fd.webp?v=1774939418","width":2000},{"alt":null,"id":27113230073955,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c85b75eba21684f5f3d9b28a8b3b207b744b17fd_cc65ee54-f574-4646-a420-c0a24c43e86c.webp?v=1775100222"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c85b75eba21684f5f3d9b28a8b3b207b744b17fd_cc65ee54-f574-4646-a420-c0a24c43e86c.webp?v=1775100222","width":2000},{"alt":null,"id":27113230270563,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ee46061836f6529a2414a671af0a18bee45400f_5a15f3e8-1c94-41d1-80b7-4f9c50f9cb21.webp?v=1775100223"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ee46061836f6529a2414a671af0a18bee45400f_5a15f3e8-1c94-41d1-80b7-4f9c50f9cb21.webp?v=1775100223","width":2000},{"alt":null,"id":27113230434403,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59695bd81f2bbc41c092bbce37c6ab58d8b84305_6071a5f0-4d6e-471a-88bd-4958cd118312.webp?v=1775100224"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59695bd81f2bbc41c092bbce37c6ab58d8b84305_6071a5f0-4d6e-471a-88bd-4958cd118312.webp?v=1775100224","width":2000},{"alt":null,"id":27113230696547,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd_57f21268-b791-408c-a084-9067b9ac2daf.webp?v=1775100224"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd_57f21268-b791-408c-a084-9067b9ac2daf.webp?v=1775100224","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":41237528313955,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MCN012950G-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580609101923,"product_id":7164414853219,"position":14,"created_at":"2026-04-02T11:23:42+08:00","updated_at":"2026-04-02T11:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd_57f21268-b791-408c-a084-9067b9ac2daf.webp?v=1775100224","variant_ids":[41237528313955]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) Snoopy 史努比 Chill moment - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":168000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950G-PL58","featured_media":{"alt":null,"id":27113230696547,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd_57f21268-b791-408c-a084-9067b9ac2daf.webp?v=1775100224"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41237528346723,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"MCN012950H-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580608839779,"product_id":7164414853219,"position":13,"created_at":"2026-04-02T11:23:42+08:00","updated_at":"2026-04-02T11:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59695bd81f2bbc41c092bbce37c6ab58d8b84305_6071a5f0-4d6e-471a-88bd-4958cd118312.webp?v=1775100224","variant_ids":[41237528346723]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) Snoopy 史努比 Chill moment - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":168000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950H-PL58","featured_media":{"alt":null,"id":27113230434403,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59695bd81f2bbc41c092bbce37c6ab58d8b84305_6071a5f0-4d6e-471a-88bd-4958cd118312.webp?v=1775100224"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41237528412259,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"MCN012950J-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580608675939,"product_id":7164414853219,"position":12,"created_at":"2026-04-02T11:23:41+08:00","updated_at":"2026-04-02T11:23:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ee46061836f6529a2414a671af0a18bee45400f_5a15f3e8-1c94-41d1-80b7-4f9c50f9cb21.webp?v=1775100223","variant_ids":[41237528412259]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) Snoopy 史努比 Chill moment - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":168000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950J-PL58","featured_media":{"alt":null,"id":27113230270563,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ee46061836f6529a2414a671af0a18bee45400f_5a15f3e8-1c94-41d1-80b7-4f9c50f9cb21.webp?v=1775100223"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":41237528313955,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MCN012950G-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580609101923,"product_id":7164414853219,"position":14,"created_at":"2026-04-02T11:23:42+08:00","updated_at":"2026-04-02T11:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd_57f21268-b791-408c-a084-9067b9ac2daf.webp?v=1775100224","variant_ids":[41237528313955]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) Snoopy 史努比 Chill moment - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":168000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950G-PL58","featured_media":{"alt":null,"id":27113230696547,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a05bde26c3f12e78a2a0d9077e1f60740b6dddd_57f21268-b791-408c-a084-9067b9ac2daf.webp?v=1775100224"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null var sellingStatus if ($bumper) { $(document).ready(function() { var productImg = $product.images[0] var bumperVariants = $bumper.variants; var bumperColors = new Object(); var currentVariant = ''; var productType = ''; bumperVariants.forEach(variant => { bumperColors[`${variant.title.split(' (')[0].toLowerCase()}`] = variant.featured_image.src; }); if (productType === 'mod-nx-backplate' || productType === 'mod-backplate') { mergeImages( [productImg, bumperColors[currentVariant]], { crossOrigin: 'anonymous' } ).then(mergedImg => { $('.merged-img').attr('src', mergedImg); }); } else { mergeImages( [bumperColors[currentVariant], productImg], { crossOrigin: 'anonymous' } ).then(mergedImg => { $('.merged-img').attr('src', mergedImg); }); } }); }; var sellingStatusData window.fetchSellingStatus().then(data => { try { sellingStatusData = data; } catch (error) { sellingStatusData = null console.error('Unable to parse selling status', error) } $(document).ready(function() { handleSellingStatus($defaultVariant.sku); }); }) function handleSellingStatus(currentSku) { if (!sellingStatusData) { console.error('No selling status available!') return } const sellingStatusElement = document.getElementById('selling-status') const addToCartButton = document.getElementById('AddToCart-product-template') const currentProductSku = currentSku.replace(/-(.*)$/, '-') if ($variants) { const flattenedSellingStatus = [...sellingStatusData.pending, ...sellingStatusData.preorder] const matchSellingStatusProduct = flattenedSellingStatus.filter(product => currentProductSku === product.sku) if (matchSellingStatusProduct.length > 0) { const isProductPending = matchSellingStatusProduct[0].status === 'pending' const matchDate = matchSellingStatusProduct[0].date sellingStatus = isProductPending ? "缺貨中" : "預購完成出貨日:" + matchDate sellingStatusElement.textContent = sellingStatus if (sellingStatus.includes("缺貨中")){ addToCartButton.disabled ='true'; addToCartButton.textContent = "缺貨中無法加入購物車" } else { addToCartButton.textContent = "加到購物車" } } else { sellingStatusElement.textContent = '' addToCartButton.textContent = "加到購物車" }; }; }; document.addEventListener('DOMContentLoaded', function () { var currentVariantSelect = document.getElementById('SingleOptionSelector-0') currentVariantSelect.addEventListener('change', function() { var currentSku = $('#current_sku').text() var skuElement = document.getElementById('current-sku') skuElement.textContent = currentSku handleSellingStatus(currentSku) }); });
// Override default values of shop.strings for each template. // Alternate product templates can change values of // add to cart button, sold out, and unavailable states here. theme.productStrings = { addToCart: "加到購物車", soldOut: "售完", unavailable: "停產" }