$product = {"id":7986053578851,"title":"iPhone XR Mod NX MITSUME Ultra Power","handle":"iphone-xr-mod-nx-mit28","description":null,"published_at":"2026-03-26T11:23:18+08:00","created_at":"2026-03-26T09:57:35+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-mitsume","device-iPhone XR","merge","reseller-mitsume"],"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":44079492268131,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0108515-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543557406819,"product_id":7986053578851,"position":3,"created_at":"2026-03-26T09:58:03+08:00","updated_at":"2026-03-26T09:58:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c63337f580066f660667cd4df9a5879faf95da55.webp?v=1774490286","variant_ids":[44079492268131]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108515-MIT28","featured_media":{"alt":null,"id":27077300944995,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c63337f580066f660667cd4df9a5879faf95da55.webp?v=1774490286"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44079499640931,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01085C1-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543558914147,"product_id":7986053578851,"position":6,"created_at":"2026-03-26T09:58:05+08:00","updated_at":"2026-03-26T09:58:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/611a13efb372ad5344e76d3780aa2251401dcc70.webp?v=1774490287","variant_ids":[44079499640931]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01085C1-MIT28","featured_media":{"alt":null,"id":27077302452323,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/611a13efb372ad5344e76d3780aa2251401dcc70.webp?v=1774490287"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44079500787811,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0108524-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543559241827,"product_id":7986053578851,"position":7,"created_at":"2026-03-26T09:58:06+08:00","updated_at":"2026-03-26T09:58:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6282678f1a5bdca4c224421da4a446ccaf632de3.webp?v=1774490288","variant_ids":[44079500787811]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108524-MIT28","featured_media":{"alt":null,"id":27077302780003,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6282678f1a5bdca4c224421da4a446ccaf632de3.webp?v=1774490288"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44079501115491,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0108557-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543556980835,"product_id":7986053578851,"position":2,"created_at":"2026-03-26T09:58:03+08:00","updated_at":"2026-03-26T09:58:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62e253592cb1e115c45bcdd0a7204730e00a4ae6.webp?v=1774490285","variant_ids":[44079501115491]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108557-MIT28","featured_media":{"alt":null,"id":27077300519011,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62e253592cb1e115c45bcdd0a7204730e00a4ae6.webp?v=1774490285"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44079501705315,"title":"Platinum Gray","option1":"Platinum Gray","option2":null,"option3":null,"sku":"NPB01085C0-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543557898339,"product_id":7986053578851,"position":4,"created_at":"2026-03-26T09:58:04+08:00","updated_at":"2026-03-26T09:58:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc92f266447246ba8ac02127a01e47e3d9cd2f0f.webp?v=1774490286","variant_ids":[44079501705315]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Platinum Gray","public_title":"Platinum Gray","options":["Platinum Gray"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01085C0-MIT28","featured_media":{"alt":null,"id":27077301436515,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc92f266447246ba8ac02127a01e47e3d9cd2f0f.webp?v=1774490286"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44079502032995,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0108504-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543558389859,"product_id":7986053578851,"position":5,"created_at":"2026-03-26T09:58:05+08:00","updated_at":"2026-03-26T09:58:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a71b2397276c3b1ae714065c460c8be10337b8.webp?v=1774490287","variant_ids":[44079502032995]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108504-MIT28","featured_media":{"alt":null,"id":27077301928035,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a71b2397276c3b1ae714065c460c8be10337b8.webp?v=1774490287"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29947c78a6015c8a929210f06714e96aa5a4d069.webp?v=1774490284","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62e253592cb1e115c45bcdd0a7204730e00a4ae6.webp?v=1774490285","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c63337f580066f660667cd4df9a5879faf95da55.webp?v=1774490286","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc92f266447246ba8ac02127a01e47e3d9cd2f0f.webp?v=1774490286","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a71b2397276c3b1ae714065c460c8be10337b8.webp?v=1774490287","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/611a13efb372ad5344e76d3780aa2251401dcc70.webp?v=1774490287","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6282678f1a5bdca4c224421da4a446ccaf632de3.webp?v=1774490288"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29947c78a6015c8a929210f06714e96aa5a4d069.webp?v=1774490284","options":["color"],"media":[{"alt":null,"id":27077300060259,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29947c78a6015c8a929210f06714e96aa5a4d069.webp?v=1774490284"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/29947c78a6015c8a929210f06714e96aa5a4d069.webp?v=1774490284","width":2000},{"alt":null,"id":27077300519011,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62e253592cb1e115c45bcdd0a7204730e00a4ae6.webp?v=1774490285"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62e253592cb1e115c45bcdd0a7204730e00a4ae6.webp?v=1774490285","width":2000},{"alt":null,"id":27077300944995,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c63337f580066f660667cd4df9a5879faf95da55.webp?v=1774490286"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c63337f580066f660667cd4df9a5879faf95da55.webp?v=1774490286","width":2000},{"alt":null,"id":27077301436515,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc92f266447246ba8ac02127a01e47e3d9cd2f0f.webp?v=1774490286"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc92f266447246ba8ac02127a01e47e3d9cd2f0f.webp?v=1774490286","width":2000},{"alt":null,"id":27077301928035,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a71b2397276c3b1ae714065c460c8be10337b8.webp?v=1774490287"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a71b2397276c3b1ae714065c460c8be10337b8.webp?v=1774490287","width":2000},{"alt":null,"id":27077302452323,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/611a13efb372ad5344e76d3780aa2251401dcc70.webp?v=1774490287"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/611a13efb372ad5344e76d3780aa2251401dcc70.webp?v=1774490287","width":2000},{"alt":null,"id":27077302780003,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6282678f1a5bdca4c224421da4a446ccaf632de3.webp?v=1774490288"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6282678f1a5bdca4c224421da4a446ccaf632de3.webp?v=1774490288","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":44079492268131,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0108515-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543557406819,"product_id":7986053578851,"position":3,"created_at":"2026-03-26T09:58:03+08:00","updated_at":"2026-03-26T09:58:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c63337f580066f660667cd4df9a5879faf95da55.webp?v=1774490286","variant_ids":[44079492268131]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108515-MIT28","featured_media":{"alt":null,"id":27077300944995,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c63337f580066f660667cd4df9a5879faf95da55.webp?v=1774490286"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44079499640931,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01085C1-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543558914147,"product_id":7986053578851,"position":6,"created_at":"2026-03-26T09:58:05+08:00","updated_at":"2026-03-26T09:58:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/611a13efb372ad5344e76d3780aa2251401dcc70.webp?v=1774490287","variant_ids":[44079499640931]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01085C1-MIT28","featured_media":{"alt":null,"id":27077302452323,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/611a13efb372ad5344e76d3780aa2251401dcc70.webp?v=1774490287"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44079500787811,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0108524-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543559241827,"product_id":7986053578851,"position":7,"created_at":"2026-03-26T09:58:06+08:00","updated_at":"2026-03-26T09:58:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6282678f1a5bdca4c224421da4a446ccaf632de3.webp?v=1774490288","variant_ids":[44079500787811]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108524-MIT28","featured_media":{"alt":null,"id":27077302780003,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6282678f1a5bdca4c224421da4a446ccaf632de3.webp?v=1774490288"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44079501115491,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0108557-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543556980835,"product_id":7986053578851,"position":2,"created_at":"2026-03-26T09:58:03+08:00","updated_at":"2026-03-26T09:58:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62e253592cb1e115c45bcdd0a7204730e00a4ae6.webp?v=1774490285","variant_ids":[44079501115491]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108557-MIT28","featured_media":{"alt":null,"id":27077300519011,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62e253592cb1e115c45bcdd0a7204730e00a4ae6.webp?v=1774490285"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44079501705315,"title":"Platinum Gray","option1":"Platinum Gray","option2":null,"option3":null,"sku":"NPB01085C0-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543557898339,"product_id":7986053578851,"position":4,"created_at":"2026-03-26T09:58:04+08:00","updated_at":"2026-03-26T09:58:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc92f266447246ba8ac02127a01e47e3d9cd2f0f.webp?v=1774490286","variant_ids":[44079501705315]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Platinum Gray","public_title":"Platinum Gray","options":["Platinum Gray"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01085C0-MIT28","featured_media":{"alt":null,"id":27077301436515,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc92f266447246ba8ac02127a01e47e3d9cd2f0f.webp?v=1774490286"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44079502032995,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0108504-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543558389859,"product_id":7986053578851,"position":5,"created_at":"2026-03-26T09:58:05+08:00","updated_at":"2026-03-26T09:58:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a71b2397276c3b1ae714065c460c8be10337b8.webp?v=1774490287","variant_ids":[44079502032995]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108504-MIT28","featured_media":{"alt":null,"id":27077301928035,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a71b2397276c3b1ae714065c460c8be10337b8.webp?v=1774490287"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":44079492268131,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0108515-MIT28","requires_shipping":true,"taxable":true,"featured_image":{"id":35543557406819,"product_id":7986053578851,"position":3,"created_at":"2026-03-26T09:58:03+08:00","updated_at":"2026-03-26T09:58:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c63337f580066f660667cd4df9a5879faf95da55.webp?v=1774490286","variant_ids":[44079492268131]},"available":true,"name":"iPhone XR Mod NX MITSUME Ultra Power - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108515-MIT28","featured_media":{"alt":null,"id":27077300944995,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c63337f580066f660667cd4df9a5879faf95da55.webp?v=1774490286"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}; $device_handle = null var sellingStatus if ($bumper) { $(document).ready(function() { var productImg = $product.images[0] var bumperVariants = $bumper.variants; var bumperColors = new Object(); var currentVariant = ''; var productType = ''; bumperVariants.forEach(variant => { bumperColors[`${variant.title.split(' (')[0].toLowerCase()}`] = variant.featured_image.src; }); if (productType === 'mod-nx-backplate' || productType === 'mod-backplate') { mergeImages( [productImg, bumperColors[currentVariant]], { crossOrigin: 'anonymous' } ).then(mergedImg => { $('.merged-img').attr('src', mergedImg); }); } else { mergeImages( [bumperColors[currentVariant], productImg], { crossOrigin: 'anonymous' } ).then(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: "停產" }