$product = {"id":7415980785763,"title":"犀牛盾Mod NX手機殼 - iPhone XS Max - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - X翼戰機","handle":"iphone-xs-max-mod-nx-printable-pb74","description":null,"published_at":"2024-06-11T16:49:32+08:00","created_at":"2024-05-06T12:36:09+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 Max","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":41916167684195,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108624-PB74","requires_shipping":true,"taxable":true,"featured_image":{"id":31490896035939,"product_id":7415980785763,"position":4,"created_at":"2024-05-06T12:36:21+08:00","updated_at":"2024-05-06T12:36:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97a661f579e79848638f0d946123382d536682dd_ee011f9d-f701-4a19-aa21-1697814884b6.webp?v=1714970181","variant_ids":[41916167684195]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS Max - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - X翼戰機 - 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":"NPB0108624-PB74","featured_media":{"alt":null,"id":23896303042659,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97a661f579e79848638f0d946123382d536682dd_ee011f9d-f701-4a19-aa21-1697814884b6.webp?v=1714970181"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc8a5ec685cf812f9ab9a78b14c2c9a364954756_da92c942-01fd-45af-9ce0-b878495a55e2.webp?v=1714970172","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ae8f8395251fec66ac3e39bcfbec95ae2b55928_7aefce42-f8af-4386-9fb1-8427b8410519.webp?v=1714970174","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6050f67a1416e4950627f58fb33090fd3dde2bf4_6d1e74fe-746a-46fe-a9b5-24c4a9105b6a.webp?v=1714970179","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97a661f579e79848638f0d946123382d536682dd_ee011f9d-f701-4a19-aa21-1697814884b6.webp?v=1714970181","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55d9a7682730cfe68b55fa959fa79e0790cd8fbe_5eb7c247-6fa2-422d-a623-90fd8748e239.webp?v=1714970184","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4163467f03085cf1ec2c5fdd36fa40cb4144dacd_456ff304-4077-44c7-8a95-3a387067bc18.webp?v=1714970186","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f226cbc8badc14a18651e78e1a3c36ee98ab9a16_60bdf5ab-b331-4130-99fb-1fe0624d0d3d.webp?v=1714970189","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3fbfe76a34bf6387c2592ad0a70ae33609f7371_37d46094-0b62-4b74-9590-9133f5a3bbc3.webp?v=1714970191","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/72a4ccbbe281d03b8b229862922f51e91aafe812_bf81c548-37b7-4092-b57c-44a2387da14d.webp?v=1714970193"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc8a5ec685cf812f9ab9a78b14c2c9a364954756_da92c942-01fd-45af-9ce0-b878495a55e2.webp?v=1714970172","options":["color"],"media":[{"alt":null,"id":23896300650595,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc8a5ec685cf812f9ab9a78b14c2c9a364954756_da92c942-01fd-45af-9ce0-b878495a55e2.webp?v=1714970172"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc8a5ec685cf812f9ab9a78b14c2c9a364954756_da92c942-01fd-45af-9ce0-b878495a55e2.webp?v=1714970172","width":2000},{"alt":null,"id":23896301076579,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ae8f8395251fec66ac3e39bcfbec95ae2b55928_7aefce42-f8af-4386-9fb1-8427b8410519.webp?v=1714970174"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1ae8f8395251fec66ac3e39bcfbec95ae2b55928_7aefce42-f8af-4386-9fb1-8427b8410519.webp?v=1714970174","width":2000},{"alt":null,"id":23896302157923,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6050f67a1416e4950627f58fb33090fd3dde2bf4_6d1e74fe-746a-46fe-a9b5-24c4a9105b6a.webp?v=1714970179"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6050f67a1416e4950627f58fb33090fd3dde2bf4_6d1e74fe-746a-46fe-a9b5-24c4a9105b6a.webp?v=1714970179","width":2000},{"alt":null,"id":23896303042659,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97a661f579e79848638f0d946123382d536682dd_ee011f9d-f701-4a19-aa21-1697814884b6.webp?v=1714970181"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97a661f579e79848638f0d946123382d536682dd_ee011f9d-f701-4a19-aa21-1697814884b6.webp?v=1714970181","width":2000},{"alt":null,"id":23896304189539,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55d9a7682730cfe68b55fa959fa79e0790cd8fbe_5eb7c247-6fa2-422d-a623-90fd8748e239.webp?v=1714970184"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55d9a7682730cfe68b55fa959fa79e0790cd8fbe_5eb7c247-6fa2-422d-a623-90fd8748e239.webp?v=1714970184","width":2000},{"alt":null,"id":23896304648291,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4163467f03085cf1ec2c5fdd36fa40cb4144dacd_456ff304-4077-44c7-8a95-3a387067bc18.webp?v=1714970186"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4163467f03085cf1ec2c5fdd36fa40cb4144dacd_456ff304-4077-44c7-8a95-3a387067bc18.webp?v=1714970186","width":2000},{"alt":null,"id":23896305533027,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f226cbc8badc14a18651e78e1a3c36ee98ab9a16_60bdf5ab-b331-4130-99fb-1fe0624d0d3d.webp?v=1714970189"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f226cbc8badc14a18651e78e1a3c36ee98ab9a16_60bdf5ab-b331-4130-99fb-1fe0624d0d3d.webp?v=1714970189","width":2000},{"alt":null,"id":23896305991779,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3fbfe76a34bf6387c2592ad0a70ae33609f7371_37d46094-0b62-4b74-9590-9133f5a3bbc3.webp?v=1714970191"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3fbfe76a34bf6387c2592ad0a70ae33609f7371_37d46094-0b62-4b74-9590-9133f5a3bbc3.webp?v=1714970191","width":2000},{"alt":null,"id":23896306548835,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/72a4ccbbe281d03b8b229862922f51e91aafe812_bf81c548-37b7-4092-b57c-44a2387da14d.webp?v=1714970193"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/72a4ccbbe281d03b8b229862922f51e91aafe812_bf81c548-37b7-4092-b57c-44a2387da14d.webp?v=1714970193","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":41916167684195,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108624-PB74","requires_shipping":true,"taxable":true,"featured_image":{"id":31490896035939,"product_id":7415980785763,"position":4,"created_at":"2024-05-06T12:36:21+08:00","updated_at":"2024-05-06T12:36:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97a661f579e79848638f0d946123382d536682dd_ee011f9d-f701-4a19-aa21-1697814884b6.webp?v=1714970181","variant_ids":[41916167684195]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS Max - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - X翼戰機 - 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":"NPB0108624-PB74","featured_media":{"alt":null,"id":23896303042659,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97a661f579e79848638f0d946123382d536682dd_ee011f9d-f701-4a19-aa21-1697814884b6.webp?v=1714970181"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":41916167684195,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108624-PB74","requires_shipping":true,"taxable":true,"featured_image":{"id":31490896035939,"product_id":7415980785763,"position":4,"created_at":"2024-05-06T12:36:21+08:00","updated_at":"2024-05-06T12:36:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97a661f579e79848638f0d946123382d536682dd_ee011f9d-f701-4a19-aa21-1697814884b6.webp?v=1714970181","variant_ids":[41916167684195]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS Max - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - X翼戰機 - 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":"NPB0108624-PB74","featured_media":{"alt":null,"id":23896303042659,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97a661f579e79848638f0d946123382d536682dd_ee011f9d-f701-4a19-aa21-1697814884b6.webp?v=1714970181"}},"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: "停產" }