$product = {"id":7920595435619,"title":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-咒靈組合","handle":"iphone-15-plus-solidx-ptt18","description":null,"published_at":"2025-11-10T16:25:44+08:00","created_at":"2025-11-10T15:50:27+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-jujutsu-kaisen","device-iPhone 15 Plus","merge","reseller-jujutsu-kaisen"],"price":125000,"price_min":125000,"price_max":125000,"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":43829117223011,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT18","requires_shipping":true,"taxable":true,"featured_image":{"id":36125155950691,"product_id":7920595435619,"position":18,"created_at":"2026-06-29T15:42:53+08:00","updated_at":"2026-06-29T15:42:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_f29637be-31d2-416c-ae33-48de7dbd7385.webp?v=1782718975","variant_ids":[43829117223011]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-咒靈組合 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960B-PTT18","featured_media":{"alt":null,"id":27630398734435,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_f29637be-31d2-416c-ae33-48de7dbd7385.webp?v=1782718975"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829119713379,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-PTT18","requires_shipping":true,"taxable":true,"featured_image":{"id":36125155623011,"product_id":7920595435619,"position":17,"created_at":"2026-06-29T15:42:53+08:00","updated_at":"2026-06-29T15:42:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_9f79b950-aa54-448f-b438-5ee64af1dbbc.webp?v=1782718975","variant_ids":[43829119713379]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-咒靈組合 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129652-PTT18","featured_media":{"alt":null,"id":27630398373987,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_9f79b950-aa54-448f-b438-5ee64af1dbbc.webp?v=1782718975"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1d5a5f96b24aa3aae09c2cac2ded79f8c8a1816.webp?v=1762761036","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a.webp?v=1762761037","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb45e1dffe4bbe03ec4e6300d224d03a9ab1cfb8.webp?v=1762761037","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5462160fa0f193e09a6494b6c0f3ee3e1354f858.webp?v=1762761038","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d.webp?v=1762761039","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0419769d99409dceb0e138fb7b62b0015c3c59b9.webp?v=1762761039","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aebd1f0af7f3dd52819d069c10c079b06f040035.webp?v=1762761040","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba.webp?v=1762761040","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88618b29c27439561a78a3b6989d9804f2a0efd5.webp?v=1762761041","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/04e19cf293a3d71cc967b242851821b350be6fff.webp?v=1762761042","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_24b44e5e-2235-455c-bff1-329e7ccc3e85.webp?v=1782266143","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_deb5f9b5-fb90-4a53-9791-117072036af5.webp?v=1782266144","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d_b53580f7-50a2-4aa6-9c04-d5d147c10d99.webp?v=1782266145","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_63aa02a3-1ca4-4f85-84d4-948584568cb8.webp?v=1782291743","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_dd9a886b-f693-490d-8ff0-6c0accdf8771.webp?v=1782291744","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d_201359b0-e219-4d0e-8c2f-422882967c4a.webp?v=1782291747","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_9f79b950-aa54-448f-b438-5ee64af1dbbc.webp?v=1782718975","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_f29637be-31d2-416c-ae33-48de7dbd7385.webp?v=1782718975","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d_d6c5916f-e512-46e4-b167-dc31f02ecc11.webp?v=1782718976"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1d5a5f96b24aa3aae09c2cac2ded79f8c8a1816.webp?v=1762761036","options":["color"],"media":[{"alt":null,"id":26348087935075,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1d5a5f96b24aa3aae09c2cac2ded79f8c8a1816.webp?v=1762761036"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1d5a5f96b24aa3aae09c2cac2ded79f8c8a1816.webp?v=1762761036","width":2000},{"alt":null,"id":26348088295523,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a.webp?v=1762761037"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a.webp?v=1762761037","width":2000},{"alt":null,"id":26348088426595,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb45e1dffe4bbe03ec4e6300d224d03a9ab1cfb8.webp?v=1762761037"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb45e1dffe4bbe03ec4e6300d224d03a9ab1cfb8.webp?v=1762761037","width":2000},{"alt":null,"id":26348088557667,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5462160fa0f193e09a6494b6c0f3ee3e1354f858.webp?v=1762761038"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5462160fa0f193e09a6494b6c0f3ee3e1354f858.webp?v=1762761038","width":2000},{"alt":null,"id":26348088655971,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d.webp?v=1762761039"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d.webp?v=1762761039","width":2000},{"alt":null,"id":26348088754275,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0419769d99409dceb0e138fb7b62b0015c3c59b9.webp?v=1762761039"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0419769d99409dceb0e138fb7b62b0015c3c59b9.webp?v=1762761039","width":2000},{"alt":null,"id":26348088885347,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aebd1f0af7f3dd52819d069c10c079b06f040035.webp?v=1762761040"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aebd1f0af7f3dd52819d069c10c079b06f040035.webp?v=1762761040","width":2000},{"alt":null,"id":26348089016419,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba.webp?v=1762761040"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba.webp?v=1762761040","width":2000},{"alt":null,"id":26348089213027,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88618b29c27439561a78a3b6989d9804f2a0efd5.webp?v=1762761041"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88618b29c27439561a78a3b6989d9804f2a0efd5.webp?v=1762761041","width":2000},{"alt":null,"id":26348089376867,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/04e19cf293a3d71cc967b242851821b350be6fff.webp?v=1762761042"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/04e19cf293a3d71cc967b242851821b350be6fff.webp?v=1762761042","width":2000},{"alt":null,"id":27587411574883,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_24b44e5e-2235-455c-bff1-329e7ccc3e85.webp?v=1782266143"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_24b44e5e-2235-455c-bff1-329e7ccc3e85.webp?v=1782266143","width":2000},{"alt":null,"id":27587411968099,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_deb5f9b5-fb90-4a53-9791-117072036af5.webp?v=1782266144"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_deb5f9b5-fb90-4a53-9791-117072036af5.webp?v=1782266144","width":2000},{"alt":null,"id":27587412557923,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d_b53580f7-50a2-4aa6-9c04-d5d147c10d99.webp?v=1782266145"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d_b53580f7-50a2-4aa6-9c04-d5d147c10d99.webp?v=1782266145","width":2000},{"alt":null,"id":27594720149603,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_63aa02a3-1ca4-4f85-84d4-948584568cb8.webp?v=1782291743"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_63aa02a3-1ca4-4f85-84d4-948584568cb8.webp?v=1782291743","width":2000},{"alt":null,"id":27594720542819,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_dd9a886b-f693-490d-8ff0-6c0accdf8771.webp?v=1782291744"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_dd9a886b-f693-490d-8ff0-6c0accdf8771.webp?v=1782291744","width":2000},{"alt":null,"id":27594720936035,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d_201359b0-e219-4d0e-8c2f-422882967c4a.webp?v=1782291747"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d_201359b0-e219-4d0e-8c2f-422882967c4a.webp?v=1782291747","width":2000},{"alt":null,"id":27630398373987,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_9f79b950-aa54-448f-b438-5ee64af1dbbc.webp?v=1782718975"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_9f79b950-aa54-448f-b438-5ee64af1dbbc.webp?v=1782718975","width":2000},{"alt":null,"id":27630398734435,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_f29637be-31d2-416c-ae33-48de7dbd7385.webp?v=1782718975"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_f29637be-31d2-416c-ae33-48de7dbd7385.webp?v=1782718975","width":2000},{"alt":null,"id":27630399160419,"position":19,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d_d6c5916f-e512-46e4-b167-dc31f02ecc11.webp?v=1782718976"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0e7a02dba1e7a25514c05eaa132d934672afe7d_d6c5916f-e512-46e4-b167-dc31f02ecc11.webp?v=1782718976","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43829117223011,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT18","requires_shipping":true,"taxable":true,"featured_image":{"id":36125155950691,"product_id":7920595435619,"position":18,"created_at":"2026-06-29T15:42:53+08:00","updated_at":"2026-06-29T15:42:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_f29637be-31d2-416c-ae33-48de7dbd7385.webp?v=1782718975","variant_ids":[43829117223011]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-咒靈組合 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960B-PTT18","featured_media":{"alt":null,"id":27630398734435,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_f29637be-31d2-416c-ae33-48de7dbd7385.webp?v=1782718975"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829119713379,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-PTT18","requires_shipping":true,"taxable":true,"featured_image":{"id":36125155623011,"product_id":7920595435619,"position":17,"created_at":"2026-06-29T15:42:53+08:00","updated_at":"2026-06-29T15:42:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_9f79b950-aa54-448f-b438-5ee64af1dbbc.webp?v=1782718975","variant_ids":[43829119713379]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-咒靈組合 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129652-PTT18","featured_media":{"alt":null,"id":27630398373987,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0dc5c355d0fd822708cca37cabeaad444c087fba_9f79b950-aa54-448f-b438-5ee64af1dbbc.webp?v=1782718975"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43829117223011,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-PTT18","requires_shipping":true,"taxable":true,"featured_image":{"id":36125155950691,"product_id":7920595435619,"position":18,"created_at":"2026-06-29T15:42:53+08:00","updated_at":"2026-06-29T15:42:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_f29637be-31d2-416c-ae33-48de7dbd7385.webp?v=1782718975","variant_ids":[43829117223011]},"available":true,"name":"iPhone 15 Plus SolidX 咒術迴戰 澀谷事變戰鬥系列-咒靈組合 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960B-PTT18","featured_media":{"alt":null,"id":27630398734435,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b36e97cb6793f59571cf79cd1a2bd8eb6368a59a_f29637be-31d2-416c-ae33-48de7dbd7385.webp?v=1782718975"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null; $brand_handle = null; $type = ""; var sellingStatus // 只有設計款(SKU 含 '-')才需要合圖 if ($isMerge && $defaultVariant.sku.includes('-')) { $(document).ready(function() { var productImg = $product.images[0]; var bumperImg = window.getProductImageUrl($defaultVariant.sku.split('-')[0]); var layers = ($type === 'mod-nx-backplate' || $type === 'mod-backplate') ? [productImg, bumperImg] : [bumperImg, productImg]; window.mergeProductImages(layers).then(function (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: "停產" }