$product = {"id":7919958098019,"title":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的瑜珈時間","handle":"iphone-13-pro-max-mod-nx-hd66","description":null,"published_at":"2025-11-13T10:06:18+08:00","created_at":"2025-11-10T09:52:45+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 13 Pro Max","merge","reseller-incrediville"],"price":90000,"price_min":90000,"price_max":90000,"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":43827535052899,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01232J5-HD66","requires_shipping":true,"taxable":true,"featured_image":{"id":34786051457123,"product_id":7919958098019,"position":12,"created_at":"2025-11-11T09:40:27+08:00","updated_at":"2025-11-11T09:40:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22_e7bc0b20-de40-4ed0-b216-b7008a13a4b0.webp?v=1762825229","variant_ids":[43827535052899]},"available":true,"name":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的瑜珈時間 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01232J5-HD66","featured_media":{"alt":null,"id":26351508521059,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22_e7bc0b20-de40-4ed0-b216-b7008a13a4b0.webp?v=1762825229"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43827535118435,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0123224-HD66","requires_shipping":true,"taxable":true,"featured_image":{"id":34786052669539,"product_id":7919958098019,"position":18,"created_at":"2025-11-11T09:40:31+08:00","updated_at":"2025-11-11T09:40:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac37bf7d553556131261a0b9496b3e89e1479fc_30eab26d-3e03-4432-aaf4-41b0ec71718a.webp?v=1762825233","variant_ids":[43827535118435]},"available":true,"name":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的瑜珈時間 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0123224-HD66","featured_media":{"alt":null,"id":26351509897315,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac37bf7d553556131261a0b9496b3e89e1479fc_30eab26d-3e03-4432-aaf4-41b0ec71718a.webp?v=1762825233"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8424e032eb836e0dc0ab952204056e5df8a817a9.webp?v=1762739572","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22.webp?v=1762739572","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac37bf7d553556131261a0b9496b3e89e1479fc.webp?v=1762739573","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/49e800ebf07517c34ad422f2cb76ca7c48c9bb0a.webp?v=1762739574","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0322517afae8c2c837fa57c9216fc85cfd1adc37.webp?v=1762739575","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e58a27684f483d1e53cdcc1dc04cde0845e3ee8.webp?v=1762739575","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/844c90eb8f4f83c706b68d68fecbac3e730ec746.webp?v=1762739576","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c36ed14963d6bc3621d3229c2335bc319374890.webp?v=1762739577","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7da3f5ae468c87028871f5e873c01966bd00f29e.webp?v=1762739577","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8424e032eb836e0dc0ab952204056e5df8a817a9_6e6ee77b-2939-483a-8639-e49a5af5f27c.webp?v=1762825226","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e58a27684f483d1e53cdcc1dc04cde0845e3ee8_11d77257-0761-4429-9d25-8dd2232c9070.webp?v=1762825226","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22_e7bc0b20-de40-4ed0-b216-b7008a13a4b0.webp?v=1762825229","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/844c90eb8f4f83c706b68d68fecbac3e730ec746_4d02c9f2-de64-4098-aaee-e618767c6c1e.webp?v=1762825230","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c36ed14963d6bc3621d3229c2335bc319374890_2dca1a65-1637-4375-8c21-de191febe3e4.webp?v=1762825231","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7da3f5ae468c87028871f5e873c01966bd00f29e_fe08972f-74cb-4c11-978b-6af95d6d2636.webp?v=1762825231","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/49e800ebf07517c34ad422f2cb76ca7c48c9bb0a_de6b5f6f-c4d3-41fc-9086-0e690f6c50b6.webp?v=1762825232","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0322517afae8c2c837fa57c9216fc85cfd1adc37_47c1626c-81ec-42ac-b4de-1ed1cf7cde72.webp?v=1762825232","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac37bf7d553556131261a0b9496b3e89e1479fc_30eab26d-3e03-4432-aaf4-41b0ec71718a.webp?v=1762825233"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8424e032eb836e0dc0ab952204056e5df8a817a9.webp?v=1762739572","options":["color"],"media":[{"alt":null,"id":26345443983459,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8424e032eb836e0dc0ab952204056e5df8a817a9.webp?v=1762739572"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8424e032eb836e0dc0ab952204056e5df8a817a9.webp?v=1762739572","width":2000},{"alt":null,"id":26345444114531,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22.webp?v=1762739572"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22.webp?v=1762739572","width":2000},{"alt":null,"id":26345444376675,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac37bf7d553556131261a0b9496b3e89e1479fc.webp?v=1762739573"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac37bf7d553556131261a0b9496b3e89e1479fc.webp?v=1762739573","width":2000},{"alt":null,"id":26345444540515,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/49e800ebf07517c34ad422f2cb76ca7c48c9bb0a.webp?v=1762739574"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/49e800ebf07517c34ad422f2cb76ca7c48c9bb0a.webp?v=1762739574","width":2000},{"alt":null,"id":26345444769891,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0322517afae8c2c837fa57c9216fc85cfd1adc37.webp?v=1762739575"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0322517afae8c2c837fa57c9216fc85cfd1adc37.webp?v=1762739575","width":2000},{"alt":null,"id":26345444933731,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e58a27684f483d1e53cdcc1dc04cde0845e3ee8.webp?v=1762739575"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e58a27684f483d1e53cdcc1dc04cde0845e3ee8.webp?v=1762739575","width":2000},{"alt":null,"id":26345445032035,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/844c90eb8f4f83c706b68d68fecbac3e730ec746.webp?v=1762739576"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/844c90eb8f4f83c706b68d68fecbac3e730ec746.webp?v=1762739576","width":2000},{"alt":null,"id":26345445163107,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c36ed14963d6bc3621d3229c2335bc319374890.webp?v=1762739577"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c36ed14963d6bc3621d3229c2335bc319374890.webp?v=1762739577","width":2000},{"alt":null,"id":26345445294179,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7da3f5ae468c87028871f5e873c01966bd00f29e.webp?v=1762739577"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7da3f5ae468c87028871f5e873c01966bd00f29e.webp?v=1762739577","width":2000},{"alt":null,"id":26351507570787,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8424e032eb836e0dc0ab952204056e5df8a817a9_6e6ee77b-2939-483a-8639-e49a5af5f27c.webp?v=1762825226"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8424e032eb836e0dc0ab952204056e5df8a817a9_6e6ee77b-2939-483a-8639-e49a5af5f27c.webp?v=1762825226","width":2000},{"alt":null,"id":26351507767395,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e58a27684f483d1e53cdcc1dc04cde0845e3ee8_11d77257-0761-4429-9d25-8dd2232c9070.webp?v=1762825226"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e58a27684f483d1e53cdcc1dc04cde0845e3ee8_11d77257-0761-4429-9d25-8dd2232c9070.webp?v=1762825226","width":2000},{"alt":null,"id":26351508521059,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22_e7bc0b20-de40-4ed0-b216-b7008a13a4b0.webp?v=1762825229"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22_e7bc0b20-de40-4ed0-b216-b7008a13a4b0.webp?v=1762825229","width":2000},{"alt":null,"id":26351508750435,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/844c90eb8f4f83c706b68d68fecbac3e730ec746_4d02c9f2-de64-4098-aaee-e618767c6c1e.webp?v=1762825230"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/844c90eb8f4f83c706b68d68fecbac3e730ec746_4d02c9f2-de64-4098-aaee-e618767c6c1e.webp?v=1762825230","width":2000},{"alt":null,"id":26351508881507,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c36ed14963d6bc3621d3229c2335bc319374890_2dca1a65-1637-4375-8c21-de191febe3e4.webp?v=1762825231"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c36ed14963d6bc3621d3229c2335bc319374890_2dca1a65-1637-4375-8c21-de191febe3e4.webp?v=1762825231","width":2000},{"alt":null,"id":26351508979811,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7da3f5ae468c87028871f5e873c01966bd00f29e_fe08972f-74cb-4c11-978b-6af95d6d2636.webp?v=1762825231"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7da3f5ae468c87028871f5e873c01966bd00f29e_fe08972f-74cb-4c11-978b-6af95d6d2636.webp?v=1762825231","width":2000},{"alt":null,"id":26351509373027,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/49e800ebf07517c34ad422f2cb76ca7c48c9bb0a_de6b5f6f-c4d3-41fc-9086-0e690f6c50b6.webp?v=1762825232"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/49e800ebf07517c34ad422f2cb76ca7c48c9bb0a_de6b5f6f-c4d3-41fc-9086-0e690f6c50b6.webp?v=1762825232","width":2000},{"alt":null,"id":26351509569635,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0322517afae8c2c837fa57c9216fc85cfd1adc37_47c1626c-81ec-42ac-b4de-1ed1cf7cde72.webp?v=1762825232"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0322517afae8c2c837fa57c9216fc85cfd1adc37_47c1626c-81ec-42ac-b4de-1ed1cf7cde72.webp?v=1762825232","width":2000},{"alt":null,"id":26351509897315,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac37bf7d553556131261a0b9496b3e89e1479fc_30eab26d-3e03-4432-aaf4-41b0ec71718a.webp?v=1762825233"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac37bf7d553556131261a0b9496b3e89e1479fc_30eab26d-3e03-4432-aaf4-41b0ec71718a.webp?v=1762825233","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43827535052899,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01232J5-HD66","requires_shipping":true,"taxable":true,"featured_image":{"id":34786051457123,"product_id":7919958098019,"position":12,"created_at":"2025-11-11T09:40:27+08:00","updated_at":"2025-11-11T09:40:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22_e7bc0b20-de40-4ed0-b216-b7008a13a4b0.webp?v=1762825229","variant_ids":[43827535052899]},"available":true,"name":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的瑜珈時間 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01232J5-HD66","featured_media":{"alt":null,"id":26351508521059,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22_e7bc0b20-de40-4ed0-b216-b7008a13a4b0.webp?v=1762825229"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43827535118435,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0123224-HD66","requires_shipping":true,"taxable":true,"featured_image":{"id":34786052669539,"product_id":7919958098019,"position":18,"created_at":"2025-11-11T09:40:31+08:00","updated_at":"2025-11-11T09:40:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac37bf7d553556131261a0b9496b3e89e1479fc_30eab26d-3e03-4432-aaf4-41b0ec71718a.webp?v=1762825233","variant_ids":[43827535118435]},"available":true,"name":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的瑜珈時間 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0123224-HD66","featured_media":{"alt":null,"id":26351509897315,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cac37bf7d553556131261a0b9496b3e89e1479fc_30eab26d-3e03-4432-aaf4-41b0ec71718a.webp?v=1762825233"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43827535052899,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01232J5-HD66","requires_shipping":true,"taxable":true,"featured_image":{"id":34786051457123,"product_id":7919958098019,"position":12,"created_at":"2025-11-11T09:40:27+08:00","updated_at":"2025-11-11T09:40:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22_e7bc0b20-de40-4ed0-b216-b7008a13a4b0.webp?v=1762825229","variant_ids":[43827535052899]},"available":true,"name":"iPhone 13 Pro Max Mod NX Incrediville 怪奇事物所 所長的瑜珈時間 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01232J5-HD66","featured_media":{"alt":null,"id":26351508521059,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9bff571eaa524ba73918d3b8ad8cffef81a90e22_e7bc0b20-de40-4ed0-b216-b7008a13a4b0.webp?v=1762825229"}},"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: "停產" }