$product = {"id":7838029676643,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸","handle":"iphone-12-pro-mod-nx-magsafe-hk66","description":null,"published_at":"2025-07-16T12:00:24+08:00","created_at":"2025-07-16T09:38:25+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-bounce","device-iPhone 12 Pro","merge","reseller-bounce"],"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":43528534851683,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193079730275,"product_id":7838029676643,"position":4,"created_at":"2025-07-16T09:38:31+08:00","updated_at":"2025-07-16T09:38:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d384b992ad37b8b6ea4ad7a2cefeec102b9c43c4.webp?v=1752629913","variant_ids":[43528534851683]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-HK66","featured_media":{"alt":null,"id":25827261481059,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d384b992ad37b8b6ea4ad7a2cefeec102b9c43c4.webp?v=1752629913"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528538849379,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193082318947,"product_id":7838029676643,"position":11,"created_at":"2025-07-16T09:38:35+08:00","updated_at":"2025-07-16T09:38:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d9c2091af005df1eafcd891835f47a21385c0b9.webp?v=1752629917","variant_ids":[43528538849379]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118569-HK66","featured_media":{"alt":null,"id":25827262988387,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d9c2091af005df1eafcd891835f47a21385c0b9.webp?v=1752629917"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528538882147,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193081761891,"product_id":7838029676643,"position":9,"created_at":"2025-07-16T09:38:34+08:00","updated_at":"2025-07-16T09:38:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2154e3688cdb1c4490a31a7dc3c73685f6be4693.webp?v=1752629916","variant_ids":[43528538882147]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118504-HK66","featured_media":{"alt":null,"id":25827262693475,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2154e3688cdb1c4490a31a7dc3c73685f6be4693.webp?v=1752629916"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528538980451,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193079271523,"product_id":7838029676643,"position":2,"created_at":"2025-07-16T09:38:29+08:00","updated_at":"2025-07-16T09:38:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67c59d79546894cdcaec085c2fd5f918c365318c.webp?v=1752629911","variant_ids":[43528538980451]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118524-HK66","featured_media":{"alt":null,"id":25827261218915,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67c59d79546894cdcaec085c2fd5f918c365318c.webp?v=1752629911"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528539144291,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193079468131,"product_id":7838029676643,"position":3,"created_at":"2025-07-16T09:38:30+08:00","updated_at":"2025-07-16T09:38:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39bb3ddcc29ce9eb1153b879bb264c85ac81f3b9.webp?v=1752629912","variant_ids":[43528539144291]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185J5-HK66","featured_media":{"alt":null,"id":25827261349987,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39bb3ddcc29ce9eb1153b879bb264c85ac81f3b9.webp?v=1752629912"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fffa92650d129e4584d780c5980a3793a1e534a.webp?v=1752629911","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67c59d79546894cdcaec085c2fd5f918c365318c.webp?v=1752629911","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39bb3ddcc29ce9eb1153b879bb264c85ac81f3b9.webp?v=1752629912","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d384b992ad37b8b6ea4ad7a2cefeec102b9c43c4.webp?v=1752629913","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c3e6edde4d213ba3ada87ab4fa698abe0259950.webp?v=1752629913","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bfb7f5376b5c448ad796c25ec39b2ed393a3e9d0.webp?v=1752629914","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaffafee4ee31a9819900bac395171de94e8af92.webp?v=1752629915","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a590b36b821ccf20c91b22fc6c31f4491e42d0ac.webp?v=1752629915","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2154e3688cdb1c4490a31a7dc3c73685f6be4693.webp?v=1752629916","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28d3fb857f696f262fef36a97cabe28b18f0debd.webp?v=1752629916","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d9c2091af005df1eafcd891835f47a21385c0b9.webp?v=1752629917"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fffa92650d129e4584d780c5980a3793a1e534a.webp?v=1752629911","options":["color"],"media":[{"alt":null,"id":25827261087843,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fffa92650d129e4584d780c5980a3793a1e534a.webp?v=1752629911"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5fffa92650d129e4584d780c5980a3793a1e534a.webp?v=1752629911","width":2000},{"alt":null,"id":25827261218915,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67c59d79546894cdcaec085c2fd5f918c365318c.webp?v=1752629911"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67c59d79546894cdcaec085c2fd5f918c365318c.webp?v=1752629911","width":2000},{"alt":null,"id":25827261349987,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39bb3ddcc29ce9eb1153b879bb264c85ac81f3b9.webp?v=1752629912"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39bb3ddcc29ce9eb1153b879bb264c85ac81f3b9.webp?v=1752629912","width":2000},{"alt":null,"id":25827261481059,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d384b992ad37b8b6ea4ad7a2cefeec102b9c43c4.webp?v=1752629913"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d384b992ad37b8b6ea4ad7a2cefeec102b9c43c4.webp?v=1752629913","width":2000},{"alt":null,"id":25827261612131,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c3e6edde4d213ba3ada87ab4fa698abe0259950.webp?v=1752629913"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c3e6edde4d213ba3ada87ab4fa698abe0259950.webp?v=1752629913","width":2000},{"alt":null,"id":25827261710435,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bfb7f5376b5c448ad796c25ec39b2ed393a3e9d0.webp?v=1752629914"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bfb7f5376b5c448ad796c25ec39b2ed393a3e9d0.webp?v=1752629914","width":2000},{"alt":null,"id":25827261808739,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaffafee4ee31a9819900bac395171de94e8af92.webp?v=1752629915"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aaffafee4ee31a9819900bac395171de94e8af92.webp?v=1752629915","width":2000},{"alt":null,"id":25827262529635,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a590b36b821ccf20c91b22fc6c31f4491e42d0ac.webp?v=1752629915"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a590b36b821ccf20c91b22fc6c31f4491e42d0ac.webp?v=1752629915","width":2000},{"alt":null,"id":25827262693475,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2154e3688cdb1c4490a31a7dc3c73685f6be4693.webp?v=1752629916"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2154e3688cdb1c4490a31a7dc3c73685f6be4693.webp?v=1752629916","width":2000},{"alt":null,"id":25827262857315,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28d3fb857f696f262fef36a97cabe28b18f0debd.webp?v=1752629916"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28d3fb857f696f262fef36a97cabe28b18f0debd.webp?v=1752629916","width":2000},{"alt":null,"id":25827262988387,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d9c2091af005df1eafcd891835f47a21385c0b9.webp?v=1752629917"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d9c2091af005df1eafcd891835f47a21385c0b9.webp?v=1752629917","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":43528534851683,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193079730275,"product_id":7838029676643,"position":4,"created_at":"2025-07-16T09:38:31+08:00","updated_at":"2025-07-16T09:38:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d384b992ad37b8b6ea4ad7a2cefeec102b9c43c4.webp?v=1752629913","variant_ids":[43528534851683]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-HK66","featured_media":{"alt":null,"id":25827261481059,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d384b992ad37b8b6ea4ad7a2cefeec102b9c43c4.webp?v=1752629913"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528538849379,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193082318947,"product_id":7838029676643,"position":11,"created_at":"2025-07-16T09:38:35+08:00","updated_at":"2025-07-16T09:38:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d9c2091af005df1eafcd891835f47a21385c0b9.webp?v=1752629917","variant_ids":[43528538849379]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - Graphite","public_title":"Graphite","options":["Graphite"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118569-HK66","featured_media":{"alt":null,"id":25827262988387,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d9c2091af005df1eafcd891835f47a21385c0b9.webp?v=1752629917"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528538882147,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193081761891,"product_id":7838029676643,"position":9,"created_at":"2025-07-16T09:38:34+08:00","updated_at":"2025-07-16T09:38:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2154e3688cdb1c4490a31a7dc3c73685f6be4693.webp?v=1752629916","variant_ids":[43528538882147]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118504-HK66","featured_media":{"alt":null,"id":25827262693475,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2154e3688cdb1c4490a31a7dc3c73685f6be4693.webp?v=1752629916"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528538980451,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193079271523,"product_id":7838029676643,"position":2,"created_at":"2025-07-16T09:38:29+08:00","updated_at":"2025-07-16T09:38:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67c59d79546894cdcaec085c2fd5f918c365318c.webp?v=1752629911","variant_ids":[43528538980451]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0118524-HK66","featured_media":{"alt":null,"id":25827261218915,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67c59d79546894cdcaec085c2fd5f918c365318c.webp?v=1752629911"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43528539144291,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193079468131,"product_id":7838029676643,"position":3,"created_at":"2025-07-16T09:38:30+08:00","updated_at":"2025-07-16T09:38:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39bb3ddcc29ce9eb1153b879bb264c85ac81f3b9.webp?v=1752629912","variant_ids":[43528539144291]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185J5-HK66","featured_media":{"alt":null,"id":25827261349987,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/39bb3ddcc29ce9eb1153b879bb264c85ac81f3b9.webp?v=1752629912"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43528534851683,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-HK66","requires_shipping":true,"taxable":true,"featured_image":{"id":34193079730275,"product_id":7838029676643,"position":4,"created_at":"2025-07-16T09:38:31+08:00","updated_at":"2025-07-16T09:38:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d384b992ad37b8b6ea4ad7a2cefeec102b9c43c4.webp?v=1752629913","variant_ids":[43528534851683]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) BOUNCE 棒棒獸 - Lavender","public_title":"Lavender","options":["Lavender"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01185C1-HK66","featured_media":{"alt":null,"id":25827261481059,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d384b992ad37b8b6ea4ad7a2cefeec102b9c43c4.webp?v=1752629913"}},"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: "停產"
}