$product = {"id":7159400300643,"title":"iPhone 14 Plus Clear NBA Logo-波士頓塞爾提克 Boston Celtics","handle":"iphone-14-plus-jellytint-pm19","description":null,"published_at":"2024-02-01T10:41:27+08:00","created_at":"2024-01-26T18:07:15+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone 14 Plus","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":41214694752355,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012610G-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152335237219,"product_id":7159400300643,"position":11,"created_at":"2026-07-02T12:16:08+08:00","updated_at":"2026-07-02T12:16:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_7ebf86bc-1558-4d7e-8f49-b526bfbb66b5.webp?v=1782965770","variant_ids":[41214694752355]},"available":true,"name":"iPhone 14 Plus Clear NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"CCN012610G-PM19","featured_media":{"alt":null,"id":27657208725603,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_7ebf86bc-1558-4d7e-8f49-b526bfbb66b5.webp?v=1782965770"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41214694785123,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"CCN012610H-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152335466595,"product_id":7159400300643,"position":12,"created_at":"2026-07-02T12:16:09+08:00","updated_at":"2026-07-02T12:16:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_942a4264-1980-4c18-84f9-751925aab505.webp?v=1782965771","variant_ids":[41214694785123]},"available":true,"name":"iPhone 14 Plus Clear NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"CCN012610H-PM19","featured_media":{"alt":null,"id":27657208954979,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_942a4264-1980-4c18-84f9-751925aab505.webp?v=1782965771"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41214694817891,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012610I-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152336285795,"product_id":7159400300643,"position":13,"created_at":"2026-07-02T12:16:10+08:00","updated_at":"2026-07-02T12:16:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_eb9ccfc1-0ac3-4380-a2d4-254d397f95d8.webp?v=1782965772","variant_ids":[41214694817891]},"available":true,"name":"iPhone 14 Plus Clear NBA Logo-波士頓塞爾提克 Boston Celtics - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":128000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012610I-PM19","featured_media":{"alt":null,"id":27657209741411,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_eb9ccfc1-0ac3-4380-a2d4-254d397f95d8.webp?v=1782965772"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-261-PM19_b96486a0-a0ad-4db0-a73e-7bd76ea797a9.png?v=1706263638","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb.webp?v=1782206851","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2.webp?v=1782206852","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab.webp?v=1782206853","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_b0f2d731-19a5-4343-b4fa-615750e792cf.webp?v=1782957777","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_394b885a-2803-4d8d-935f-0901b154501d.webp?v=1782957778","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_8a402a7c-1361-4aae-8045-b3ba5ed19819.webp?v=1782957779","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_04d486f6-03f6-4498-9ae6-d7d6be3f0a9a.webp?v=1782961371","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_bd1b9a45-ef7b-4c13-81a1-d361210c16a2.webp?v=1782961372","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_00ddd6b7-eeec-402b-b8da-2833a1f3d9fc.webp?v=1782961372","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_7ebf86bc-1558-4d7e-8f49-b526bfbb66b5.webp?v=1782965770","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_942a4264-1980-4c18-84f9-751925aab505.webp?v=1782965771","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_eb9ccfc1-0ac3-4380-a2d4-254d397f95d8.webp?v=1782965772"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-261-PM19_b96486a0-a0ad-4db0-a73e-7bd76ea797a9.png?v=1706263638","options":["color"],"media":[{"alt":null,"id":23219666190435,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-261-PM19_b96486a0-a0ad-4db0-a73e-7bd76ea797a9.png?v=1706263638"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-261-PM19_b96486a0-a0ad-4db0-a73e-7bd76ea797a9.png?v=1706263638","width":2000},{"alt":null,"id":27575732961379,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb.webp?v=1782206851"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb.webp?v=1782206851","width":2000},{"alt":null,"id":27575733256291,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2.webp?v=1782206852"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2.webp?v=1782206852","width":2000},{"alt":null,"id":27575733846115,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab.webp?v=1782206853"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab.webp?v=1782206853","width":2000},{"alt":null,"id":27655915503715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_b0f2d731-19a5-4343-b4fa-615750e792cf.webp?v=1782957777"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_b0f2d731-19a5-4343-b4fa-615750e792cf.webp?v=1782957777","width":2000},{"alt":null,"id":27655916028003,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_394b885a-2803-4d8d-935f-0901b154501d.webp?v=1782957778"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_394b885a-2803-4d8d-935f-0901b154501d.webp?v=1782957778","width":2000},{"alt":null,"id":27655916519523,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_8a402a7c-1361-4aae-8045-b3ba5ed19819.webp?v=1782957779"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_8a402a7c-1361-4aae-8045-b3ba5ed19819.webp?v=1782957779","width":2000},{"alt":null,"id":27656738046051,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_04d486f6-03f6-4498-9ae6-d7d6be3f0a9a.webp?v=1782961371"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_04d486f6-03f6-4498-9ae6-d7d6be3f0a9a.webp?v=1782961371","width":2000},{"alt":null,"id":27656738996323,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_bd1b9a45-ef7b-4c13-81a1-d361210c16a2.webp?v=1782961372"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_bd1b9a45-ef7b-4c13-81a1-d361210c16a2.webp?v=1782961372","width":2000},{"alt":null,"id":27656739422307,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_00ddd6b7-eeec-402b-b8da-2833a1f3d9fc.webp?v=1782961372"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_00ddd6b7-eeec-402b-b8da-2833a1f3d9fc.webp?v=1782961372","width":2000},{"alt":null,"id":27657208725603,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_7ebf86bc-1558-4d7e-8f49-b526bfbb66b5.webp?v=1782965770"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_7ebf86bc-1558-4d7e-8f49-b526bfbb66b5.webp?v=1782965770","width":2000},{"alt":null,"id":27657208954979,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_942a4264-1980-4c18-84f9-751925aab505.webp?v=1782965771"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_942a4264-1980-4c18-84f9-751925aab505.webp?v=1782965771","width":2000},{"alt":null,"id":27657209741411,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_eb9ccfc1-0ac3-4380-a2d4-254d397f95d8.webp?v=1782965772"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_eb9ccfc1-0ac3-4380-a2d4-254d397f95d8.webp?v=1782965772","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":41214694752355,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012610G-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152335237219,"product_id":7159400300643,"position":11,"created_at":"2026-07-02T12:16:08+08:00","updated_at":"2026-07-02T12:16:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_7ebf86bc-1558-4d7e-8f49-b526bfbb66b5.webp?v=1782965770","variant_ids":[41214694752355]},"available":true,"name":"iPhone 14 Plus Clear NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"CCN012610G-PM19","featured_media":{"alt":null,"id":27657208725603,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_7ebf86bc-1558-4d7e-8f49-b526bfbb66b5.webp?v=1782965770"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41214694785123,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"CCN012610H-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152335466595,"product_id":7159400300643,"position":12,"created_at":"2026-07-02T12:16:09+08:00","updated_at":"2026-07-02T12:16:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_942a4264-1980-4c18-84f9-751925aab505.webp?v=1782965771","variant_ids":[41214694785123]},"available":true,"name":"iPhone 14 Plus Clear NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"CCN012610H-PM19","featured_media":{"alt":null,"id":27657208954979,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a42f702e71f7a8999a22eb8df35c93eba2c102cb_942a4264-1980-4c18-84f9-751925aab505.webp?v=1782965771"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41214694817891,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012610I-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152336285795,"product_id":7159400300643,"position":13,"created_at":"2026-07-02T12:16:10+08:00","updated_at":"2026-07-02T12:16:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_eb9ccfc1-0ac3-4380-a2d4-254d397f95d8.webp?v=1782965772","variant_ids":[41214694817891]},"available":true,"name":"iPhone 14 Plus Clear NBA Logo-波士頓塞爾提克 Boston Celtics - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":128000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012610I-PM19","featured_media":{"alt":null,"id":27657209741411,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9386a0aa0edc1839b2589fdea4647df07fac2ab_eb9ccfc1-0ac3-4380-a2d4-254d397f95d8.webp?v=1782965772"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":41214694752355,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012610G-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152335237219,"product_id":7159400300643,"position":11,"created_at":"2026-07-02T12:16:08+08:00","updated_at":"2026-07-02T12:16:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_7ebf86bc-1558-4d7e-8f49-b526bfbb66b5.webp?v=1782965770","variant_ids":[41214694752355]},"available":true,"name":"iPhone 14 Plus Clear NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"CCN012610G-PM19","featured_media":{"alt":null,"id":27657208725603,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95f3778bbbe3c7f88bc2e8ef1fd33df707bd05b2_7ebf86bc-1558-4d7e-8f49-b526bfbb66b5.webp?v=1782965770"}},"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: "停產" }