$product = {"id":7159376347235,"title":"iPhone 14 Pro Max Clear NBA Logo-密爾瓦基公鹿 Milwaukee Bucks","handle":"iphone-14-pro-max-jellytint-pm14","description":null,"published_at":"2024-02-01T10:53:13+08:00","created_at":"2024-01-26T18:04:26+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone 14 Pro Max","merge","reseller-nba"],"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":41214573248611,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012630G-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152357060707,"product_id":7159376347235,"position":13,"created_at":"2026-07-02T12:17:02+08:00","updated_at":"2026-07-02T12:17:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_f7628203-c2ac-4cdc-af25-e7658bf2b45a.webp?v=1782965825","variant_ids":[41214573248611]},"available":true,"name":"iPhone 14 Pro Max Clear NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012630G-PM14","featured_media":{"alt":null,"id":27657230549091,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_f7628203-c2ac-4cdc-af25-e7658bf2b45a.webp?v=1782965825"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41214573281379,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"CCN012630H-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152356864099,"product_id":7159376347235,"position":11,"created_at":"2026-07-02T12:17:01+08:00","updated_at":"2026-07-02T12:17:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_bb6f277d-628e-4ca7-974a-2593660a2fc4.webp?v=1782965823","variant_ids":[41214573281379]},"available":true,"name":"iPhone 14 Pro Max Clear NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":128000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012630H-PM14","featured_media":{"alt":null,"id":27657230352483,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_bb6f277d-628e-4ca7-974a-2593660a2fc4.webp?v=1782965823"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41214573379683,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012630J-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152356962403,"product_id":7159376347235,"position":12,"created_at":"2026-07-02T12:17:02+08:00","updated_at":"2026-07-02T12:17:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_fb85a7c7-1870-401d-a31d-2c1fc696df80.webp?v=1782965824","variant_ids":[41214573379683]},"available":true,"name":"iPhone 14 Pro Max Clear NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012630J-PM14","featured_media":{"alt":null,"id":27657230450787,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_fb85a7c7-1870-401d-a31d-2c1fc696df80.webp?v=1782965824"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-263-PM14_6b46a273-ff4c-49d8-b33a-8ecdcbeef9c2.png?v=1706263469","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f.webp?v=1782207324","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a.webp?v=1782207324","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560.webp?v=1782207325","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_fd7feb90-0c59-4f21-a255-0f5563eb3d62.webp?v=1782957847","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_100c9b1d-8962-41d1-beef-35010c576207.webp?v=1782957848","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_dc9efd3a-5f63-49e5-8e98-2c9a43ccdd10.webp?v=1782957849","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_28fa99ba-90d6-4342-a83e-d24cce45410c.webp?v=1782961405","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_ab1121a5-8a4f-4226-b0fe-76b8e9c3affe.webp?v=1782961406","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_45a457d8-3d4f-4fb3-8ed3-de93135ebee9.webp?v=1782961408","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_bb6f277d-628e-4ca7-974a-2593660a2fc4.webp?v=1782965823","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_fb85a7c7-1870-401d-a31d-2c1fc696df80.webp?v=1782965824","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_f7628203-c2ac-4cdc-af25-e7658bf2b45a.webp?v=1782965825"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-263-PM14_6b46a273-ff4c-49d8-b33a-8ecdcbeef9c2.png?v=1706263469","options":["color"],"media":[{"alt":null,"id":23219635224675,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-263-PM14_6b46a273-ff4c-49d8-b33a-8ecdcbeef9c2.png?v=1706263469"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-263-PM14_6b46a273-ff4c-49d8-b33a-8ecdcbeef9c2.png?v=1706263469","width":2000},{"alt":null,"id":27575903813731,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f.webp?v=1782207324"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f.webp?v=1782207324","width":2000},{"alt":null,"id":27575903879267,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a.webp?v=1782207324"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a.webp?v=1782207324","width":2000},{"alt":null,"id":27575903977571,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560.webp?v=1782207325"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560.webp?v=1782207325","width":2000},{"alt":null,"id":27655942373475,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_fd7feb90-0c59-4f21-a255-0f5563eb3d62.webp?v=1782957847"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_fd7feb90-0c59-4f21-a255-0f5563eb3d62.webp?v=1782957847","width":2000},{"alt":null,"id":27655943061603,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_100c9b1d-8962-41d1-beef-35010c576207.webp?v=1782957848"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_100c9b1d-8962-41d1-beef-35010c576207.webp?v=1782957848","width":2000},{"alt":null,"id":27655943454819,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_dc9efd3a-5f63-49e5-8e98-2c9a43ccdd10.webp?v=1782957849"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_dc9efd3a-5f63-49e5-8e98-2c9a43ccdd10.webp?v=1782957849","width":2000},{"alt":null,"id":27656755871843,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_28fa99ba-90d6-4342-a83e-d24cce45410c.webp?v=1782961405"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_28fa99ba-90d6-4342-a83e-d24cce45410c.webp?v=1782961405","width":2000},{"alt":null,"id":27656756265059,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_ab1121a5-8a4f-4226-b0fe-76b8e9c3affe.webp?v=1782961406"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_ab1121a5-8a4f-4226-b0fe-76b8e9c3affe.webp?v=1782961406","width":2000},{"alt":null,"id":27656756658275,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_45a457d8-3d4f-4fb3-8ed3-de93135ebee9.webp?v=1782961408"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_45a457d8-3d4f-4fb3-8ed3-de93135ebee9.webp?v=1782961408","width":2000},{"alt":null,"id":27657230352483,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_bb6f277d-628e-4ca7-974a-2593660a2fc4.webp?v=1782965823"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_bb6f277d-628e-4ca7-974a-2593660a2fc4.webp?v=1782965823","width":2000},{"alt":null,"id":27657230450787,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_fb85a7c7-1870-401d-a31d-2c1fc696df80.webp?v=1782965824"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_fb85a7c7-1870-401d-a31d-2c1fc696df80.webp?v=1782965824","width":2000},{"alt":null,"id":27657230549091,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_f7628203-c2ac-4cdc-af25-e7658bf2b45a.webp?v=1782965825"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_f7628203-c2ac-4cdc-af25-e7658bf2b45a.webp?v=1782965825","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":41214573248611,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012630G-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152357060707,"product_id":7159376347235,"position":13,"created_at":"2026-07-02T12:17:02+08:00","updated_at":"2026-07-02T12:17:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_f7628203-c2ac-4cdc-af25-e7658bf2b45a.webp?v=1782965825","variant_ids":[41214573248611]},"available":true,"name":"iPhone 14 Pro Max Clear NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012630G-PM14","featured_media":{"alt":null,"id":27657230549091,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_f7628203-c2ac-4cdc-af25-e7658bf2b45a.webp?v=1782965825"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41214573281379,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"CCN012630H-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152356864099,"product_id":7159376347235,"position":11,"created_at":"2026-07-02T12:17:01+08:00","updated_at":"2026-07-02T12:17:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_bb6f277d-628e-4ca7-974a-2593660a2fc4.webp?v=1782965823","variant_ids":[41214573281379]},"available":true,"name":"iPhone 14 Pro Max Clear NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":128000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012630H-PM14","featured_media":{"alt":null,"id":27657230352483,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9658a1dc3817ef21a5dcb9985be41b0fb463db6a_bb6f277d-628e-4ca7-974a-2593660a2fc4.webp?v=1782965823"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41214573379683,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012630J-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152356962403,"product_id":7159376347235,"position":12,"created_at":"2026-07-02T12:17:02+08:00","updated_at":"2026-07-02T12:17:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_fb85a7c7-1870-401d-a31d-2c1fc696df80.webp?v=1782965824","variant_ids":[41214573379683]},"available":true,"name":"iPhone 14 Pro Max Clear NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":128000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012630J-PM14","featured_media":{"alt":null,"id":27657230450787,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaa2fe9080c85c75161093b794bfaa681a286560_fb85a7c7-1870-401d-a31d-2c1fc696df80.webp?v=1782965824"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":41214573248611,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012630G-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152357060707,"product_id":7159376347235,"position":13,"created_at":"2026-07-02T12:17:02+08:00","updated_at":"2026-07-02T12:17:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_f7628203-c2ac-4cdc-af25-e7658bf2b45a.webp?v=1782965825","variant_ids":[41214573248611]},"available":true,"name":"iPhone 14 Pro Max Clear NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012630G-PM14","featured_media":{"alt":null,"id":27657230549091,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97fcec7fe6dbfe3e8160b65b85d5abe6f51ded2f_f7628203-c2ac-4cdc-af25-e7658bf2b45a.webp?v=1782965825"}},"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: "停產" }