$product = {"id":7888353820771,"title":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛","handle":"iphone-12-pro-mod-nx-printable-iq01","description":null,"published_at":"2025-09-23T09:24:43+08:00","created_at":"2025-09-22T15:10:21+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-kingjun","device-iPhone 12 Pro","merge","reseller-kingjun"],"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":43742786977891,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514073223267,"product_id":7888353820771,"position":3,"created_at":"2025-09-22T15:10:26+08:00","updated_at":"2025-09-22T15:10:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cc2dca1f7b1a8e54e4a6349c6e996601d02b814.webp?v=1758525028","variant_ids":[43742786977891]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084515741795,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cc2dca1f7b1a8e54e4a6349c6e996601d02b814.webp?v=1758525028"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742790484067,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514074894435,"product_id":7888353820771,"position":11,"created_at":"2025-09-22T15:10:30+08:00","updated_at":"2025-09-22T15:10:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4cc78fac0aaf3884314aea9faae8d3a3afb7b7a.webp?v=1758525032","variant_ids":[43742790484067]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084517412963,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4cc78fac0aaf3884314aea9faae8d3a3afb7b7a.webp?v=1758525032"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742790615139,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514074599523,"product_id":7888353820771,"position":9,"created_at":"2025-09-22T15:10:29+08:00","updated_at":"2025-09-22T15:10:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd664fd165a796b900ead9d3a4a95459ea2c0f01.webp?v=1758525031","variant_ids":[43742790615139]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084517118051,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd664fd165a796b900ead9d3a4a95459ea2c0f01.webp?v=1758525031"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742790713443,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514074533987,"product_id":7888353820771,"position":8,"created_at":"2025-09-22T15:10:29+08:00","updated_at":"2025-09-22T15:10:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/035efb3900e6631bb07a81406db52d4c03e24479.webp?v=1758525031","variant_ids":[43742790713443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084517019747,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/035efb3900e6631bb07a81406db52d4c03e24479.webp?v=1758525031"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742790746211,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514074763363,"product_id":7888353820771,"position":10,"created_at":"2025-09-22T15:10:30+08:00","updated_at":"2025-09-22T15:10:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfb99d8f7e746ea969a333066f4b848f1edf8c9e.webp?v=1758525032","variant_ids":[43742790746211]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084517281891,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfb99d8f7e746ea969a333066f4b848f1edf8c9e.webp?v=1758525032"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/726419a815debb1caee91976777dd550f2f66145.webp?v=1758525027","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36df08b5d6a4b5904fa6f8546ffb2cc3859dda22.webp?v=1758525028","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cc2dca1f7b1a8e54e4a6349c6e996601d02b814.webp?v=1758525028","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178e243a09e85c9ee852efff009fc28bbd67ca1d.webp?v=1758525029","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3ccf11b2cdce43dcfc35b53415a51e40d7d4980.webp?v=1758525029","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b0acaf48e2c6fa110f90f9332655182c032fd15.webp?v=1758525030","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0c7cae2996a5f277cec04b01f8463aebed5946ab.webp?v=1758525030","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/035efb3900e6631bb07a81406db52d4c03e24479.webp?v=1758525031","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd664fd165a796b900ead9d3a4a95459ea2c0f01.webp?v=1758525031","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfb99d8f7e746ea969a333066f4b848f1edf8c9e.webp?v=1758525032","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4cc78fac0aaf3884314aea9faae8d3a3afb7b7a.webp?v=1758525032"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/726419a815debb1caee91976777dd550f2f66145.webp?v=1758525027","options":["color"],"media":[{"alt":null,"id":26084515151971,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/726419a815debb1caee91976777dd550f2f66145.webp?v=1758525027"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/726419a815debb1caee91976777dd550f2f66145.webp?v=1758525027","width":2000},{"alt":null,"id":26084515414115,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36df08b5d6a4b5904fa6f8546ffb2cc3859dda22.webp?v=1758525028"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/36df08b5d6a4b5904fa6f8546ffb2cc3859dda22.webp?v=1758525028","width":2000},{"alt":null,"id":26084515741795,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cc2dca1f7b1a8e54e4a6349c6e996601d02b814.webp?v=1758525028"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cc2dca1f7b1a8e54e4a6349c6e996601d02b814.webp?v=1758525028","width":2000},{"alt":null,"id":26084516036707,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178e243a09e85c9ee852efff009fc28bbd67ca1d.webp?v=1758525029"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178e243a09e85c9ee852efff009fc28bbd67ca1d.webp?v=1758525029","width":2000},{"alt":null,"id":26084516233315,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3ccf11b2cdce43dcfc35b53415a51e40d7d4980.webp?v=1758525029"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3ccf11b2cdce43dcfc35b53415a51e40d7d4980.webp?v=1758525029","width":2000},{"alt":null,"id":26084516429923,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b0acaf48e2c6fa110f90f9332655182c032fd15.webp?v=1758525030"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b0acaf48e2c6fa110f90f9332655182c032fd15.webp?v=1758525030","width":2000},{"alt":null,"id":26084516692067,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0c7cae2996a5f277cec04b01f8463aebed5946ab.webp?v=1758525030"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0c7cae2996a5f277cec04b01f8463aebed5946ab.webp?v=1758525030","width":2000},{"alt":null,"id":26084517019747,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/035efb3900e6631bb07a81406db52d4c03e24479.webp?v=1758525031"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/035efb3900e6631bb07a81406db52d4c03e24479.webp?v=1758525031","width":2000},{"alt":null,"id":26084517118051,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd664fd165a796b900ead9d3a4a95459ea2c0f01.webp?v=1758525031"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd664fd165a796b900ead9d3a4a95459ea2c0f01.webp?v=1758525031","width":2000},{"alt":null,"id":26084517281891,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfb99d8f7e746ea969a333066f4b848f1edf8c9e.webp?v=1758525032"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfb99d8f7e746ea969a333066f4b848f1edf8c9e.webp?v=1758525032","width":2000},{"alt":null,"id":26084517412963,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4cc78fac0aaf3884314aea9faae8d3a3afb7b7a.webp?v=1758525032"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4cc78fac0aaf3884314aea9faae8d3a3afb7b7a.webp?v=1758525032","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":43742786977891,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514073223267,"product_id":7888353820771,"position":3,"created_at":"2025-09-22T15:10:26+08:00","updated_at":"2025-09-22T15:10:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cc2dca1f7b1a8e54e4a6349c6e996601d02b814.webp?v=1758525028","variant_ids":[43742786977891]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084515741795,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cc2dca1f7b1a8e54e4a6349c6e996601d02b814.webp?v=1758525028"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742790484067,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514074894435,"product_id":7888353820771,"position":11,"created_at":"2025-09-22T15:10:30+08:00","updated_at":"2025-09-22T15:10:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4cc78fac0aaf3884314aea9faae8d3a3afb7b7a.webp?v=1758525032","variant_ids":[43742790484067]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084517412963,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4cc78fac0aaf3884314aea9faae8d3a3afb7b7a.webp?v=1758525032"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742790615139,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514074599523,"product_id":7888353820771,"position":9,"created_at":"2025-09-22T15:10:29+08:00","updated_at":"2025-09-22T15:10:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd664fd165a796b900ead9d3a4a95459ea2c0f01.webp?v=1758525031","variant_ids":[43742790615139]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084517118051,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd664fd165a796b900ead9d3a4a95459ea2c0f01.webp?v=1758525031"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742790713443,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514074533987,"product_id":7888353820771,"position":8,"created_at":"2025-09-22T15:10:29+08:00","updated_at":"2025-09-22T15:10:31+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/035efb3900e6631bb07a81406db52d4c03e24479.webp?v=1758525031","variant_ids":[43742790713443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084517019747,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/035efb3900e6631bb07a81406db52d4c03e24479.webp?v=1758525031"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43742790746211,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514074763363,"product_id":7888353820771,"position":10,"created_at":"2025-09-22T15:10:30+08:00","updated_at":"2025-09-22T15:10:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfb99d8f7e746ea969a333066f4b848f1edf8c9e.webp?v=1758525032","variant_ids":[43742790746211]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084517281891,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfb99d8f7e746ea969a333066f4b848f1edf8c9e.webp?v=1758525032"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43742786977891,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-IQ01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514073223267,"product_id":7888353820771,"position":3,"created_at":"2025-09-22T15:10:26+08:00","updated_at":"2025-09-22T15:10:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cc2dca1f7b1a8e54e4a6349c6e996601d02b814.webp?v=1758525028","variant_ids":[43742786977891]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX KINGJUN 滿滿的愛 - 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-IQ01","featured_media":{"alt":null,"id":26084515741795,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1cc2dca1f7b1a8e54e4a6349c6e996601d02b814.webp?v=1758525028"}},"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: "停產"
}