$product = {"id":7903405408355,"title":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池","handle":"iphone-12-pro-mod-nx-printable-it31","description":null,"published_at":"2025-10-20T09:47:11+08:00","created_at":"2025-10-20T09:22:26+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-godgwawa","device-iPhone 12 Pro","merge","reseller-godgwawa"],"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":43786534322275,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672842113123,"product_id":7903405408355,"position":9,"created_at":"2025-10-20T09:22:33+08:00","updated_at":"2025-10-20T09:22:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6041de77265ef316b708b7bd6584809e0d9c0e18.webp?v=1760923355","variant_ids":[43786534322275]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242101051491,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6041de77265ef316b708b7bd6584809e0d9c0e18.webp?v=1760923355"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43786536419427,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672841293923,"product_id":7903405408355,"position":5,"created_at":"2025-10-20T09:22:30+08:00","updated_at":"2025-10-20T09:22:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4dc5611b3de6c9884c890f5021323b6758cf61d.webp?v=1760923352","variant_ids":[43786536419427]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242100232291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4dc5611b3de6c9884c890f5021323b6758cf61d.webp?v=1760923352"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43786536648803,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672840769635,"product_id":7903405408355,"position":3,"created_at":"2025-10-20T09:22:29+08:00","updated_at":"2025-10-20T09:22:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f5fd1ed718acbc4ec1a16cb9161e5c17196146c.webp?v=1760923351","variant_ids":[43786536648803]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242099708003,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f5fd1ed718acbc4ec1a16cb9161e5c17196146c.webp?v=1760923351"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43786536681571,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672841916515,"product_id":7903405408355,"position":8,"created_at":"2025-10-20T09:22:32+08:00","updated_at":"2025-10-20T09:22:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43844fd009c9130e6039b3a624cfaf43b124ac1a.webp?v=1760923354","variant_ids":[43786536681571]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242100887651,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43844fd009c9130e6039b3a624cfaf43b124ac1a.webp?v=1760923354"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43786536714339,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672841490531,"product_id":7903405408355,"position":6,"created_at":"2025-10-20T09:22:31+08:00","updated_at":"2025-10-20T09:22:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/783d4e66f81beb539e04bdc588f2500175cac47c.webp?v=1760923353","variant_ids":[43786536714339]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242100428899,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/783d4e66f81beb539e04bdc588f2500175cac47c.webp?v=1760923353"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b218c88ff95ca9c16bb4dfaddd3e8458d0236a6.webp?v=1760923350","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/612cdfa722e4a90e68236e850498a4b522bc21c6.webp?v=1760923350","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f5fd1ed718acbc4ec1a16cb9161e5c17196146c.webp?v=1760923351","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/09046b11fb8f3a0d97c092528e19fc84974c278a.webp?v=1760923351","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4dc5611b3de6c9884c890f5021323b6758cf61d.webp?v=1760923352","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/783d4e66f81beb539e04bdc588f2500175cac47c.webp?v=1760923353","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93a63c68cb55fda383989965c2973c1fd4e3ebae.webp?v=1760923353","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43844fd009c9130e6039b3a624cfaf43b124ac1a.webp?v=1760923354","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6041de77265ef316b708b7bd6584809e0d9c0e18.webp?v=1760923355","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/031a36920ef6d7ac4da2b7404af8886c4a7309ce.webp?v=1760923355","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6a8504ea3689ddc9835878ce4db6a1513df0855.webp?v=1760923356"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b218c88ff95ca9c16bb4dfaddd3e8458d0236a6.webp?v=1760923350","options":["color"],"media":[{"alt":null,"id":26242099314787,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b218c88ff95ca9c16bb4dfaddd3e8458d0236a6.webp?v=1760923350"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b218c88ff95ca9c16bb4dfaddd3e8458d0236a6.webp?v=1760923350","width":2000},{"alt":null,"id":26242099544163,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/612cdfa722e4a90e68236e850498a4b522bc21c6.webp?v=1760923350"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/612cdfa722e4a90e68236e850498a4b522bc21c6.webp?v=1760923350","width":2000},{"alt":null,"id":26242099708003,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f5fd1ed718acbc4ec1a16cb9161e5c17196146c.webp?v=1760923351"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f5fd1ed718acbc4ec1a16cb9161e5c17196146c.webp?v=1760923351","width":2000},{"alt":null,"id":26242099937379,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/09046b11fb8f3a0d97c092528e19fc84974c278a.webp?v=1760923351"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/09046b11fb8f3a0d97c092528e19fc84974c278a.webp?v=1760923351","width":2000},{"alt":null,"id":26242100232291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4dc5611b3de6c9884c890f5021323b6758cf61d.webp?v=1760923352"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4dc5611b3de6c9884c890f5021323b6758cf61d.webp?v=1760923352","width":2000},{"alt":null,"id":26242100428899,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/783d4e66f81beb539e04bdc588f2500175cac47c.webp?v=1760923353"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/783d4e66f81beb539e04bdc588f2500175cac47c.webp?v=1760923353","width":2000},{"alt":null,"id":26242100625507,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93a63c68cb55fda383989965c2973c1fd4e3ebae.webp?v=1760923353"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/93a63c68cb55fda383989965c2973c1fd4e3ebae.webp?v=1760923353","width":2000},{"alt":null,"id":26242100887651,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43844fd009c9130e6039b3a624cfaf43b124ac1a.webp?v=1760923354"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43844fd009c9130e6039b3a624cfaf43b124ac1a.webp?v=1760923354","width":2000},{"alt":null,"id":26242101051491,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6041de77265ef316b708b7bd6584809e0d9c0e18.webp?v=1760923355"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6041de77265ef316b708b7bd6584809e0d9c0e18.webp?v=1760923355","width":2000},{"alt":null,"id":26242101248099,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/031a36920ef6d7ac4da2b7404af8886c4a7309ce.webp?v=1760923355"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/031a36920ef6d7ac4da2b7404af8886c4a7309ce.webp?v=1760923355","width":2000},{"alt":null,"id":26242101444707,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6a8504ea3689ddc9835878ce4db6a1513df0855.webp?v=1760923356"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f6a8504ea3689ddc9835878ce4db6a1513df0855.webp?v=1760923356","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":43786534322275,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672842113123,"product_id":7903405408355,"position":9,"created_at":"2025-10-20T09:22:33+08:00","updated_at":"2025-10-20T09:22:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6041de77265ef316b708b7bd6584809e0d9c0e18.webp?v=1760923355","variant_ids":[43786534322275]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242101051491,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6041de77265ef316b708b7bd6584809e0d9c0e18.webp?v=1760923355"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43786536419427,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672841293923,"product_id":7903405408355,"position":5,"created_at":"2025-10-20T09:22:30+08:00","updated_at":"2025-10-20T09:22:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4dc5611b3de6c9884c890f5021323b6758cf61d.webp?v=1760923352","variant_ids":[43786536419427]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242100232291,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4dc5611b3de6c9884c890f5021323b6758cf61d.webp?v=1760923352"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43786536648803,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672840769635,"product_id":7903405408355,"position":3,"created_at":"2025-10-20T09:22:29+08:00","updated_at":"2025-10-20T09:22:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f5fd1ed718acbc4ec1a16cb9161e5c17196146c.webp?v=1760923351","variant_ids":[43786536648803]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242099708003,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f5fd1ed718acbc4ec1a16cb9161e5c17196146c.webp?v=1760923351"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43786536681571,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672841916515,"product_id":7903405408355,"position":8,"created_at":"2025-10-20T09:22:32+08:00","updated_at":"2025-10-20T09:22:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43844fd009c9130e6039b3a624cfaf43b124ac1a.webp?v=1760923354","variant_ids":[43786536681571]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242100887651,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43844fd009c9130e6039b3a624cfaf43b124ac1a.webp?v=1760923354"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43786536714339,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672841490531,"product_id":7903405408355,"position":6,"created_at":"2025-10-20T09:22:31+08:00","updated_at":"2025-10-20T09:22:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/783d4e66f81beb539e04bdc588f2500175cac47c.webp?v=1760923353","variant_ids":[43786536714339]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242100428899,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/783d4e66f81beb539e04bdc588f2500175cac47c.webp?v=1760923353"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43786534322275,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-IT31","requires_shipping":true,"taxable":true,"featured_image":{"id":34672842113123,"product_id":7903405408355,"position":9,"created_at":"2025-10-20T09:22:33+08:00","updated_at":"2025-10-20T09:22:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6041de77265ef316b708b7bd6584809e0d9c0e18.webp?v=1760923355","variant_ids":[43786534322275]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 變種吉娃娃 Godgwawa 吉樂泳池 - 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-IT31","featured_media":{"alt":null,"id":26242101051491,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6041de77265ef316b708b7bd6584809e0d9c0e18.webp?v=1760923355"}},"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: "停產"
}