$product = {"id":7415901585507,"title":"犀牛盾Mod NX手機殼 - iPhone XS Max - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 死星-線稿風格","handle":"iphone-xs-max-mod-nx-printable-pb75","description":null,"published_at":"2024-06-11T16:47:28+08:00","created_at":"2024-05-06T12:21:33+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":41915358838883,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108624-PB75","requires_shipping":true,"taxable":true,"featured_image":{"id":31490692317283,"product_id":7415901585507,"position":2,"created_at":"2024-05-06T12:21:39+08:00","updated_at":"2024-05-06T12:21:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42d2f6117ba57f3ad93bc8a1edc24e4cbd2bd224_b3d1b9ad-03e0-4c9a-bd5f-4481721d1e70.webp?v=1714969299","variant_ids":[41915358838883]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS Max - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 死星-線稿風格 - 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-PB75","featured_media":{"alt":null,"id":23896098996323,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42d2f6117ba57f3ad93bc8a1edc24e4cbd2bd224_b3d1b9ad-03e0-4c9a-bd5f-4481721d1e70.webp?v=1714969299"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea23abda88ddcdc0906988de5f80457be1c820a2_6e42456e-4a12-4ff2-8a14-efe0e0c3715c.webp?v=1714969296","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42d2f6117ba57f3ad93bc8a1edc24e4cbd2bd224_b3d1b9ad-03e0-4c9a-bd5f-4481721d1e70.webp?v=1714969299","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23d88a10d0d0631eba61c5c26f165a0fa5c84c14_632e0011-b10a-48e3-9f3a-296bb1fe9ed2.webp?v=1714969301","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/491ac617838d78054fb7868c70c6075541d5db3e_012c55f4-c20e-4245-825a-d7f8d50f6ee1.webp?v=1714969305","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c91d64ed78e0ae19734df6fc9d2d5e71a16f018_035ed5df-5565-4be0-a0af-bdeeccf49074.webp?v=1714969307","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/899f4d68fc7648b393b0a2ce370594936a9bf18e_e77da9d9-2d0c-4947-a583-5b0e12338e66.webp?v=1714969309","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/15253d089583927a69d6bcad888a158620fa5c9d_8d48e55e-92c1-4296-8734-6c3f73325b6b.webp?v=1714969312","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38602e50fa6981ed537a7f4911dc8e0186ec3fbc_55a26dc8-672a-4444-bf85-3b2b03fe0237.webp?v=1714969314","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90e8becedf8cbc9dfeb3adedcae0ef934a87d00b_bf753d52-6ca5-404b-a84a-8f1e50d1c6ca.webp?v=1714969319"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea23abda88ddcdc0906988de5f80457be1c820a2_6e42456e-4a12-4ff2-8a14-efe0e0c3715c.webp?v=1714969296","options":["color"],"media":[{"alt":null,"id":23896098406499,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea23abda88ddcdc0906988de5f80457be1c820a2_6e42456e-4a12-4ff2-8a14-efe0e0c3715c.webp?v=1714969296"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ea23abda88ddcdc0906988de5f80457be1c820a2_6e42456e-4a12-4ff2-8a14-efe0e0c3715c.webp?v=1714969296","width":2000},{"alt":null,"id":23896098996323,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42d2f6117ba57f3ad93bc8a1edc24e4cbd2bd224_b3d1b9ad-03e0-4c9a-bd5f-4481721d1e70.webp?v=1714969299"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42d2f6117ba57f3ad93bc8a1edc24e4cbd2bd224_b3d1b9ad-03e0-4c9a-bd5f-4481721d1e70.webp?v=1714969299","width":2000},{"alt":null,"id":23896099455075,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23d88a10d0d0631eba61c5c26f165a0fa5c84c14_632e0011-b10a-48e3-9f3a-296bb1fe9ed2.webp?v=1714969301"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23d88a10d0d0631eba61c5c26f165a0fa5c84c14_632e0011-b10a-48e3-9f3a-296bb1fe9ed2.webp?v=1714969301","width":2000},{"alt":null,"id":23896100077667,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/491ac617838d78054fb7868c70c6075541d5db3e_012c55f4-c20e-4245-825a-d7f8d50f6ee1.webp?v=1714969305"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/491ac617838d78054fb7868c70c6075541d5db3e_012c55f4-c20e-4245-825a-d7f8d50f6ee1.webp?v=1714969305","width":2000},{"alt":null,"id":23896100438115,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c91d64ed78e0ae19734df6fc9d2d5e71a16f018_035ed5df-5565-4be0-a0af-bdeeccf49074.webp?v=1714969307"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4c91d64ed78e0ae19734df6fc9d2d5e71a16f018_035ed5df-5565-4be0-a0af-bdeeccf49074.webp?v=1714969307","width":2000},{"alt":null,"id":23896100896867,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/899f4d68fc7648b393b0a2ce370594936a9bf18e_e77da9d9-2d0c-4947-a583-5b0e12338e66.webp?v=1714969309"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/899f4d68fc7648b393b0a2ce370594936a9bf18e_e77da9d9-2d0c-4947-a583-5b0e12338e66.webp?v=1714969309","width":2000},{"alt":null,"id":23896101257315,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/15253d089583927a69d6bcad888a158620fa5c9d_8d48e55e-92c1-4296-8734-6c3f73325b6b.webp?v=1714969312"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/15253d089583927a69d6bcad888a158620fa5c9d_8d48e55e-92c1-4296-8734-6c3f73325b6b.webp?v=1714969312","width":2000},{"alt":null,"id":23896101781603,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38602e50fa6981ed537a7f4911dc8e0186ec3fbc_55a26dc8-672a-4444-bf85-3b2b03fe0237.webp?v=1714969314"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38602e50fa6981ed537a7f4911dc8e0186ec3fbc_55a26dc8-672a-4444-bf85-3b2b03fe0237.webp?v=1714969314","width":2000},{"alt":null,"id":23896102600803,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90e8becedf8cbc9dfeb3adedcae0ef934a87d00b_bf753d52-6ca5-404b-a84a-8f1e50d1c6ca.webp?v=1714969319"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90e8becedf8cbc9dfeb3adedcae0ef934a87d00b_bf753d52-6ca5-404b-a84a-8f1e50d1c6ca.webp?v=1714969319","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":41915358838883,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108624-PB75","requires_shipping":true,"taxable":true,"featured_image":{"id":31490692317283,"product_id":7415901585507,"position":2,"created_at":"2024-05-06T12:21:39+08:00","updated_at":"2024-05-06T12:21:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42d2f6117ba57f3ad93bc8a1edc24e4cbd2bd224_b3d1b9ad-03e0-4c9a-bd5f-4481721d1e70.webp?v=1714969299","variant_ids":[41915358838883]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS Max - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 死星-線稿風格 - 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-PB75","featured_media":{"alt":null,"id":23896098996323,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42d2f6117ba57f3ad93bc8a1edc24e4cbd2bd224_b3d1b9ad-03e0-4c9a-bd5f-4481721d1e70.webp?v=1714969299"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":41915358838883,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0108624-PB75","requires_shipping":true,"taxable":true,"featured_image":{"id":31490692317283,"product_id":7415901585507,"position":2,"created_at":"2024-05-06T12:21:39+08:00","updated_at":"2024-05-06T12:21:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42d2f6117ba57f3ad93bc8a1edc24e4cbd2bd224_b3d1b9ad-03e0-4c9a-bd5f-4481721d1e70.webp?v=1714969299","variant_ids":[41915358838883]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone XS Max - 【聯名設計款】 - 迪士尼-星際大戰 Star Wars - 死星-線稿風格 - 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-PB75","featured_media":{"alt":null,"id":23896098996323,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42d2f6117ba57f3ad93bc8a1edc24e4cbd2bd224_b3d1b9ad-03e0-4c9a-bd5f-4481721d1e70.webp?v=1714969299"}},"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: "停產"
}