$product = {"id":7937541832803,"title":"iPhone 15 Plus Mod NX (MagSafe 兼容) Jin Young Choi 一起伸展","handle":"iphone-15-plus-mod-nx-magsafe-cjy07","description":null,"published_at":"2025-12-12T09:53:01+08:00","created_at":"2025-12-11T09:41:24+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-jychoioioi","device-iPhone 15 Plus","merge","reseller-jychoioioi"],"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":43882908123235,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0129624-CJY07","requires_shipping":true,"taxable":true,"featured_image":{"id":34931797950563,"product_id":7937541832803,"position":17,"created_at":"2025-12-11T10:26:19+08:00","updated_at":"2025-12-11T10:26:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a_b16d9a94-3e7e-4286-b58f-00c86edbe2b2.webp?v=1765419981","variant_ids":[43882908123235]},"available":true,"name":"iPhone 15 Plus Mod NX (MagSafe 兼容) Jin Young Choi 一起伸展 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0129624-CJY07","featured_media":{"alt":null,"id":26494172201059,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a_b16d9a94-3e7e-4286-b58f-00c86edbe2b2.webp?v=1765419981"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43882908319843,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MPB0129657-CJY07","requires_shipping":true,"taxable":true,"featured_image":{"id":34931797229667,"product_id":7937541832803,"position":14,"created_at":"2025-12-11T10:26:18+08:00","updated_at":"2025-12-11T10:26:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82c60a70f0f61d02ccc27b990c233f1994f1519f_5332cf2a-eaa3-4504-b70e-f5b501bfb7b2.webp?v=1765419980","variant_ids":[43882908319843]},"available":true,"name":"iPhone 15 Plus Mod NX (MagSafe 兼容) Jin Young Choi 一起伸展 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0129657-CJY07","featured_media":{"alt":null,"id":26494171480163,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82c60a70f0f61d02ccc27b990c233f1994f1519f_5332cf2a-eaa3-4504-b70e-f5b501bfb7b2.webp?v=1765419980"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9e6503e28331b52ad5d97d0ece2038f9f37d02b.webp?v=1765417290","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/493bd57c0630b440a34086d49b8505efb90bb59b.webp?v=1765417290","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c51c91702027c3da9fd1ffcbdbe1d2f162d907ea.webp?v=1765417291","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a.webp?v=1765417291","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec35f3d3d089043fa17673ff5bc145c572af8c9a.webp?v=1765417292","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d2d22a03dbd42462d6809673390972e3d01ce539.webp?v=1765417292","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7eabebee1456f9ba47a5275a3532677d8e4bd54.webp?v=1765417293","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82c60a70f0f61d02ccc27b990c233f1994f1519f.webp?v=1765417293","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fd73fa6c8163fffc83605de48efb5b632934b81.webp?v=1765417294","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d2d22a03dbd42462d6809673390972e3d01ce539_6281594e-c9e5-40ca-8608-02f483f58583.webp?v=1765419976","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c51c91702027c3da9fd1ffcbdbe1d2f162d907ea_d49e2d38-829d-404d-a6bf-fc204c61a546.webp?v=1765419976","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/493bd57c0630b440a34086d49b8505efb90bb59b_28c122ec-364e-4293-919f-9724a2f414c3.webp?v=1765419977","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fd73fa6c8163fffc83605de48efb5b632934b81_0b9109d8-da11-4d11-85c6-d342790ab502.webp?v=1765419979","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82c60a70f0f61d02ccc27b990c233f1994f1519f_5332cf2a-eaa3-4504-b70e-f5b501bfb7b2.webp?v=1765419980","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec35f3d3d089043fa17673ff5bc145c572af8c9a_5439b92f-828a-45df-850b-dab7224cb423.webp?v=1765419980","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9e6503e28331b52ad5d97d0ece2038f9f37d02b_d693eb57-fb4c-4546-a6a3-0bdbfad61ea1.webp?v=1765419981","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a_b16d9a94-3e7e-4286-b58f-00c86edbe2b2.webp?v=1765419981","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7eabebee1456f9ba47a5275a3532677d8e4bd54_7606720a-aca4-4a8d-81ea-9f5ba3a1ca9c.webp?v=1765419982"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9e6503e28331b52ad5d97d0ece2038f9f37d02b.webp?v=1765417290","options":["color"],"media":[{"alt":null,"id":26493145383011,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9e6503e28331b52ad5d97d0ece2038f9f37d02b.webp?v=1765417290"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9e6503e28331b52ad5d97d0ece2038f9f37d02b.webp?v=1765417290","width":2000},{"alt":null,"id":26493145546851,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/493bd57c0630b440a34086d49b8505efb90bb59b.webp?v=1765417290"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/493bd57c0630b440a34086d49b8505efb90bb59b.webp?v=1765417290","width":2000},{"alt":null,"id":26493145677923,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c51c91702027c3da9fd1ffcbdbe1d2f162d907ea.webp?v=1765417291"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c51c91702027c3da9fd1ffcbdbe1d2f162d907ea.webp?v=1765417291","width":2000},{"alt":null,"id":26493145874531,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a.webp?v=1765417291"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a.webp?v=1765417291","width":2000},{"alt":null,"id":26493146005603,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec35f3d3d089043fa17673ff5bc145c572af8c9a.webp?v=1765417292"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec35f3d3d089043fa17673ff5bc145c572af8c9a.webp?v=1765417292","width":2000},{"alt":null,"id":26493146202211,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d2d22a03dbd42462d6809673390972e3d01ce539.webp?v=1765417292"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d2d22a03dbd42462d6809673390972e3d01ce539.webp?v=1765417292","width":2000},{"alt":null,"id":26493146366051,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7eabebee1456f9ba47a5275a3532677d8e4bd54.webp?v=1765417293"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7eabebee1456f9ba47a5275a3532677d8e4bd54.webp?v=1765417293","width":2000},{"alt":null,"id":26493146497123,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82c60a70f0f61d02ccc27b990c233f1994f1519f.webp?v=1765417293"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82c60a70f0f61d02ccc27b990c233f1994f1519f.webp?v=1765417293","width":2000},{"alt":null,"id":26493146660963,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fd73fa6c8163fffc83605de48efb5b632934b81.webp?v=1765417294"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fd73fa6c8163fffc83605de48efb5b632934b81.webp?v=1765417294","width":2000},{"alt":null,"id":26494170366051,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d2d22a03dbd42462d6809673390972e3d01ce539_6281594e-c9e5-40ca-8608-02f483f58583.webp?v=1765419976"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d2d22a03dbd42462d6809673390972e3d01ce539_6281594e-c9e5-40ca-8608-02f483f58583.webp?v=1765419976","width":2000},{"alt":null,"id":26494170759267,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c51c91702027c3da9fd1ffcbdbe1d2f162d907ea_d49e2d38-829d-404d-a6bf-fc204c61a546.webp?v=1765419976"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c51c91702027c3da9fd1ffcbdbe1d2f162d907ea_d49e2d38-829d-404d-a6bf-fc204c61a546.webp?v=1765419976","width":2000},{"alt":null,"id":26494170955875,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/493bd57c0630b440a34086d49b8505efb90bb59b_28c122ec-364e-4293-919f-9724a2f414c3.webp?v=1765419977"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/493bd57c0630b440a34086d49b8505efb90bb59b_28c122ec-364e-4293-919f-9724a2f414c3.webp?v=1765419977","width":2000},{"alt":null,"id":26494171185251,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fd73fa6c8163fffc83605de48efb5b632934b81_0b9109d8-da11-4d11-85c6-d342790ab502.webp?v=1765419979"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2fd73fa6c8163fffc83605de48efb5b632934b81_0b9109d8-da11-4d11-85c6-d342790ab502.webp?v=1765419979","width":2000},{"alt":null,"id":26494171480163,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82c60a70f0f61d02ccc27b990c233f1994f1519f_5332cf2a-eaa3-4504-b70e-f5b501bfb7b2.webp?v=1765419980"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82c60a70f0f61d02ccc27b990c233f1994f1519f_5332cf2a-eaa3-4504-b70e-f5b501bfb7b2.webp?v=1765419980","width":2000},{"alt":null,"id":26494171807843,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec35f3d3d089043fa17673ff5bc145c572af8c9a_5439b92f-828a-45df-850b-dab7224cb423.webp?v=1765419980"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec35f3d3d089043fa17673ff5bc145c572af8c9a_5439b92f-828a-45df-850b-dab7224cb423.webp?v=1765419980","width":2000},{"alt":null,"id":26494172069987,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9e6503e28331b52ad5d97d0ece2038f9f37d02b_d693eb57-fb4c-4546-a6a3-0bdbfad61ea1.webp?v=1765419981"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9e6503e28331b52ad5d97d0ece2038f9f37d02b_d693eb57-fb4c-4546-a6a3-0bdbfad61ea1.webp?v=1765419981","width":2000},{"alt":null,"id":26494172201059,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a_b16d9a94-3e7e-4286-b58f-00c86edbe2b2.webp?v=1765419981"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a_b16d9a94-3e7e-4286-b58f-00c86edbe2b2.webp?v=1765419981","width":2000},{"alt":null,"id":26494172266595,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7eabebee1456f9ba47a5275a3532677d8e4bd54_7606720a-aca4-4a8d-81ea-9f5ba3a1ca9c.webp?v=1765419982"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7eabebee1456f9ba47a5275a3532677d8e4bd54_7606720a-aca4-4a8d-81ea-9f5ba3a1ca9c.webp?v=1765419982","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43882908123235,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0129624-CJY07","requires_shipping":true,"taxable":true,"featured_image":{"id":34931797950563,"product_id":7937541832803,"position":17,"created_at":"2025-12-11T10:26:19+08:00","updated_at":"2025-12-11T10:26:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a_b16d9a94-3e7e-4286-b58f-00c86edbe2b2.webp?v=1765419981","variant_ids":[43882908123235]},"available":true,"name":"iPhone 15 Plus Mod NX (MagSafe 兼容) Jin Young Choi 一起伸展 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0129624-CJY07","featured_media":{"alt":null,"id":26494172201059,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a_b16d9a94-3e7e-4286-b58f-00c86edbe2b2.webp?v=1765419981"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43882908319843,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MPB0129657-CJY07","requires_shipping":true,"taxable":true,"featured_image":{"id":34931797229667,"product_id":7937541832803,"position":14,"created_at":"2025-12-11T10:26:18+08:00","updated_at":"2025-12-11T10:26:20+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82c60a70f0f61d02ccc27b990c233f1994f1519f_5332cf2a-eaa3-4504-b70e-f5b501bfb7b2.webp?v=1765419980","variant_ids":[43882908319843]},"available":true,"name":"iPhone 15 Plus Mod NX (MagSafe 兼容) Jin Young Choi 一起伸展 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0129657-CJY07","featured_media":{"alt":null,"id":26494171480163,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/82c60a70f0f61d02ccc27b990c233f1994f1519f_5332cf2a-eaa3-4504-b70e-f5b501bfb7b2.webp?v=1765419980"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43882908123235,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0129624-CJY07","requires_shipping":true,"taxable":true,"featured_image":{"id":34931797950563,"product_id":7937541832803,"position":17,"created_at":"2025-12-11T10:26:19+08:00","updated_at":"2025-12-11T10:26:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a_b16d9a94-3e7e-4286-b58f-00c86edbe2b2.webp?v=1765419981","variant_ids":[43882908123235]},"available":true,"name":"iPhone 15 Plus Mod NX (MagSafe 兼容) Jin Young Choi 一起伸展 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0129624-CJY07","featured_media":{"alt":null,"id":26494172201059,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0ca831cfb9a9ef268cebe1ac92f406114438e9a_b16d9a94-3e7e-4286-b58f-00c86edbe2b2.webp?v=1765419981"}},"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: "停產" }