$product = {"id":7888981622883,"title":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1","handle":"iphone-15-plus-solidx-tb23","description":null,"published_at":"2025-09-24T11:08:01+08:00","created_at":"2025-09-23T12:13:37+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-oracle-redbull-racing","device-iPhone 15 Plus","merge","reseller-oracle-redbull-racing"],"price":118000,"price_min":118000,"price_max":118000,"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":43744933544035,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506438755,"product_id":7888981622883,"position":6,"created_at":"2025-09-23T12:13:45+08:00","updated_at":"2025-09-23T12:13:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbb40c85014bae2bc87c240e9a8a3befd6b10ffb.webp?v=1758600826","variant_ids":[43744933544035]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960B-TB23","featured_media":{"alt":null,"id":26088880865379,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbb40c85014bae2bc87c240e9a8a3befd6b10ffb.webp?v=1758600826"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744934658147,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012960A-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506340451,"product_id":7888981622883,"position":5,"created_at":"2025-09-23T12:13:44+08:00","updated_at":"2025-09-23T12:13:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da60e2435d65f60f654f82a74fbd3938e8e88024.webp?v=1758600826","variant_ids":[43744934658147]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960A-TB23","featured_media":{"alt":null,"id":26088880767075,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da60e2435d65f60f654f82a74fbd3938e8e88024.webp?v=1758600826"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744934690915,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"NST01296Z9-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506569827,"product_id":7888981622883,"position":7,"created_at":"2025-09-23T12:13:45+08:00","updated_at":"2025-09-23T12:13:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/578f5b9c5b9b2b9d7e69850654ef1eb7279dbc21.webp?v=1758600827","variant_ids":[43744934690915]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01296Z9-TB23","featured_media":{"alt":null,"id":26088880996451,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/578f5b9c5b9b2b9d7e69850654ef1eb7279dbc21.webp?v=1758600827"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744934723683,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01296O8-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506045539,"product_id":7888981622883,"position":2,"created_at":"2025-09-23T12:13:43+08:00","updated_at":"2025-09-23T12:13:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fd9f41e556cc792a3451cfc5632ac10ab2a48f73.webp?v=1758600825","variant_ids":[43744934723683]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01296O8-TB23","featured_media":{"alt":null,"id":26088880472163,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fd9f41e556cc792a3451cfc5632ac10ab2a48f73.webp?v=1758600825"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744934756451,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506176611,"product_id":7888981622883,"position":3,"created_at":"2025-09-23T12:13:43+08:00","updated_at":"2025-09-23T12:13:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/930ab1935f3c61a92bab03b93f4312e298f5ab4a.webp?v=1758600826","variant_ids":[43744934756451]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Black","public_title":"Black","options":["Black"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129652-TB23","featured_media":{"alt":null,"id":26088880603235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/930ab1935f3c61a92bab03b93f4312e298f5ab4a.webp?v=1758600826"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744934789219,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01296Z8-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506274915,"product_id":7888981622883,"position":4,"created_at":"2025-09-23T12:13:44+08:00","updated_at":"2025-09-23T12:13:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be42780b2164a6c2382327af8a2be3659c71d1d8.webp?v=1758600825","variant_ids":[43744934789219]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01296Z8-TB23","featured_media":{"alt":null,"id":26088880701539,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be42780b2164a6c2382327af8a2be3659c71d1d8.webp?v=1758600825"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99eff16f55046ee9ab37084af3df0194ab8f26d5.webp?v=1758600824","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fd9f41e556cc792a3451cfc5632ac10ab2a48f73.webp?v=1758600825","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/930ab1935f3c61a92bab03b93f4312e298f5ab4a.webp?v=1758600826","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be42780b2164a6c2382327af8a2be3659c71d1d8.webp?v=1758600825","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da60e2435d65f60f654f82a74fbd3938e8e88024.webp?v=1758600826","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbb40c85014bae2bc87c240e9a8a3befd6b10ffb.webp?v=1758600826","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/578f5b9c5b9b2b9d7e69850654ef1eb7279dbc21.webp?v=1758600827"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99eff16f55046ee9ab37084af3df0194ab8f26d5.webp?v=1758600824","options":["color"],"media":[{"alt":null,"id":26088880373859,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99eff16f55046ee9ab37084af3df0194ab8f26d5.webp?v=1758600824"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/99eff16f55046ee9ab37084af3df0194ab8f26d5.webp?v=1758600824","width":2000},{"alt":null,"id":26088880472163,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fd9f41e556cc792a3451cfc5632ac10ab2a48f73.webp?v=1758600825"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fd9f41e556cc792a3451cfc5632ac10ab2a48f73.webp?v=1758600825","width":2000},{"alt":null,"id":26088880603235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/930ab1935f3c61a92bab03b93f4312e298f5ab4a.webp?v=1758600826"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/930ab1935f3c61a92bab03b93f4312e298f5ab4a.webp?v=1758600826","width":2000},{"alt":null,"id":26088880701539,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be42780b2164a6c2382327af8a2be3659c71d1d8.webp?v=1758600825"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be42780b2164a6c2382327af8a2be3659c71d1d8.webp?v=1758600825","width":2000},{"alt":null,"id":26088880767075,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da60e2435d65f60f654f82a74fbd3938e8e88024.webp?v=1758600826"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da60e2435d65f60f654f82a74fbd3938e8e88024.webp?v=1758600826","width":2000},{"alt":null,"id":26088880865379,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbb40c85014bae2bc87c240e9a8a3befd6b10ffb.webp?v=1758600826"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbb40c85014bae2bc87c240e9a8a3befd6b10ffb.webp?v=1758600826","width":2000},{"alt":null,"id":26088880996451,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/578f5b9c5b9b2b9d7e69850654ef1eb7279dbc21.webp?v=1758600827"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/578f5b9c5b9b2b9d7e69850654ef1eb7279dbc21.webp?v=1758600827","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43744933544035,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506438755,"product_id":7888981622883,"position":6,"created_at":"2025-09-23T12:13:45+08:00","updated_at":"2025-09-23T12:13:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbb40c85014bae2bc87c240e9a8a3befd6b10ffb.webp?v=1758600826","variant_ids":[43744933544035]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960B-TB23","featured_media":{"alt":null,"id":26088880865379,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbb40c85014bae2bc87c240e9a8a3befd6b10ffb.webp?v=1758600826"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744934658147,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012960A-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506340451,"product_id":7888981622883,"position":5,"created_at":"2025-09-23T12:13:44+08:00","updated_at":"2025-09-23T12:13:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da60e2435d65f60f654f82a74fbd3938e8e88024.webp?v=1758600826","variant_ids":[43744934658147]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960A-TB23","featured_media":{"alt":null,"id":26088880767075,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da60e2435d65f60f654f82a74fbd3938e8e88024.webp?v=1758600826"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744934690915,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"NST01296Z9-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506569827,"product_id":7888981622883,"position":7,"created_at":"2025-09-23T12:13:45+08:00","updated_at":"2025-09-23T12:13:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/578f5b9c5b9b2b9d7e69850654ef1eb7279dbc21.webp?v=1758600827","variant_ids":[43744934690915]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01296Z9-TB23","featured_media":{"alt":null,"id":26088880996451,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/578f5b9c5b9b2b9d7e69850654ef1eb7279dbc21.webp?v=1758600827"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744934723683,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01296O8-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506045539,"product_id":7888981622883,"position":2,"created_at":"2025-09-23T12:13:43+08:00","updated_at":"2025-09-23T12:13:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fd9f41e556cc792a3451cfc5632ac10ab2a48f73.webp?v=1758600825","variant_ids":[43744934723683]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01296O8-TB23","featured_media":{"alt":null,"id":26088880472163,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fd9f41e556cc792a3451cfc5632ac10ab2a48f73.webp?v=1758600825"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744934756451,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129652-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506176611,"product_id":7888981622883,"position":3,"created_at":"2025-09-23T12:13:43+08:00","updated_at":"2025-09-23T12:13:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/930ab1935f3c61a92bab03b93f4312e298f5ab4a.webp?v=1758600826","variant_ids":[43744934756451]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Black","public_title":"Black","options":["Black"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129652-TB23","featured_media":{"alt":null,"id":26088880603235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/930ab1935f3c61a92bab03b93f4312e298f5ab4a.webp?v=1758600826"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43744934789219,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01296Z8-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506274915,"product_id":7888981622883,"position":4,"created_at":"2025-09-23T12:13:44+08:00","updated_at":"2025-09-23T12:13:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be42780b2164a6c2382327af8a2be3659c71d1d8.webp?v=1758600825","variant_ids":[43744934789219]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01296Z8-TB23","featured_media":{"alt":null,"id":26088880701539,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be42780b2164a6c2382327af8a2be3659c71d1d8.webp?v=1758600825"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43744933544035,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012960B-TB23","requires_shipping":true,"taxable":true,"featured_image":{"id":34518506438755,"product_id":7888981622883,"position":6,"created_at":"2025-09-23T12:13:45+08:00","updated_at":"2025-09-23T12:13:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbb40c85014bae2bc87c240e9a8a3befd6b10ffb.webp?v=1758600826","variant_ids":[43744933544035]},"available":true,"name":"iPhone 15 Plus SolidX Oracle Red Bull Racing MV1 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":118000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012960B-TB23","featured_media":{"alt":null,"id":26088880865379,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbb40c85014bae2bc87c240e9a8a3befd6b10ffb.webp?v=1758600826"}},"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: "停產" }