$product = {"id":7886147190883,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米","handle":"iphone-12-pro-mod-nx-magsafe-printable-lmo05","description":null,"published_at":"2025-09-17T10:53:39+08:00","created_at":"2025-09-17T10:03:30+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-cherng","device-iPhone 12 Pro","merge","reseller-cherng"],"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":43734826680419,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500246175843,"product_id":7886147190883,"position":7,"created_at":"2025-09-17T10:03:37+08:00","updated_at":"2025-09-17T10:03:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de85df023d52090ae5d9ab373e05f9de202d47d2.webp?v=1758074619","variant_ids":[43734826680419]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071837933667,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de85df023d52090ae5d9ab373e05f9de202d47d2.webp?v=1758074619"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43734829269091,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500246437987,"product_id":7886147190883,"position":8,"created_at":"2025-09-17T10:03:38+08:00","updated_at":"2025-09-17T10:03:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a391686c65d2640a63e8a2300019be56af586c61.webp?v=1758074620","variant_ids":[43734829269091]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071838195811,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a391686c65d2640a63e8a2300019be56af586c61.webp?v=1758074620"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43734829400163,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500247388259,"product_id":7886147190883,"position":11,"created_at":"2025-09-17T10:03:40+08:00","updated_at":"2025-09-17T10:03:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c91142febfea3e53b222f2ee07fa46a01842603.webp?v=1758074622","variant_ids":[43734829400163]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071839146083,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c91142febfea3e53b222f2ee07fa46a01842603.webp?v=1758074622"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43734829498467,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500245323875,"product_id":7886147190883,"position":3,"created_at":"2025-09-17T10:03:35+08:00","updated_at":"2025-09-17T10:03:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6857afc0708eeff52508979ab6deb35f34aec16c.webp?v=1758074617","variant_ids":[43734829498467]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071837081699,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6857afc0708eeff52508979ab6deb35f34aec16c.webp?v=1758074617"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43734829564003,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500245913699,"product_id":7886147190883,"position":6,"created_at":"2025-09-17T10:03:37+08:00","updated_at":"2025-09-17T10:03:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0ff81e13d00e5193137d4d4ee81f3df5af66aea8.webp?v=1758074619","variant_ids":[43734829564003]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071837671523,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0ff81e13d00e5193137d4d4ee81f3df5af66aea8.webp?v=1758074619"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/996b4ad3c244e5780971ecb64d5412c0b05dc228.webp?v=1758074616","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51f801de98b63cdbeb656fc32e80bfe34736a36e.webp?v=1758074617","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6857afc0708eeff52508979ab6deb35f34aec16c.webp?v=1758074617","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/049674f535e1a6b6eccc588553c551ca182b6e5e.webp?v=1758074617","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b313db59f71e9dbe5761a51214c867308ea4d21.webp?v=1758074618","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0ff81e13d00e5193137d4d4ee81f3df5af66aea8.webp?v=1758074619","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de85df023d52090ae5d9ab373e05f9de202d47d2.webp?v=1758074619","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a391686c65d2640a63e8a2300019be56af586c61.webp?v=1758074620","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31555b76258df583acd126a0cebb400f95095465.webp?v=1758074620","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/825db3a4faf68956079b3f8d792cbab1b23ea63e.webp?v=1758074622","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c91142febfea3e53b222f2ee07fa46a01842603.webp?v=1758074622"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/996b4ad3c244e5780971ecb64d5412c0b05dc228.webp?v=1758074616","options":["color"],"media":[{"alt":null,"id":26071836754019,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/996b4ad3c244e5780971ecb64d5412c0b05dc228.webp?v=1758074616"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/996b4ad3c244e5780971ecb64d5412c0b05dc228.webp?v=1758074616","width":2000},{"alt":null,"id":26071836950627,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51f801de98b63cdbeb656fc32e80bfe34736a36e.webp?v=1758074617"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/51f801de98b63cdbeb656fc32e80bfe34736a36e.webp?v=1758074617","width":2000},{"alt":null,"id":26071837081699,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6857afc0708eeff52508979ab6deb35f34aec16c.webp?v=1758074617"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6857afc0708eeff52508979ab6deb35f34aec16c.webp?v=1758074617","width":2000},{"alt":null,"id":26071837212771,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/049674f535e1a6b6eccc588553c551ca182b6e5e.webp?v=1758074617"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/049674f535e1a6b6eccc588553c551ca182b6e5e.webp?v=1758074617","width":2000},{"alt":null,"id":26071837343843,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b313db59f71e9dbe5761a51214c867308ea4d21.webp?v=1758074618"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b313db59f71e9dbe5761a51214c867308ea4d21.webp?v=1758074618","width":2000},{"alt":null,"id":26071837671523,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0ff81e13d00e5193137d4d4ee81f3df5af66aea8.webp?v=1758074619"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0ff81e13d00e5193137d4d4ee81f3df5af66aea8.webp?v=1758074619","width":2000},{"alt":null,"id":26071837933667,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de85df023d52090ae5d9ab373e05f9de202d47d2.webp?v=1758074619"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de85df023d52090ae5d9ab373e05f9de202d47d2.webp?v=1758074619","width":2000},{"alt":null,"id":26071838195811,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a391686c65d2640a63e8a2300019be56af586c61.webp?v=1758074620"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a391686c65d2640a63e8a2300019be56af586c61.webp?v=1758074620","width":2000},{"alt":null,"id":26071838457955,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31555b76258df583acd126a0cebb400f95095465.webp?v=1758074620"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31555b76258df583acd126a0cebb400f95095465.webp?v=1758074620","width":2000},{"alt":null,"id":26071838851171,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/825db3a4faf68956079b3f8d792cbab1b23ea63e.webp?v=1758074622"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/825db3a4faf68956079b3f8d792cbab1b23ea63e.webp?v=1758074622","width":2000},{"alt":null,"id":26071839146083,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c91142febfea3e53b222f2ee07fa46a01842603.webp?v=1758074622"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c91142febfea3e53b222f2ee07fa46a01842603.webp?v=1758074622","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":43734826680419,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500246175843,"product_id":7886147190883,"position":7,"created_at":"2025-09-17T10:03:37+08:00","updated_at":"2025-09-17T10:03:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de85df023d52090ae5d9ab373e05f9de202d47d2.webp?v=1758074619","variant_ids":[43734826680419]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071837933667,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de85df023d52090ae5d9ab373e05f9de202d47d2.webp?v=1758074619"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43734829269091,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500246437987,"product_id":7886147190883,"position":8,"created_at":"2025-09-17T10:03:38+08:00","updated_at":"2025-09-17T10:03:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a391686c65d2640a63e8a2300019be56af586c61.webp?v=1758074620","variant_ids":[43734829269091]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071838195811,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a391686c65d2640a63e8a2300019be56af586c61.webp?v=1758074620"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43734829400163,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500247388259,"product_id":7886147190883,"position":11,"created_at":"2025-09-17T10:03:40+08:00","updated_at":"2025-09-17T10:03:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c91142febfea3e53b222f2ee07fa46a01842603.webp?v=1758074622","variant_ids":[43734829400163]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071839146083,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c91142febfea3e53b222f2ee07fa46a01842603.webp?v=1758074622"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43734829498467,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500245323875,"product_id":7886147190883,"position":3,"created_at":"2025-09-17T10:03:35+08:00","updated_at":"2025-09-17T10:03:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6857afc0708eeff52508979ab6deb35f34aec16c.webp?v=1758074617","variant_ids":[43734829498467]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071837081699,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6857afc0708eeff52508979ab6deb35f34aec16c.webp?v=1758074617"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43734829564003,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500245913699,"product_id":7886147190883,"position":6,"created_at":"2025-09-17T10:03:37+08:00","updated_at":"2025-09-17T10:03:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0ff81e13d00e5193137d4d4ee81f3df5af66aea8.webp?v=1758074619","variant_ids":[43734829564003]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071837671523,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0ff81e13d00e5193137d4d4ee81f3df5af66aea8.webp?v=1758074619"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43734826680419,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-LMO05","requires_shipping":true,"taxable":true,"featured_image":{"id":34500246175843,"product_id":7886147190883,"position":7,"created_at":"2025-09-17T10:03:37+08:00","updated_at":"2025-09-17T10:03:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de85df023d52090ae5d9ab373e05f9de202d47d2.webp?v=1758074619","variant_ids":[43734826680419]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 馬來貘LAIMO 楊老闆的貓米 - 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-LMO05","featured_media":{"alt":null,"id":26071837933667,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/de85df023d52090ae5d9ab373e05f9de202d47d2.webp?v=1758074619"}},"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: "停產"
}