$product = {"id":7415081042019,"title":"犀牛盾Mod NX (MagSafe 兼容)手機殼 - iPhone 12 Pro Max - Weiweiboy - 超級可愛大王","handle":"iphone-12-pro-max-mod-nx-magsafe-printable-eo01","description":null,"published_at":"2024-06-11T17:57:27+08:00","created_at":"2024-05-05T20:19:09+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師MOD NX MagSafe專區Weiweiboy","tags":["20%","25%","30%","35%","40%","45%","50%","b2b","brand-Apple","designer","designer-weiweiboy","device-iPhone 12 pro max","merge","mod-nx-magsafe-printable","new-modnx-sku","reseller-modnx-magsafe-weiweiboy","Top50","type-Mod NX Printable MagSafe Printable"],"price":110000,"price_min":110000,"price_max":110000,"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":41911668310115,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"MPB0118724-EO01","requires_shipping":true,"taxable":true,"featured_image":{"id":31488110231651,"product_id":7415081042019,"position":7,"created_at":"2024-05-05T20:19:27+08:00","updated_at":"2024-05-05T20:19:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6898d489c5f32c6aaf33822d93db9ea9ffd7dde8_547dbc61-fd0b-41b7-a5b7-4f1ada1d103d.webp?v=1714911567","variant_ids":[41911668310115]},"available":true,"name":"犀牛盾Mod NX (MagSafe 兼容)手機殼 - iPhone 12 Pro Max - Weiweiboy - 超級可愛大王 - Mod NX-黑色邊框","public_title":"Mod NX-黑色邊框","options":["Mod NX-黑色邊框"],"price":110000,"weight":1380,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118724-EO01","featured_media":{"alt":null,"id":23893454749795,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6898d489c5f32c6aaf33822d93db9ea9ffd7dde8_547dbc61-fd0b-41b7-a5b7-4f1ada1d103d.webp?v=1714911567"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcf14e4293e9d1754d199f49bbbe3dc4680bd1e_1efc2170-316e-4e9e-af82-c84e551959af.webp?v=1714911552","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95cda17bd000eed7cd055a840c7da24f5fb4127c_efd8a1fe-4e49-4fa5-89a4-dd8a4673fd59.webp?v=1714911554","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51e1ad3447cd11b6444a5a0e245d75f4d1a981c2_eee5e100-447e-4b1d-b9ea-355804ac9e63.webp?v=1714911557","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7470d67ca70c502cbed1d58b83c678d36375312_6fcb7427-afa4-4fb5-8e99-4917d5775bd6.webp?v=1714911559","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cfef3fcc4f63f97db8d927e05acc403573cac436_6e606d24-1c26-4a09-a269-5f0b6e19d4a5.webp?v=1714911562","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/980325d3fd7855c7cedecb372f0a67008b7724e8_3e556146-6265-4f51-abc2-0fa3a9bb6076.webp?v=1714911564","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6898d489c5f32c6aaf33822d93db9ea9ffd7dde8_547dbc61-fd0b-41b7-a5b7-4f1ada1d103d.webp?v=1714911567","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0056e6b7f640c20ee9c8166d7ecee74815620f0e_1b3d5944-74ab-4e84-8135-f6a6964c030d.webp?v=1714911569","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4ec9e0647d2c37cc4f25deaa0337fc5d44851278_6f11a55d-c73a-4f7b-90a6-93801763c418.webp?v=1714911571","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e25375a83cb3315a874a6214d2d55d865a3fe70c_e0f45640-ad10-41b0-b5e1-dc4a628f4d7f.webp?v=1714911574","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/94f63992219d79f4f45b5e79ec81f966ccba14d1_dbaf9c26-0172-47cf-bd37-e02558e7e671.webp?v=1714911576"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcf14e4293e9d1754d199f49bbbe3dc4680bd1e_1efc2170-316e-4e9e-af82-c84e551959af.webp?v=1714911552","options":["color"],"media":[{"alt":null,"id":23893451243619,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcf14e4293e9d1754d199f49bbbe3dc4680bd1e_1efc2170-316e-4e9e-af82-c84e551959af.webp?v=1714911552"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dcf14e4293e9d1754d199f49bbbe3dc4680bd1e_1efc2170-316e-4e9e-af82-c84e551959af.webp?v=1714911552","width":2000},{"alt":null,"id":23893451800675,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95cda17bd000eed7cd055a840c7da24f5fb4127c_efd8a1fe-4e49-4fa5-89a4-dd8a4673fd59.webp?v=1714911554"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/95cda17bd000eed7cd055a840c7da24f5fb4127c_efd8a1fe-4e49-4fa5-89a4-dd8a4673fd59.webp?v=1714911554","width":2000},{"alt":null,"id":23893452554339,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51e1ad3447cd11b6444a5a0e245d75f4d1a981c2_eee5e100-447e-4b1d-b9ea-355804ac9e63.webp?v=1714911557"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51e1ad3447cd11b6444a5a0e245d75f4d1a981c2_eee5e100-447e-4b1d-b9ea-355804ac9e63.webp?v=1714911557","width":2000},{"alt":null,"id":23893453045859,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7470d67ca70c502cbed1d58b83c678d36375312_6fcb7427-afa4-4fb5-8e99-4917d5775bd6.webp?v=1714911559"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b7470d67ca70c502cbed1d58b83c678d36375312_6fcb7427-afa4-4fb5-8e99-4917d5775bd6.webp?v=1714911559","width":2000},{"alt":null,"id":23893453668451,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cfef3fcc4f63f97db8d927e05acc403573cac436_6e606d24-1c26-4a09-a269-5f0b6e19d4a5.webp?v=1714911562"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cfef3fcc4f63f97db8d927e05acc403573cac436_6e606d24-1c26-4a09-a269-5f0b6e19d4a5.webp?v=1714911562","width":2000},{"alt":null,"id":23893454291043,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/980325d3fd7855c7cedecb372f0a67008b7724e8_3e556146-6265-4f51-abc2-0fa3a9bb6076.webp?v=1714911564"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/980325d3fd7855c7cedecb372f0a67008b7724e8_3e556146-6265-4f51-abc2-0fa3a9bb6076.webp?v=1714911564","width":2000},{"alt":null,"id":23893454749795,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6898d489c5f32c6aaf33822d93db9ea9ffd7dde8_547dbc61-fd0b-41b7-a5b7-4f1ada1d103d.webp?v=1714911567"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6898d489c5f32c6aaf33822d93db9ea9ffd7dde8_547dbc61-fd0b-41b7-a5b7-4f1ada1d103d.webp?v=1714911567","width":2000},{"alt":null,"id":23893455175779,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0056e6b7f640c20ee9c8166d7ecee74815620f0e_1b3d5944-74ab-4e84-8135-f6a6964c030d.webp?v=1714911569"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0056e6b7f640c20ee9c8166d7ecee74815620f0e_1b3d5944-74ab-4e84-8135-f6a6964c030d.webp?v=1714911569","width":2000},{"alt":null,"id":23893455536227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4ec9e0647d2c37cc4f25deaa0337fc5d44851278_6f11a55d-c73a-4f7b-90a6-93801763c418.webp?v=1714911571"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4ec9e0647d2c37cc4f25deaa0337fc5d44851278_6f11a55d-c73a-4f7b-90a6-93801763c418.webp?v=1714911571","width":2000},{"alt":null,"id":23893456060515,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e25375a83cb3315a874a6214d2d55d865a3fe70c_e0f45640-ad10-41b0-b5e1-dc4a628f4d7f.webp?v=1714911574"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e25375a83cb3315a874a6214d2d55d865a3fe70c_e0f45640-ad10-41b0-b5e1-dc4a628f4d7f.webp?v=1714911574","width":2000},{"alt":null,"id":23893456748643,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/94f63992219d79f4f45b5e79ec81f966ccba14d1_dbaf9c26-0172-47cf-bd37-e02558e7e671.webp?v=1714911576"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/94f63992219d79f4f45b5e79ec81f966ccba14d1_dbaf9c26-0172-47cf-bd37-e02558e7e671.webp?v=1714911576","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":41911668310115,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"MPB0118724-EO01","requires_shipping":true,"taxable":true,"featured_image":{"id":31488110231651,"product_id":7415081042019,"position":7,"created_at":"2024-05-05T20:19:27+08:00","updated_at":"2024-05-05T20:19:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6898d489c5f32c6aaf33822d93db9ea9ffd7dde8_547dbc61-fd0b-41b7-a5b7-4f1ada1d103d.webp?v=1714911567","variant_ids":[41911668310115]},"available":true,"name":"犀牛盾Mod NX (MagSafe 兼容)手機殼 - iPhone 12 Pro Max - Weiweiboy - 超級可愛大王 - Mod NX-黑色邊框","public_title":"Mod NX-黑色邊框","options":["Mod NX-黑色邊框"],"price":110000,"weight":1380,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118724-EO01","featured_media":{"alt":null,"id":23893454749795,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6898d489c5f32c6aaf33822d93db9ea9ffd7dde8_547dbc61-fd0b-41b7-a5b7-4f1ada1d103d.webp?v=1714911567"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":41911668310115,"title":"Mod NX-黑色邊框","option1":"Mod NX-黑色邊框","option2":null,"option3":null,"sku":"MPB0118724-EO01","requires_shipping":true,"taxable":true,"featured_image":{"id":31488110231651,"product_id":7415081042019,"position":7,"created_at":"2024-05-05T20:19:27+08:00","updated_at":"2024-05-05T20:19:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6898d489c5f32c6aaf33822d93db9ea9ffd7dde8_547dbc61-fd0b-41b7-a5b7-4f1ada1d103d.webp?v=1714911567","variant_ids":[41911668310115]},"available":true,"name":"犀牛盾Mod NX (MagSafe 兼容)手機殼 - iPhone 12 Pro Max - Weiweiboy - 超級可愛大王 - Mod NX-黑色邊框","public_title":"Mod NX-黑色邊框","options":["Mod NX-黑色邊框"],"price":110000,"weight":1380,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118724-EO01","featured_media":{"alt":null,"id":23893454749795,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6898d489c5f32c6aaf33822d93db9ea9ffd7dde8_547dbc61-fd0b-41b7-a5b7-4f1ada1d103d.webp?v=1714911567"}},"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: "停產"
}