$product = {"id":7415925112931,"title":"犀牛盾Mod NX手機殼 - iPhone XS - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - R2D2-日文字系列","handle":"iphone-xs-mod-nx-printable-pb64","description":null,"published_at":"2024-06-11T16:48:04+08:00","created_at":"2024-05-06T12:25:57+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":41915584741475,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108424-PB64","requires_shipping":true,"taxable":true,"featured_image":{"id":31490748809315,"product_id":7415925112931,"position":2,"created_at":"2024-05-06T12:26:02+08:00","updated_at":"2024-05-06T12:26:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec25bba6dceab9c097c34f69ed04453a652d8412_09a4028a-d17a-45a6-94c4-57a121f607df.webp?v=1714969562","variant_ids":[41915584741475]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - R2D2-日文字系列 - 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-PB64","featured_media":{"alt":null,"id":23896155553891,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec25bba6dceab9c097c34f69ed04453a652d8412_09a4028a-d17a-45a6-94c4-57a121f607df.webp?v=1714969562"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74b27eea12d58f0f903dbb504e209928b5b9b409_ce12bff3-4944-4ebf-9164-03aefdd0e5b2.webp?v=1714969560","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec25bba6dceab9c097c34f69ed04453a652d8412_09a4028a-d17a-45a6-94c4-57a121f607df.webp?v=1714969562","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad602306852e5f8c00d6648084fb61e45a47622c_7838b3ca-3bb6-4b98-b7ab-04186c4bacc1.webp?v=1714969564","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1d99a935d8e40c5b408b0c1a13bfab9e6f512f5_fc2a4c1f-695c-4e23-83a3-06ac7ebd0e39.webp?v=1714969568","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/569d62e50f66329e05cee470bb99a004d65b96e5_74f32444-de74-4c70-af44-341e91bbf8c3.webp?v=1714969571","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6415b983d5c5ae59166ad6dbccb71e8671014bd5_0102e45c-2567-456f-9347-b0ba16ed515e.webp?v=1714969573","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b0ae32510be317c37bc1266392461918ba91b5d_ef4c4258-d35d-4f67-80f6-f7d125f91b78.webp?v=1714969577","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a4c7f36635926cfbe4bff9e7faf8f5d3a5b3a97_1c19ffcb-542a-4f4c-9f37-f8c4f86915f3.webp?v=1714969579","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0d99f1086b37d1c8599c6439388c764d617a9cb_f2aa63bb-853d-411c-8609-83d86d1270f8.webp?v=1714969581","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a41d1078e27fab1a736d687fbdb05a3cee683c09_90dbe379-a829-4101-8c5d-407b464e5e98.webp?v=1714969584"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74b27eea12d58f0f903dbb504e209928b5b9b409_ce12bff3-4944-4ebf-9164-03aefdd0e5b2.webp?v=1714969560","options":["color"],"media":[{"alt":null,"id":23896154964067,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74b27eea12d58f0f903dbb504e209928b5b9b409_ce12bff3-4944-4ebf-9164-03aefdd0e5b2.webp?v=1714969560"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74b27eea12d58f0f903dbb504e209928b5b9b409_ce12bff3-4944-4ebf-9164-03aefdd0e5b2.webp?v=1714969560","width":2000},{"alt":null,"id":23896155553891,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec25bba6dceab9c097c34f69ed04453a652d8412_09a4028a-d17a-45a6-94c4-57a121f607df.webp?v=1714969562"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec25bba6dceab9c097c34f69ed04453a652d8412_09a4028a-d17a-45a6-94c4-57a121f607df.webp?v=1714969562","width":2000},{"alt":null,"id":23896156176483,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad602306852e5f8c00d6648084fb61e45a47622c_7838b3ca-3bb6-4b98-b7ab-04186c4bacc1.webp?v=1714969564"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ad602306852e5f8c00d6648084fb61e45a47622c_7838b3ca-3bb6-4b98-b7ab-04186c4bacc1.webp?v=1714969564","width":2000},{"alt":null,"id":23896157061219,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1d99a935d8e40c5b408b0c1a13bfab9e6f512f5_fc2a4c1f-695c-4e23-83a3-06ac7ebd0e39.webp?v=1714969568"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1d99a935d8e40c5b408b0c1a13bfab9e6f512f5_fc2a4c1f-695c-4e23-83a3-06ac7ebd0e39.webp?v=1714969568","width":2000},{"alt":null,"id":23896157749347,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/569d62e50f66329e05cee470bb99a004d65b96e5_74f32444-de74-4c70-af44-341e91bbf8c3.webp?v=1714969571"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/569d62e50f66329e05cee470bb99a004d65b96e5_74f32444-de74-4c70-af44-341e91bbf8c3.webp?v=1714969571","width":2000},{"alt":null,"id":23896158601315,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6415b983d5c5ae59166ad6dbccb71e8671014bd5_0102e45c-2567-456f-9347-b0ba16ed515e.webp?v=1714969573"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6415b983d5c5ae59166ad6dbccb71e8671014bd5_0102e45c-2567-456f-9347-b0ba16ed515e.webp?v=1714969573","width":2000},{"alt":null,"id":23896159748195,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b0ae32510be317c37bc1266392461918ba91b5d_ef4c4258-d35d-4f67-80f6-f7d125f91b78.webp?v=1714969577"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b0ae32510be317c37bc1266392461918ba91b5d_ef4c4258-d35d-4f67-80f6-f7d125f91b78.webp?v=1714969577","width":2000},{"alt":null,"id":23896160206947,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a4c7f36635926cfbe4bff9e7faf8f5d3a5b3a97_1c19ffcb-542a-4f4c-9f37-f8c4f86915f3.webp?v=1714969579"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a4c7f36635926cfbe4bff9e7faf8f5d3a5b3a97_1c19ffcb-542a-4f4c-9f37-f8c4f86915f3.webp?v=1714969579","width":2000},{"alt":null,"id":23896160665699,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0d99f1086b37d1c8599c6439388c764d617a9cb_f2aa63bb-853d-411c-8609-83d86d1270f8.webp?v=1714969581"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f0d99f1086b37d1c8599c6439388c764d617a9cb_f2aa63bb-853d-411c-8609-83d86d1270f8.webp?v=1714969581","width":2000},{"alt":null,"id":23896161222755,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a41d1078e27fab1a736d687fbdb05a3cee683c09_90dbe379-a829-4101-8c5d-407b464e5e98.webp?v=1714969584"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a41d1078e27fab1a736d687fbdb05a3cee683c09_90dbe379-a829-4101-8c5d-407b464e5e98.webp?v=1714969584","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":41915584741475,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108424-PB64","requires_shipping":true,"taxable":true,"featured_image":{"id":31490748809315,"product_id":7415925112931,"position":2,"created_at":"2024-05-06T12:26:02+08:00","updated_at":"2024-05-06T12:26:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec25bba6dceab9c097c34f69ed04453a652d8412_09a4028a-d17a-45a6-94c4-57a121f607df.webp?v=1714969562","variant_ids":[41915584741475]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - R2D2-日文字系列 - 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-PB64","featured_media":{"alt":null,"id":23896155553891,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec25bba6dceab9c097c34f69ed04453a652d8412_09a4028a-d17a-45a6-94c4-57a121f607df.webp?v=1714969562"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":41915584741475,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108424-PB64","requires_shipping":true,"taxable":true,"featured_image":{"id":31490748809315,"product_id":7415925112931,"position":2,"created_at":"2024-05-06T12:26:02+08:00","updated_at":"2024-05-06T12:26:02+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec25bba6dceab9c097c34f69ed04453a652d8412_09a4028a-d17a-45a6-94c4-57a121f607df.webp?v=1714969562","variant_ids":[41915584741475]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - R2D2-日文字系列 - 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-PB64","featured_media":{"alt":null,"id":23896155553891,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ec25bba6dceab9c097c34f69ed04453a652d8412_09a4028a-d17a-45a6-94c4-57a121f607df.webp?v=1714969562"}},"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: "停產" }