$product = {"id":7836809166947,"title":"iPhone 16 Clear 老屋顏 壓花玻璃-黑色海棠","handle":"iphone-16-jellytint-bumper-kf89","description":null,"published_at":"2025-07-14T10:29:06+08:00","created_at":"2025-07-14T10:21:02+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-oldhouseface","device-iPhone 16","merge","reseller-oldhouseface"],"price":108000,"price_min":108000,"price_max":108000,"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":43524968284259,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN013250J-KF89","requires_shipping":true,"taxable":true,"featured_image":{"id":34178512191587,"product_id":7836809166947,"position":6,"created_at":"2025-07-14T10:36:26+08:00","updated_at":"2025-07-14T10:36:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7_ca31f6c6-00e6-48c9-b13f-a6dff7ed9ed9.webp?v=1752460588","variant_ids":[43524968284259]},"available":true,"name":"iPhone 16 Clear 老屋顏 壓花玻璃-黑色海棠 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":108000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN013250J-KF89","featured_media":{"alt":null,"id":25816087593059,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7_ca31f6c6-00e6-48c9-b13f-a6dff7ed9ed9.webp?v=1752460588"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55e055804b5c87e64ba6ceb6df98afadd9f9e0fd.webp?v=1752459670","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62194342f0c5b1c818143be62fda52b7ee7fdd7c.webp?v=1752459671","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7.webp?v=1752459672","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55e055804b5c87e64ba6ceb6df98afadd9f9e0fd_90f914d2-2ad9-44cb-b16e-30368d71b4b0.webp?v=1752460586","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62194342f0c5b1c818143be62fda52b7ee7fdd7c_f80c6c50-d07a-49b5-833b-3be86725cee4.webp?v=1752460587","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7_ca31f6c6-00e6-48c9-b13f-a6dff7ed9ed9.webp?v=1752460588"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55e055804b5c87e64ba6ceb6df98afadd9f9e0fd.webp?v=1752459670","options":["color"],"media":[{"alt":null,"id":25816041488483,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55e055804b5c87e64ba6ceb6df98afadd9f9e0fd.webp?v=1752459670"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55e055804b5c87e64ba6ceb6df98afadd9f9e0fd.webp?v=1752459670","width":2000},{"alt":null,"id":25816041685091,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62194342f0c5b1c818143be62fda52b7ee7fdd7c.webp?v=1752459671"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62194342f0c5b1c818143be62fda52b7ee7fdd7c.webp?v=1752459671","width":2000},{"alt":null,"id":25816041816163,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7.webp?v=1752459672"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7.webp?v=1752459672","width":2000},{"alt":null,"id":25816086970467,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55e055804b5c87e64ba6ceb6df98afadd9f9e0fd_90f914d2-2ad9-44cb-b16e-30368d71b4b0.webp?v=1752460586"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55e055804b5c87e64ba6ceb6df98afadd9f9e0fd_90f914d2-2ad9-44cb-b16e-30368d71b4b0.webp?v=1752460586","width":2000},{"alt":null,"id":25816087232611,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62194342f0c5b1c818143be62fda52b7ee7fdd7c_f80c6c50-d07a-49b5-833b-3be86725cee4.webp?v=1752460587"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/62194342f0c5b1c818143be62fda52b7ee7fdd7c_f80c6c50-d07a-49b5-833b-3be86725cee4.webp?v=1752460587","width":2000},{"alt":null,"id":25816087593059,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7_ca31f6c6-00e6-48c9-b13f-a6dff7ed9ed9.webp?v=1752460588"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7_ca31f6c6-00e6-48c9-b13f-a6dff7ed9ed9.webp?v=1752460588","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":43524968284259,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN013250J-KF89","requires_shipping":true,"taxable":true,"featured_image":{"id":34178512191587,"product_id":7836809166947,"position":6,"created_at":"2025-07-14T10:36:26+08:00","updated_at":"2025-07-14T10:36:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7_ca31f6c6-00e6-48c9-b13f-a6dff7ed9ed9.webp?v=1752460588","variant_ids":[43524968284259]},"available":true,"name":"iPhone 16 Clear 老屋顏 壓花玻璃-黑色海棠 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":108000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN013250J-KF89","featured_media":{"alt":null,"id":25816087593059,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7_ca31f6c6-00e6-48c9-b13f-a6dff7ed9ed9.webp?v=1752460588"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43524968284259,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN013250J-KF89","requires_shipping":true,"taxable":true,"featured_image":{"id":34178512191587,"product_id":7836809166947,"position":6,"created_at":"2025-07-14T10:36:26+08:00","updated_at":"2025-07-14T10:36:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7_ca31f6c6-00e6-48c9-b13f-a6dff7ed9ed9.webp?v=1752460588","variant_ids":[43524968284259]},"available":true,"name":"iPhone 16 Clear 老屋顏 壓花玻璃-黑色海棠 - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":108000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN013250J-KF89","featured_media":{"alt":null,"id":25816087593059,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/405e797405c0283570d2d35dff206305674c98e7_ca31f6c6-00e6-48c9-b13f-a6dff7ed9ed9.webp?v=1752460588"}},"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: "停產" }