$product = {"id":7408661397603,"title":"犀牛盾Mod NX手機殼 - iPhone 11 Pro Max - 【聯名設計款】 - Batman - 蝙蝠車","handle":"iphone-11-pro-max-mod-nx-printable-sb05","description":"","published_at":"2024-06-11T16:43:29+08:00","created_at":"2024-05-03T17:27:38+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師MOD NX專區-Batman","tags":["20%","25%","30%","35%","40%","45%","50%","b2b","brand-Apple","designer","designer-batman","device-iPhone 11 Pro Max","merge","mod-nx-printable","new-modnx-sku","reseller-modnx-batman","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":41887939330147,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0114924-SB05","requires_shipping":true,"taxable":true,"featured_image":{"id":31473213112419,"product_id":7408661397603,"position":1,"created_at":"2024-05-03T17:27:41+08:00","updated_at":"2025-01-22T14:40:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/344c8a1e0b7fc6106d43983ea8ae9df3437c6e2b_ffb67ad0-cdb4-4f3a-bdd2-3d738e095d17.webp?v=1737528035","variant_ids":[41887939330147]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 11 Pro Max - 【聯名設計款】 - Batman - 蝙蝠車 - 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":"NPB0114924-SB05","featured_media":{"alt":null,"id":23878136266851,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/344c8a1e0b7fc6106d43983ea8ae9df3437c6e2b_ffb67ad0-cdb4-4f3a-bdd2-3d738e095d17.webp?v=1737528035"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/344c8a1e0b7fc6106d43983ea8ae9df3437c6e2b_ffb67ad0-cdb4-4f3a-bdd2-3d738e095d17.webp?v=1737528035","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8ad41a099547fc49b91fd787aafc8a63add01cfb_84666a2a-6bc5-4be7-9bbf-3af78a51bc0f.webp?v=1737528035","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2da72b4f491418f4bc9ad09ef048e4988d6b8473_3a9e1eba-3333-4902-b554-51f9c2d05d1c.webp?v=1737528035","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da4288e049bce7bd750a52c021f069bf7a07443c_b0a85f40-1def-4cc4-a731-b35a3593543f.webp?v=1737528035","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a115bae6dbabdbc0ed8e41ece93ac56a84e5d9f4_150d7178-fe8c-4077-81e6-95cbb587401d.webp?v=1737528035","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6d1d5482abded5d2c1aac4bddde40152fed9474d_7de14960-f983-4b93-bcc1-39953fc82d85.webp?v=1737528036","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ace9beaaf1174a290e1185c8ec436583604c9fa1_12902359-9fb1-4b08-bab2-69a77cb870c1.webp?v=1737528036"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/344c8a1e0b7fc6106d43983ea8ae9df3437c6e2b_ffb67ad0-cdb4-4f3a-bdd2-3d738e095d17.webp?v=1737528035","options":["color"],"media":[{"alt":null,"id":23878136266851,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/344c8a1e0b7fc6106d43983ea8ae9df3437c6e2b_ffb67ad0-cdb4-4f3a-bdd2-3d738e095d17.webp?v=1737528035"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/344c8a1e0b7fc6106d43983ea8ae9df3437c6e2b_ffb67ad0-cdb4-4f3a-bdd2-3d738e095d17.webp?v=1737528035","width":2000},{"alt":null,"id":23878136889443,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8ad41a099547fc49b91fd787aafc8a63add01cfb_84666a2a-6bc5-4be7-9bbf-3af78a51bc0f.webp?v=1737528035"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8ad41a099547fc49b91fd787aafc8a63add01cfb_84666a2a-6bc5-4be7-9bbf-3af78a51bc0f.webp?v=1737528035","width":2000},{"alt":null,"id":23878137348195,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2da72b4f491418f4bc9ad09ef048e4988d6b8473_3a9e1eba-3333-4902-b554-51f9c2d05d1c.webp?v=1737528035"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2da72b4f491418f4bc9ad09ef048e4988d6b8473_3a9e1eba-3333-4902-b554-51f9c2d05d1c.webp?v=1737528035","width":2000},{"alt":null,"id":23878137806947,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da4288e049bce7bd750a52c021f069bf7a07443c_b0a85f40-1def-4cc4-a731-b35a3593543f.webp?v=1737528035"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/da4288e049bce7bd750a52c021f069bf7a07443c_b0a85f40-1def-4cc4-a731-b35a3593543f.webp?v=1737528035","width":2000},{"alt":null,"id":23878138527843,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a115bae6dbabdbc0ed8e41ece93ac56a84e5d9f4_150d7178-fe8c-4077-81e6-95cbb587401d.webp?v=1737528035"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a115bae6dbabdbc0ed8e41ece93ac56a84e5d9f4_150d7178-fe8c-4077-81e6-95cbb587401d.webp?v=1737528035","width":2000},{"alt":null,"id":25221932810339,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6d1d5482abded5d2c1aac4bddde40152fed9474d_7de14960-f983-4b93-bcc1-39953fc82d85.webp?v=1737528036"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6d1d5482abded5d2c1aac4bddde40152fed9474d_7de14960-f983-4b93-bcc1-39953fc82d85.webp?v=1737528036","width":2000},{"alt":null,"id":23878140231779,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ace9beaaf1174a290e1185c8ec436583604c9fa1_12902359-9fb1-4b08-bab2-69a77cb870c1.webp?v=1737528036"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ace9beaaf1174a290e1185c8ec436583604c9fa1_12902359-9fb1-4b08-bab2-69a77cb870c1.webp?v=1737528036","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":""};
$bumper = null;
$variants = [{"id":41887939330147,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0114924-SB05","requires_shipping":true,"taxable":true,"featured_image":{"id":31473213112419,"product_id":7408661397603,"position":1,"created_at":"2024-05-03T17:27:41+08:00","updated_at":"2025-01-22T14:40:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/344c8a1e0b7fc6106d43983ea8ae9df3437c6e2b_ffb67ad0-cdb4-4f3a-bdd2-3d738e095d17.webp?v=1737528035","variant_ids":[41887939330147]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 11 Pro Max - 【聯名設計款】 - Batman - 蝙蝠車 - 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":"NPB0114924-SB05","featured_media":{"alt":null,"id":23878136266851,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/344c8a1e0b7fc6106d43983ea8ae9df3437c6e2b_ffb67ad0-cdb4-4f3a-bdd2-3d738e095d17.webp?v=1737528035"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":41887939330147,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"NPB0114924-SB05","requires_shipping":true,"taxable":true,"featured_image":{"id":31473213112419,"product_id":7408661397603,"position":1,"created_at":"2024-05-03T17:27:41+08:00","updated_at":"2025-01-22T14:40:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/344c8a1e0b7fc6106d43983ea8ae9df3437c6e2b_ffb67ad0-cdb4-4f3a-bdd2-3d738e095d17.webp?v=1737528035","variant_ids":[41887939330147]},"available":true,"name":"犀牛盾Mod NX手機殼 - iPhone 11 Pro Max - 【聯名設計款】 - Batman - 蝙蝠車 - 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":"NPB0114924-SB05","featured_media":{"alt":null,"id":23878136266851,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/344c8a1e0b7fc6106d43983ea8ae9df3437c6e2b_ffb67ad0-cdb4-4f3a-bdd2-3d738e095d17.webp?v=1737528035"}},"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: "停產"
}