$product = {"id":7415991074915,"title":"犀牛盾Mod NX手機殼 - iPhone XS - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 小圖款-BB8","handle":"iphone-xs-mod-nx-printable-pc04","description":null,"published_at":"2024-06-11T16:49:49+08:00","created_at":"2024-05-06T12:38:17+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師MOD NX專區-迪士尼-星際大戰 Star Wars","tags":["20%","25%","30%","35%","40%","45%","50%","b2b","brand-Apple","designer","designer-starwars","device-iPhone XS","merge","mod-nx-printable","new-modnx-sku","reseller-modnx-star-wars","Top50","type-Mod NX Printable"],"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":41916279980131,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108424-PC04","requires_shipping":true,"taxable":true,"featured_image":{"id":31490928279651,"product_id":7415991074915,"position":4,"created_at":"2024-05-06T12:38:26+08:00","updated_at":"2024-05-06T12:38:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/711a91e1b58e0abe5ca2c2234cec940473f6437a_02b50831-ba14-4fa3-85d7-97e98af7332a.webp?v=1714970306","variant_ids":[41916279980131]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 小圖款-BB8 - Mod NX-黑色邊框","public_title":"Mod NX-黑色邊框","options":["Mod NX-黑色邊框"],"price":90000,"weight":980,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108424-PC04","featured_media":{"alt":null,"id":23896335351907,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/711a91e1b58e0abe5ca2c2234cec940473f6437a_02b50831-ba14-4fa3-85d7-97e98af7332a.webp?v=1714970306"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2bdb08431bb5b111860dd4fa163653b92a7a32c_0dea6bb2-ea90-4ac2-b08e-c55445fa53fa.webp?v=1714970299","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b67caca041af5614a876c0b3450303c4d0cf727_cedacb61-96ba-41c0-85ad-80a973f53e53.webp?v=1714970302","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b667f312be6019445daf7342589e5a75d3db5d3_1674a713-a38d-4d4e-bb57-d2830693925e.webp?v=1714970304","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/711a91e1b58e0abe5ca2c2234cec940473f6437a_02b50831-ba14-4fa3-85d7-97e98af7332a.webp?v=1714970306","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ba77037c4990d5c992f6bd99040cb565dd3b54e_3ecba754-de4b-45a9-a95a-e089ce296d88.webp?v=1714970309","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b339a16439d562cb8b8bacc741c019bb02abf863_c020cbaf-29a2-485d-b779-34b92e4ebbab.webp?v=1714970311","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3be81693761caef91b67defc6964b81b264c1d25_9ee20ebd-ce27-4a03-acfa-d6140705fa98.webp?v=1714970313","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e71e842cc565b97d5e71849d30efd5d6ea427cd_dbd6e052-cc9b-4b83-84d3-209255469ed0.webp?v=1714970316","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e63d29cb4f4d7e47c0687ecaeae43b9d31bd5e48_65e7f1b4-ab0f-4dc9-bb12-d3b5d703bb88.webp?v=1714970318","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a42e30f5d1a91e691e28028b2e7ddfb1f0eb780_b3499d61-f7d1-43e8-b059-e8e98ddcd0c9.webp?v=1714970320"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2bdb08431bb5b111860dd4fa163653b92a7a32c_0dea6bb2-ea90-4ac2-b08e-c55445fa53fa.webp?v=1714970299","options":["color"],"media":[{"alt":null,"id":23896333156451,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2bdb08431bb5b111860dd4fa163653b92a7a32c_0dea6bb2-ea90-4ac2-b08e-c55445fa53fa.webp?v=1714970299"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2bdb08431bb5b111860dd4fa163653b92a7a32c_0dea6bb2-ea90-4ac2-b08e-c55445fa53fa.webp?v=1714970299","width":2000},{"alt":null,"id":23896334434403,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b67caca041af5614a876c0b3450303c4d0cf727_cedacb61-96ba-41c0-85ad-80a973f53e53.webp?v=1714970302"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4b67caca041af5614a876c0b3450303c4d0cf727_cedacb61-96ba-41c0-85ad-80a973f53e53.webp?v=1714970302","width":2000},{"alt":null,"id":23896334925923,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b667f312be6019445daf7342589e5a75d3db5d3_1674a713-a38d-4d4e-bb57-d2830693925e.webp?v=1714970304"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9b667f312be6019445daf7342589e5a75d3db5d3_1674a713-a38d-4d4e-bb57-d2830693925e.webp?v=1714970304","width":2000},{"alt":null,"id":23896335351907,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/711a91e1b58e0abe5ca2c2234cec940473f6437a_02b50831-ba14-4fa3-85d7-97e98af7332a.webp?v=1714970306"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/711a91e1b58e0abe5ca2c2234cec940473f6437a_02b50831-ba14-4fa3-85d7-97e98af7332a.webp?v=1714970306","width":2000},{"alt":null,"id":23896335843427,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ba77037c4990d5c992f6bd99040cb565dd3b54e_3ecba754-de4b-45a9-a95a-e089ce296d88.webp?v=1714970309"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ba77037c4990d5c992f6bd99040cb565dd3b54e_3ecba754-de4b-45a9-a95a-e089ce296d88.webp?v=1714970309","width":2000},{"alt":null,"id":23896336466019,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b339a16439d562cb8b8bacc741c019bb02abf863_c020cbaf-29a2-485d-b779-34b92e4ebbab.webp?v=1714970311"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b339a16439d562cb8b8bacc741c019bb02abf863_c020cbaf-29a2-485d-b779-34b92e4ebbab.webp?v=1714970311","width":2000},{"alt":null,"id":23896337023075,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3be81693761caef91b67defc6964b81b264c1d25_9ee20ebd-ce27-4a03-acfa-d6140705fa98.webp?v=1714970313"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3be81693761caef91b67defc6964b81b264c1d25_9ee20ebd-ce27-4a03-acfa-d6140705fa98.webp?v=1714970313","width":2000},{"alt":null,"id":23896337514595,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e71e842cc565b97d5e71849d30efd5d6ea427cd_dbd6e052-cc9b-4b83-84d3-209255469ed0.webp?v=1714970316"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e71e842cc565b97d5e71849d30efd5d6ea427cd_dbd6e052-cc9b-4b83-84d3-209255469ed0.webp?v=1714970316","width":2000},{"alt":null,"id":23896338399331,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e63d29cb4f4d7e47c0687ecaeae43b9d31bd5e48_65e7f1b4-ab0f-4dc9-bb12-d3b5d703bb88.webp?v=1714970318"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e63d29cb4f4d7e47c0687ecaeae43b9d31bd5e48_65e7f1b4-ab0f-4dc9-bb12-d3b5d703bb88.webp?v=1714970318","width":2000},{"alt":null,"id":23896339349603,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a42e30f5d1a91e691e28028b2e7ddfb1f0eb780_b3499d61-f7d1-43e8-b059-e8e98ddcd0c9.webp?v=1714970320"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9a42e30f5d1a91e691e28028b2e7ddfb1f0eb780_b3499d61-f7d1-43e8-b059-e8e98ddcd0c9.webp?v=1714970320","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":41916279980131,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108424-PC04","requires_shipping":true,"taxable":true,"featured_image":{"id":31490928279651,"product_id":7415991074915,"position":4,"created_at":"2024-05-06T12:38:26+08:00","updated_at":"2024-05-06T12:38:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/711a91e1b58e0abe5ca2c2234cec940473f6437a_02b50831-ba14-4fa3-85d7-97e98af7332a.webp?v=1714970306","variant_ids":[41916279980131]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 小圖款-BB8 - Mod NX-黑色邊框","public_title":"Mod NX-黑色邊框","options":["Mod NX-黑色邊框"],"price":90000,"weight":980,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108424-PC04","featured_media":{"alt":null,"id":23896335351907,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/711a91e1b58e0abe5ca2c2234cec940473f6437a_02b50831-ba14-4fa3-85d7-97e98af7332a.webp?v=1714970306"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":41916279980131,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108424-PC04","requires_shipping":true,"taxable":true,"featured_image":{"id":31490928279651,"product_id":7415991074915,"position":4,"created_at":"2024-05-06T12:38:26+08:00","updated_at":"2024-05-06T12:38:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/711a91e1b58e0abe5ca2c2234cec940473f6437a_02b50831-ba14-4fa3-85d7-97e98af7332a.webp?v=1714970306","variant_ids":[41916279980131]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 小圖款-BB8 - Mod NX-黑色邊框","public_title":"Mod NX-黑色邊框","options":["Mod NX-黑色邊框"],"price":90000,"weight":980,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108424-PC04","featured_media":{"alt":null,"id":23896335351907,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/711a91e1b58e0abe5ca2c2234cec940473f6437a_02b50831-ba14-4fa3-85d7-97e98af7332a.webp?v=1714970306"}},"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: "停產" }