$product = {"id":7416207212643,"title":"犀牛盾Mod NX手機殼 - iPhone X - 【獨家設計款】 - 來自空中的情書(明信片版)","handle":"iphone-x-mod-nx-printable-ae06","description":null,"published_at":"2024-06-11T16:53:19+08:00","created_at":"2024-05-06T14:10:43+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"MOD NX 客製化","tags":["20%","25%","30%","35%","40%","45%","50%","b2b","brand-Apple","designer","device-iPhone X","discountable-item","member","merge","mod-nx-printable","new-modnx-sku","reseller","reseller-modnx-chi-po-lin-series","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":41918018060387,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0106424-AE06","requires_shipping":true,"taxable":true,"featured_image":{"id":31491641016419,"product_id":7416207212643,"position":4,"created_at":"2024-05-06T14:10:53+08:00","updated_at":"2024-05-06T14:10:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81d6a5bc536a3b631b328700475caed03ca8e73f_8f8fec6c-bb88-47c4-9313-bc050e796334.webp?v=1714975853","variant_ids":[41918018060387]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 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":"NPB0106424-AE06","featured_media":{"alt":null,"id":23897053036643,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81d6a5bc536a3b631b328700475caed03ca8e73f_8f8fec6c-bb88-47c4-9313-bc050e796334.webp?v=1714975853"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4188e07e11f76c76c4f946513e6ae4e60f171894_235eecc0-5615-490c-9501-a16c68898811.webp?v=1714975845","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f528c0faffeaf04b6dce55ec1945ad2e5949c8d9_5039d944-049e-435f-885f-80588f4bc2d8.webp?v=1714975848","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0915590aa797393efac3ce12eea8675793ccbf4d_b1d2918c-ae59-438e-8ec6-5df88affc363.webp?v=1714975850","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81d6a5bc536a3b631b328700475caed03ca8e73f_8f8fec6c-bb88-47c4-9313-bc050e796334.webp?v=1714975853","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f544f8a9df027b5b2b2dbb60d6177dcddc9a03de_033424e5-bed5-4f1a-b0ca-df33c9520a7e.webp?v=1714975855","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d9c8f87032b2fedfa59d24c074794c4c070f7ff_4ffcca3f-16f5-4457-b33c-071ebc51ccb4.webp?v=1714975857","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb972f09d9d3e83de7a1f1c8363f9fe831d432d_adb900e2-0bb0-4f20-b9f2-072cb04cb81a.webp?v=1714975860","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6a904177aabe012b332ae518c6862e08dd703278_09328466-725a-44a3-a0c2-2927bf285c21.webp?v=1714975862","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5731f93ba22d0af1943443533b714b758a0814d_4b867bd7-1e4a-4370-aebf-6eba83d2f9d5.webp?v=1714975865","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73c75cf1e45e5f7f4d719d296166bc7c1cd1122f_4be4f8b7-c26e-49dd-b1a5-c330f73f535c.webp?v=1714975867"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4188e07e11f76c76c4f946513e6ae4e60f171894_235eecc0-5615-490c-9501-a16c68898811.webp?v=1714975845","options":["color"],"media":[{"alt":null,"id":23897051299939,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4188e07e11f76c76c4f946513e6ae4e60f171894_235eecc0-5615-490c-9501-a16c68898811.webp?v=1714975845"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4188e07e11f76c76c4f946513e6ae4e60f171894_235eecc0-5615-490c-9501-a16c68898811.webp?v=1714975845","width":2000},{"alt":null,"id":23897051856995,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f528c0faffeaf04b6dce55ec1945ad2e5949c8d9_5039d944-049e-435f-885f-80588f4bc2d8.webp?v=1714975848"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f528c0faffeaf04b6dce55ec1945ad2e5949c8d9_5039d944-049e-435f-885f-80588f4bc2d8.webp?v=1714975848","width":2000},{"alt":null,"id":23897052446819,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0915590aa797393efac3ce12eea8675793ccbf4d_b1d2918c-ae59-438e-8ec6-5df88affc363.webp?v=1714975850"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0915590aa797393efac3ce12eea8675793ccbf4d_b1d2918c-ae59-438e-8ec6-5df88affc363.webp?v=1714975850","width":2000},{"alt":null,"id":23897053036643,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81d6a5bc536a3b631b328700475caed03ca8e73f_8f8fec6c-bb88-47c4-9313-bc050e796334.webp?v=1714975853"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81d6a5bc536a3b631b328700475caed03ca8e73f_8f8fec6c-bb88-47c4-9313-bc050e796334.webp?v=1714975853","width":2000},{"alt":null,"id":23897053659235,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f544f8a9df027b5b2b2dbb60d6177dcddc9a03de_033424e5-bed5-4f1a-b0ca-df33c9520a7e.webp?v=1714975855"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f544f8a9df027b5b2b2dbb60d6177dcddc9a03de_033424e5-bed5-4f1a-b0ca-df33c9520a7e.webp?v=1714975855","width":2000},{"alt":null,"id":23897054281827,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d9c8f87032b2fedfa59d24c074794c4c070f7ff_4ffcca3f-16f5-4457-b33c-071ebc51ccb4.webp?v=1714975857"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d9c8f87032b2fedfa59d24c074794c4c070f7ff_4ffcca3f-16f5-4457-b33c-071ebc51ccb4.webp?v=1714975857","width":2000},{"alt":null,"id":23897054838883,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb972f09d9d3e83de7a1f1c8363f9fe831d432d_adb900e2-0bb0-4f20-b9f2-072cb04cb81a.webp?v=1714975860"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5eb972f09d9d3e83de7a1f1c8363f9fe831d432d_adb900e2-0bb0-4f20-b9f2-072cb04cb81a.webp?v=1714975860","width":2000},{"alt":null,"id":23897055395939,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6a904177aabe012b332ae518c6862e08dd703278_09328466-725a-44a3-a0c2-2927bf285c21.webp?v=1714975862"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6a904177aabe012b332ae518c6862e08dd703278_09328466-725a-44a3-a0c2-2927bf285c21.webp?v=1714975862","width":2000},{"alt":null,"id":23897055952995,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5731f93ba22d0af1943443533b714b758a0814d_4b867bd7-1e4a-4370-aebf-6eba83d2f9d5.webp?v=1714975865"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5731f93ba22d0af1943443533b714b758a0814d_4b867bd7-1e4a-4370-aebf-6eba83d2f9d5.webp?v=1714975865","width":2000},{"alt":null,"id":23897056477283,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73c75cf1e45e5f7f4d719d296166bc7c1cd1122f_4be4f8b7-c26e-49dd-b1a5-c330f73f535c.webp?v=1714975867"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73c75cf1e45e5f7f4d719d296166bc7c1cd1122f_4be4f8b7-c26e-49dd-b1a5-c330f73f535c.webp?v=1714975867","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $bumper = null; $variants = [{"id":41918018060387,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0106424-AE06","requires_shipping":true,"taxable":true,"featured_image":{"id":31491641016419,"product_id":7416207212643,"position":4,"created_at":"2024-05-06T14:10:53+08:00","updated_at":"2024-05-06T14:10:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81d6a5bc536a3b631b328700475caed03ca8e73f_8f8fec6c-bb88-47c4-9313-bc050e796334.webp?v=1714975853","variant_ids":[41918018060387]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 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":"NPB0106424-AE06","featured_media":{"alt":null,"id":23897053036643,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81d6a5bc536a3b631b328700475caed03ca8e73f_8f8fec6c-bb88-47c4-9313-bc050e796334.webp?v=1714975853"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":41918018060387,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0106424-AE06","requires_shipping":true,"taxable":true,"featured_image":{"id":31491641016419,"product_id":7416207212643,"position":4,"created_at":"2024-05-06T14:10:53+08:00","updated_at":"2024-05-06T14:10:53+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81d6a5bc536a3b631b328700475caed03ca8e73f_8f8fec6c-bb88-47c4-9313-bc050e796334.webp?v=1714975853","variant_ids":[41918018060387]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 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":"NPB0106424-AE06","featured_media":{"alt":null,"id":23897053036643,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/81d6a5bc536a3b631b328700475caed03ca8e73f_8f8fec6c-bb88-47c4-9313-bc050e796334.webp?v=1714975853"}},"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: "停產" }