$product = {"id":7920641212515,"title":"iPhone 14 Clear 咒術迴戰 澀谷事變戰鬥系列-咒術高專","handle":"iphone-14-jellytint-ptt17","description":null,"published_at":"2025-11-10T16:18:13+08:00","created_at":"2025-11-10T16:01:48+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-jujutsu-kaisen","device-iPhone 14","merge","reseller-jujutsu-kaisen"],"price":128000,"price_min":128000,"price_max":128000,"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":43829274443875,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012600J-PTT17","requires_shipping":true,"taxable":true,"featured_image":{"id":36124917104739,"product_id":7920641212515,"position":12,"created_at":"2026-06-29T15:29:50+08:00","updated_at":"2026-06-29T15:29:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_85108c12-8afc-47a9-98f6-7f8907be3bf4.webp?v=1782718192","variant_ids":[43829274443875]},"available":true,"name":"iPhone 14 Clear 咒術迴戰 澀谷事變戰鬥系列-咒術高專 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600J-PTT17","featured_media":{"alt":null,"id":27630160052323,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_85108c12-8afc-47a9-98f6-7f8907be3bf4.webp?v=1782718192"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829275983971,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012600I-PTT17","requires_shipping":true,"taxable":true,"featured_image":{"id":36124917366883,"product_id":7920641212515,"position":13,"created_at":"2026-06-29T15:29:51+08:00","updated_at":"2026-06-29T15:29:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_9e0bdbba-2a18-42d9-9543-c9cf6f2e972e.webp?v=1782718193","variant_ids":[43829275983971]},"available":true,"name":"iPhone 14 Clear 咒術迴戰 澀谷事變戰鬥系列-咒術高專 - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600I-PTT17","featured_media":{"alt":null,"id":27630160314467,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_9e0bdbba-2a18-42d9-9543-c9cf6f2e972e.webp?v=1782718193"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829276016739,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012600G-PTT17","requires_shipping":true,"taxable":true,"featured_image":{"id":36124916908131,"product_id":7920641212515,"position":11,"created_at":"2026-06-29T15:29:49+08:00","updated_at":"2026-06-29T15:29:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_3893e417-56fd-40d5-98f0-d9d91254eb95.webp?v=1782718191","variant_ids":[43829276016739]},"available":true,"name":"iPhone 14 Clear 咒術迴戰 澀谷事變戰鬥系列-咒術高專 - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600G-PTT17","featured_media":{"alt":null,"id":27630159855715,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_3893e417-56fd-40d5-98f0-d9d91254eb95.webp?v=1782718191"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_f34c0201-9b37-41b6-8220-03df754afe33.webp?v=1762761712","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_f3ba3f94-ee3b-4ca4-b631-b7e94db5f5cc.webp?v=1762761712","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_cd1d876e-efef-4db6-b4a5-a1b22a2af177.webp?v=1762761713","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1216525c3b6b640391a477bdeac843c7d5ee012f_8fa73428-994c-4416-b680-6d1599ce4321.webp?v=1762761714","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_be67d35e-5dc0-4183-929b-6a08d27107fa.webp?v=1782265504","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_e390457c-593d-4603-a8cb-a7d951a501b8.webp?v=1782265505","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_dcb7731d-8449-4e7f-b265-87ddc81d73c5.webp?v=1782265506","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_efd0bd73-4b60-4099-be31-50509a37e18e.webp?v=1782291435","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_04f6caa7-de2a-4c99-90a2-7ec6a45626ad.webp?v=1782291436","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_967d72a9-15b7-42b5-b808-f7cf5de22186.webp?v=1782291436","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_3893e417-56fd-40d5-98f0-d9d91254eb95.webp?v=1782718191","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_85108c12-8afc-47a9-98f6-7f8907be3bf4.webp?v=1782718192","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_9e0bdbba-2a18-42d9-9543-c9cf6f2e972e.webp?v=1782718193"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_f34c0201-9b37-41b6-8220-03df754afe33.webp?v=1762761712","options":["color"],"media":[{"alt":null,"id":26348257443939,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_f34c0201-9b37-41b6-8220-03df754afe33.webp?v=1762761712"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_f34c0201-9b37-41b6-8220-03df754afe33.webp?v=1762761712","width":2000},{"alt":null,"id":26348257640547,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_f3ba3f94-ee3b-4ca4-b631-b7e94db5f5cc.webp?v=1762761712"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_f3ba3f94-ee3b-4ca4-b631-b7e94db5f5cc.webp?v=1762761712","width":2000},{"alt":null,"id":26348257804387,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_cd1d876e-efef-4db6-b4a5-a1b22a2af177.webp?v=1762761713"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_cd1d876e-efef-4db6-b4a5-a1b22a2af177.webp?v=1762761713","width":2000},{"alt":null,"id":26348258066531,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1216525c3b6b640391a477bdeac843c7d5ee012f_8fa73428-994c-4416-b680-6d1599ce4321.webp?v=1762761714"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1216525c3b6b640391a477bdeac843c7d5ee012f_8fa73428-994c-4416-b680-6d1599ce4321.webp?v=1762761714","width":2000},{"alt":null,"id":27587133341795,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_be67d35e-5dc0-4183-929b-6a08d27107fa.webp?v=1782265504"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_be67d35e-5dc0-4183-929b-6a08d27107fa.webp?v=1782265504","width":2000},{"alt":null,"id":27587133702243,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_e390457c-593d-4603-a8cb-a7d951a501b8.webp?v=1782265505"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_e390457c-593d-4603-a8cb-a7d951a501b8.webp?v=1782265505","width":2000},{"alt":null,"id":27587134521443,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_dcb7731d-8449-4e7f-b265-87ddc81d73c5.webp?v=1782265506"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_dcb7731d-8449-4e7f-b265-87ddc81d73c5.webp?v=1782265506","width":2000},{"alt":null,"id":27594622173283,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_efd0bd73-4b60-4099-be31-50509a37e18e.webp?v=1782291435"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_efd0bd73-4b60-4099-be31-50509a37e18e.webp?v=1782291435","width":2000},{"alt":null,"id":27594622730339,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_04f6caa7-de2a-4c99-90a2-7ec6a45626ad.webp?v=1782291436"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_04f6caa7-de2a-4c99-90a2-7ec6a45626ad.webp?v=1782291436","width":2000},{"alt":null,"id":27594623254627,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_967d72a9-15b7-42b5-b808-f7cf5de22186.webp?v=1782291436"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_967d72a9-15b7-42b5-b808-f7cf5de22186.webp?v=1782291436","width":2000},{"alt":null,"id":27630159855715,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_3893e417-56fd-40d5-98f0-d9d91254eb95.webp?v=1782718191"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_3893e417-56fd-40d5-98f0-d9d91254eb95.webp?v=1782718191","width":2000},{"alt":null,"id":27630160052323,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_85108c12-8afc-47a9-98f6-7f8907be3bf4.webp?v=1782718192"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_85108c12-8afc-47a9-98f6-7f8907be3bf4.webp?v=1782718192","width":2000},{"alt":null,"id":27630160314467,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_9e0bdbba-2a18-42d9-9543-c9cf6f2e972e.webp?v=1782718193"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_9e0bdbba-2a18-42d9-9543-c9cf6f2e972e.webp?v=1782718193","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43829274443875,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012600J-PTT17","requires_shipping":true,"taxable":true,"featured_image":{"id":36124917104739,"product_id":7920641212515,"position":12,"created_at":"2026-06-29T15:29:50+08:00","updated_at":"2026-06-29T15:29:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_85108c12-8afc-47a9-98f6-7f8907be3bf4.webp?v=1782718192","variant_ids":[43829274443875]},"available":true,"name":"iPhone 14 Clear 咒術迴戰 澀谷事變戰鬥系列-咒術高專 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600J-PTT17","featured_media":{"alt":null,"id":27630160052323,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_85108c12-8afc-47a9-98f6-7f8907be3bf4.webp?v=1782718192"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829275983971,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012600I-PTT17","requires_shipping":true,"taxable":true,"featured_image":{"id":36124917366883,"product_id":7920641212515,"position":13,"created_at":"2026-06-29T15:29:51+08:00","updated_at":"2026-06-29T15:29:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_9e0bdbba-2a18-42d9-9543-c9cf6f2e972e.webp?v=1782718193","variant_ids":[43829275983971]},"available":true,"name":"iPhone 14 Clear 咒術迴戰 澀谷事變戰鬥系列-咒術高專 - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600I-PTT17","featured_media":{"alt":null,"id":27630160314467,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9808551a4389c655df9ccda70a6ffa9fae32bbc_9e0bdbba-2a18-42d9-9543-c9cf6f2e972e.webp?v=1782718193"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43829276016739,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012600G-PTT17","requires_shipping":true,"taxable":true,"featured_image":{"id":36124916908131,"product_id":7920641212515,"position":11,"created_at":"2026-06-29T15:29:49+08:00","updated_at":"2026-06-29T15:29:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_3893e417-56fd-40d5-98f0-d9d91254eb95.webp?v=1782718191","variant_ids":[43829276016739]},"available":true,"name":"iPhone 14 Clear 咒術迴戰 澀谷事變戰鬥系列-咒術高專 - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600G-PTT17","featured_media":{"alt":null,"id":27630159855715,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c7beb39784ec93a89e3e42999a695567cd9d49c_3893e417-56fd-40d5-98f0-d9d91254eb95.webp?v=1782718191"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43829274443875,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012600J-PTT17","requires_shipping":true,"taxable":true,"featured_image":{"id":36124917104739,"product_id":7920641212515,"position":12,"created_at":"2026-06-29T15:29:50+08:00","updated_at":"2026-06-29T15:29:52+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_85108c12-8afc-47a9-98f6-7f8907be3bf4.webp?v=1782718192","variant_ids":[43829274443875]},"available":true,"name":"iPhone 14 Clear 咒術迴戰 澀谷事變戰鬥系列-咒術高專 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012600J-PTT17","featured_media":{"alt":null,"id":27630160052323,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/96f133a48285667e81ee360b7b749a8c91e3434c_85108c12-8afc-47a9-98f6-7f8907be3bf4.webp?v=1782718192"}},"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: "停產" }