$product = {"id":7921111466083,"title":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林","handle":"iphone-12-pro-mod-nx-hd70","description":null,"published_at":"2025-11-13T09:52:26+08:00","created_at":"2025-11-11T09:32:55+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 12 Pro","merge","reseller-incrediville"],"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":43830799761507,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785894924387,"product_id":7921111466083,"position":7,"created_at":"2025-11-11T09:33:04+08:00","updated_at":"2025-11-11T09:33:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48feb8638a58a9f5c220dea97ba884ebb74fae44.webp?v=1762824786","variant_ids":[43830799761507]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-HD70","featured_media":{"alt":null,"id":26351352086627,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48feb8638a58a9f5c220dea97ba884ebb74fae44.webp?v=1762824786"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830800777315,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785894170723,"product_id":7921111466083,"position":4,"created_at":"2025-11-11T09:33:01+08:00","updated_at":"2025-11-11T09:33:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6e9dd2247bb1cb081294fc67251c3d1daa7e48fb.webp?v=1762824783","variant_ids":[43830800777315]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118524-HD70","featured_media":{"alt":null,"id":26351351431267,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6e9dd2247bb1cb081294fc67251c3d1daa7e48fb.webp?v=1762824783"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830800810083,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785894400099,"product_id":7921111466083,"position":5,"created_at":"2025-11-11T09:33:02+08:00","updated_at":"2025-11-11T09:33:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4514845e9a0c0b1d60a824da5ed473038d84cbfb.webp?v=1762824784","variant_ids":[43830800810083]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118569-HD70","featured_media":{"alt":null,"id":26351351693411,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4514845e9a0c0b1d60a824da5ed473038d84cbfb.webp?v=1762824784"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830800908387,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785895055459,"product_id":7921111466083,"position":8,"created_at":"2025-11-11T09:33:04+08:00","updated_at":"2025-11-11T09:33:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6fe5e7e887755684ce93ae427f9d3cc7b25e8dc3.webp?v=1762824786","variant_ids":[43830800908387]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118504-HD70","featured_media":{"alt":null,"id":26351352217699,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6fe5e7e887755684ce93ae427f9d3cc7b25e8dc3.webp?v=1762824786"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830801072227,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785893679203,"product_id":7921111466083,"position":1,"created_at":"2025-11-11T09:33:00+08:00","updated_at":"2025-11-11T09:33:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c1eaa3e1cabf79560ba6e80559a2e3d757778e8.webp?v=1762824781","variant_ids":[43830801072227]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185J5-HD70","featured_media":{"alt":null,"id":26351350841443,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c1eaa3e1cabf79560ba6e80559a2e3d757778e8.webp?v=1762824781"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c1eaa3e1cabf79560ba6e80559a2e3d757778e8.webp?v=1762824781","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/240236bc817e863eaf446db6acba5a9fc1cd4726.webp?v=1762824782","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/532fe05ff37f2e70e2199448b6c1da5e2eb62412.webp?v=1762824783","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6e9dd2247bb1cb081294fc67251c3d1daa7e48fb.webp?v=1762824783","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4514845e9a0c0b1d60a824da5ed473038d84cbfb.webp?v=1762824784","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/722435020ae4cbbc654d10cff62778cb5ef1d359.webp?v=1762824785","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48feb8638a58a9f5c220dea97ba884ebb74fae44.webp?v=1762824786","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6fe5e7e887755684ce93ae427f9d3cc7b25e8dc3.webp?v=1762824786","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6744b218587b91483f27f82455a571a565a747f2.webp?v=1762824787","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/279c740120fd21e781388f0c675807b5f75ddc9c.webp?v=1762824788","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78fdc9de68ad3fdb2a3da83cab3c77e0fa34b583.webp?v=1762824789"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c1eaa3e1cabf79560ba6e80559a2e3d757778e8.webp?v=1762824781","options":["color"],"media":[{"alt":null,"id":26351350841443,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c1eaa3e1cabf79560ba6e80559a2e3d757778e8.webp?v=1762824781"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c1eaa3e1cabf79560ba6e80559a2e3d757778e8.webp?v=1762824781","width":2000},{"alt":null,"id":26351350939747,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/240236bc817e863eaf446db6acba5a9fc1cd4726.webp?v=1762824782"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/240236bc817e863eaf446db6acba5a9fc1cd4726.webp?v=1762824782","width":2000},{"alt":null,"id":26351351169123,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/532fe05ff37f2e70e2199448b6c1da5e2eb62412.webp?v=1762824783"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/532fe05ff37f2e70e2199448b6c1da5e2eb62412.webp?v=1762824783","width":2000},{"alt":null,"id":26351351431267,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6e9dd2247bb1cb081294fc67251c3d1daa7e48fb.webp?v=1762824783"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6e9dd2247bb1cb081294fc67251c3d1daa7e48fb.webp?v=1762824783","width":2000},{"alt":null,"id":26351351693411,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4514845e9a0c0b1d60a824da5ed473038d84cbfb.webp?v=1762824784"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4514845e9a0c0b1d60a824da5ed473038d84cbfb.webp?v=1762824784","width":2000},{"alt":null,"id":26351351988323,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/722435020ae4cbbc654d10cff62778cb5ef1d359.webp?v=1762824785"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/722435020ae4cbbc654d10cff62778cb5ef1d359.webp?v=1762824785","width":2000},{"alt":null,"id":26351352086627,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48feb8638a58a9f5c220dea97ba884ebb74fae44.webp?v=1762824786"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48feb8638a58a9f5c220dea97ba884ebb74fae44.webp?v=1762824786","width":2000},{"alt":null,"id":26351352217699,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6fe5e7e887755684ce93ae427f9d3cc7b25e8dc3.webp?v=1762824786"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6fe5e7e887755684ce93ae427f9d3cc7b25e8dc3.webp?v=1762824786","width":2000},{"alt":null,"id":26351352479843,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6744b218587b91483f27f82455a571a565a747f2.webp?v=1762824787"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6744b218587b91483f27f82455a571a565a747f2.webp?v=1762824787","width":2000},{"alt":null,"id":26351352709219,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/279c740120fd21e781388f0c675807b5f75ddc9c.webp?v=1762824788"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/279c740120fd21e781388f0c675807b5f75ddc9c.webp?v=1762824788","width":2000},{"alt":null,"id":26351353167971,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78fdc9de68ad3fdb2a3da83cab3c77e0fa34b583.webp?v=1762824789"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78fdc9de68ad3fdb2a3da83cab3c77e0fa34b583.webp?v=1762824789","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":43830799761507,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785894924387,"product_id":7921111466083,"position":7,"created_at":"2025-11-11T09:33:04+08:00","updated_at":"2025-11-11T09:33:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48feb8638a58a9f5c220dea97ba884ebb74fae44.webp?v=1762824786","variant_ids":[43830799761507]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-HD70","featured_media":{"alt":null,"id":26351352086627,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48feb8638a58a9f5c220dea97ba884ebb74fae44.webp?v=1762824786"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830800777315,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785894170723,"product_id":7921111466083,"position":4,"created_at":"2025-11-11T09:33:01+08:00","updated_at":"2025-11-11T09:33:03+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6e9dd2247bb1cb081294fc67251c3d1daa7e48fb.webp?v=1762824783","variant_ids":[43830800777315]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118524-HD70","featured_media":{"alt":null,"id":26351351431267,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6e9dd2247bb1cb081294fc67251c3d1daa7e48fb.webp?v=1762824783"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830800810083,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785894400099,"product_id":7921111466083,"position":5,"created_at":"2025-11-11T09:33:02+08:00","updated_at":"2025-11-11T09:33:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4514845e9a0c0b1d60a824da5ed473038d84cbfb.webp?v=1762824784","variant_ids":[43830800810083]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118569-HD70","featured_media":{"alt":null,"id":26351351693411,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4514845e9a0c0b1d60a824da5ed473038d84cbfb.webp?v=1762824784"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830800908387,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785895055459,"product_id":7921111466083,"position":8,"created_at":"2025-11-11T09:33:04+08:00","updated_at":"2025-11-11T09:33:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6fe5e7e887755684ce93ae427f9d3cc7b25e8dc3.webp?v=1762824786","variant_ids":[43830800908387]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118504-HD70","featured_media":{"alt":null,"id":26351352217699,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6fe5e7e887755684ce93ae427f9d3cc7b25e8dc3.webp?v=1762824786"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830801072227,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785893679203,"product_id":7921111466083,"position":1,"created_at":"2025-11-11T09:33:00+08:00","updated_at":"2025-11-11T09:33:01+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c1eaa3e1cabf79560ba6e80559a2e3d757778e8.webp?v=1762824781","variant_ids":[43830801072227]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185J5-HD70","featured_media":{"alt":null,"id":26351350841443,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c1eaa3e1cabf79560ba6e80559a2e3d757778e8.webp?v=1762824781"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43830799761507,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-HD70","requires_shipping":true,"taxable":true,"featured_image":{"id":34785894924387,"product_id":7921111466083,"position":7,"created_at":"2025-11-11T09:33:04+08:00","updated_at":"2025-11-11T09:33:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48feb8638a58a9f5c220dea97ba884ebb74fae44.webp?v=1762824786","variant_ids":[43830799761507]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX Incrediville 怪奇事物所 所長的酒池肉林 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-HD70","featured_media":{"alt":null,"id":26351352086627,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/48feb8638a58a9f5c220dea97ba884ebb74fae44.webp?v=1762824786"}},"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: "停產"
}