$product = {"id":7921237524579,"title":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 便當","handle":"iphone-14-pro-mod-nx-magsafe-ec76","description":null,"published_at":"2025-11-14T10:37:11+08:00","created_at":"2025-11-11T10:27:06+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-bylobster","device-iPhone 14 Pro","merge","reseller-bylobster"],"price":110000,"price_min":110000,"price_max":110000,"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":43831272636515,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-EC76","requires_shipping":true,"taxable":true,"featured_image":{"id":36054667198563,"product_id":7921237524579,"position":15,"created_at":"2026-06-23T09:57:42+08:00","updated_at":"2026-06-23T09:57:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48_f95fccfe-e7fb-4b8c-8a68-51ed30615adc.webp?v=1782179864","variant_ids":[43831272636515]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 便當 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-EC76","featured_media":{"alt":null,"id":27567517597795,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48_f95fccfe-e7fb-4b8c-8a68-51ed30615adc.webp?v=1782179864"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831272800355,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-EC76","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666575971,"product_id":7921237524579,"position":13,"created_at":"2026-06-23T09:57:41+08:00","updated_at":"2026-06-23T09:57:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ab97eb7cedc92030d0c0689a3ed96d7426ac17f_99587b73-45cc-4fec-8df3-321542d95b54.webp?v=1782179863","variant_ids":[43831272800355]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 便當 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-EC76","featured_media":{"alt":null,"id":27567516909667,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ab97eb7cedc92030d0c0689a3ed96d7426ac17f_99587b73-45cc-4fec-8df3-321542d95b54.webp?v=1782179863"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831272898659,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-EC76","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666739811,"product_id":7921237524579,"position":14,"created_at":"2026-06-23T09:57:42+08:00","updated_at":"2026-06-23T09:57:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b65ac656588530c3f382ac51167c60d80fe7b1d2_8fe24e01-be83-4202-a04a-bb94cea1a2c3.webp?v=1782179864","variant_ids":[43831272898659]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 便當 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126204-EC76","featured_media":{"alt":null,"id":27567517139043,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b65ac656588530c3f382ac51167c60d80fe7b1d2_8fe24e01-be83-4202-a04a-bb94cea1a2c3.webp?v=1782179864"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3715f028bb6a37a5fe38207c3f41cfb4b1d088.webp?v=1762828029","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fd6ad13e2fddda79d33c3842b0be98bd3c13ded5.webp?v=1762828030","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70058172bb868d70fba34aa7b3c74ee9f09812ac.webp?v=1762828031","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/603bcad72c47bef4c9e5128ec25c056f40ef81eb.webp?v=1762828031","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/af47fac0ce032b71e7cb7b9713ee9b4e812a316f.webp?v=1762828032","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f4fbb4512028e1967538b938f7691c3c95ec2be.webp?v=1762828033","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be91fdc9ff1049a41561bdd3b4933b54fcc9dfde.webp?v=1762828033","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10e511822b2d90e2891550adefdd776ac06e75f9.webp?v=1762828034","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48.webp?v=1762828035","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a71cf8e4248178a1ce0349464d57f6a2fea911b.webp?v=1762828036","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b65ac656588530c3f382ac51167c60d80fe7b1d2.webp?v=1762828037","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ab97eb7cedc92030d0c0689a3ed96d7426ac17f.webp?v=1762828038","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ab97eb7cedc92030d0c0689a3ed96d7426ac17f_99587b73-45cc-4fec-8df3-321542d95b54.webp?v=1782179863","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b65ac656588530c3f382ac51167c60d80fe7b1d2_8fe24e01-be83-4202-a04a-bb94cea1a2c3.webp?v=1782179864","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48_f95fccfe-e7fb-4b8c-8a68-51ed30615adc.webp?v=1782179864"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3715f028bb6a37a5fe38207c3f41cfb4b1d088.webp?v=1762828029","options":["color"],"media":[{"alt":null,"id":26352167845987,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3715f028bb6a37a5fe38207c3f41cfb4b1d088.webp?v=1762828029"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3c3715f028bb6a37a5fe38207c3f41cfb4b1d088.webp?v=1762828029","width":2000},{"alt":null,"id":26352168108131,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fd6ad13e2fddda79d33c3842b0be98bd3c13ded5.webp?v=1762828030"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fd6ad13e2fddda79d33c3842b0be98bd3c13ded5.webp?v=1762828030","width":2000},{"alt":null,"id":26352168370275,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70058172bb868d70fba34aa7b3c74ee9f09812ac.webp?v=1762828031"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70058172bb868d70fba34aa7b3c74ee9f09812ac.webp?v=1762828031","width":2000},{"alt":null,"id":26352168697955,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/603bcad72c47bef4c9e5128ec25c056f40ef81eb.webp?v=1762828031"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/603bcad72c47bef4c9e5128ec25c056f40ef81eb.webp?v=1762828031","width":2000},{"alt":null,"id":26352168992867,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/af47fac0ce032b71e7cb7b9713ee9b4e812a316f.webp?v=1762828032"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/af47fac0ce032b71e7cb7b9713ee9b4e812a316f.webp?v=1762828032","width":2000},{"alt":null,"id":26352169189475,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f4fbb4512028e1967538b938f7691c3c95ec2be.webp?v=1762828033"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f4fbb4512028e1967538b938f7691c3c95ec2be.webp?v=1762828033","width":2000},{"alt":null,"id":26352169484387,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be91fdc9ff1049a41561bdd3b4933b54fcc9dfde.webp?v=1762828033"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be91fdc9ff1049a41561bdd3b4933b54fcc9dfde.webp?v=1762828033","width":2000},{"alt":null,"id":26352169844835,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10e511822b2d90e2891550adefdd776ac06e75f9.webp?v=1762828034"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10e511822b2d90e2891550adefdd776ac06e75f9.webp?v=1762828034","width":2000},{"alt":null,"id":26352170139747,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48.webp?v=1762828035"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48.webp?v=1762828035","width":2000},{"alt":null,"id":26352170401891,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a71cf8e4248178a1ce0349464d57f6a2fea911b.webp?v=1762828036"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a71cf8e4248178a1ce0349464d57f6a2fea911b.webp?v=1762828036","width":2000},{"alt":null,"id":26352170696803,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b65ac656588530c3f382ac51167c60d80fe7b1d2.webp?v=1762828037"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b65ac656588530c3f382ac51167c60d80fe7b1d2.webp?v=1762828037","width":2000},{"alt":null,"id":26352170958947,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ab97eb7cedc92030d0c0689a3ed96d7426ac17f.webp?v=1762828038"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ab97eb7cedc92030d0c0689a3ed96d7426ac17f.webp?v=1762828038","width":2000},{"alt":null,"id":27567516909667,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ab97eb7cedc92030d0c0689a3ed96d7426ac17f_99587b73-45cc-4fec-8df3-321542d95b54.webp?v=1782179863"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ab97eb7cedc92030d0c0689a3ed96d7426ac17f_99587b73-45cc-4fec-8df3-321542d95b54.webp?v=1782179863","width":2000},{"alt":null,"id":27567517139043,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b65ac656588530c3f382ac51167c60d80fe7b1d2_8fe24e01-be83-4202-a04a-bb94cea1a2c3.webp?v=1782179864"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b65ac656588530c3f382ac51167c60d80fe7b1d2_8fe24e01-be83-4202-a04a-bb94cea1a2c3.webp?v=1782179864","width":2000},{"alt":null,"id":27567517597795,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48_f95fccfe-e7fb-4b8c-8a68-51ed30615adc.webp?v=1782179864"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48_f95fccfe-e7fb-4b8c-8a68-51ed30615adc.webp?v=1782179864","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43831272636515,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-EC76","requires_shipping":true,"taxable":true,"featured_image":{"id":36054667198563,"product_id":7921237524579,"position":15,"created_at":"2026-06-23T09:57:42+08:00","updated_at":"2026-06-23T09:57:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48_f95fccfe-e7fb-4b8c-8a68-51ed30615adc.webp?v=1782179864","variant_ids":[43831272636515]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 便當 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-EC76","featured_media":{"alt":null,"id":27567517597795,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48_f95fccfe-e7fb-4b8c-8a68-51ed30615adc.webp?v=1782179864"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831272800355,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-EC76","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666575971,"product_id":7921237524579,"position":13,"created_at":"2026-06-23T09:57:41+08:00","updated_at":"2026-06-23T09:57:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ab97eb7cedc92030d0c0689a3ed96d7426ac17f_99587b73-45cc-4fec-8df3-321542d95b54.webp?v=1782179863","variant_ids":[43831272800355]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 便當 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-EC76","featured_media":{"alt":null,"id":27567516909667,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7ab97eb7cedc92030d0c0689a3ed96d7426ac17f_99587b73-45cc-4fec-8df3-321542d95b54.webp?v=1782179863"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831272898659,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-EC76","requires_shipping":true,"taxable":true,"featured_image":{"id":36054666739811,"product_id":7921237524579,"position":14,"created_at":"2026-06-23T09:57:42+08:00","updated_at":"2026-06-23T09:57:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b65ac656588530c3f382ac51167c60d80fe7b1d2_8fe24e01-be83-4202-a04a-bb94cea1a2c3.webp?v=1782179864","variant_ids":[43831272898659]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 便當 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126204-EC76","featured_media":{"alt":null,"id":27567517139043,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b65ac656588530c3f382ac51167c60d80fe7b1d2_8fe24e01-be83-4202-a04a-bb94cea1a2c3.webp?v=1782179864"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43831272636515,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-EC76","requires_shipping":true,"taxable":true,"featured_image":{"id":36054667198563,"product_id":7921237524579,"position":15,"created_at":"2026-06-23T09:57:42+08:00","updated_at":"2026-06-23T09:57:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48_f95fccfe-e7fb-4b8c-8a68-51ed30615adc.webp?v=1782179864","variant_ids":[43831272636515]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 便當 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-EC76","featured_media":{"alt":null,"id":27567517597795,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cec24f7bfc7dd31b84fa6f37a95ebd0c2f364a48_f95fccfe-e7fb-4b8c-8a68-51ed30615adc.webp?v=1782179864"}},"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: "停產" }