$product = {"id":7937831010403,"title":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人","handle":"iphone-12-pro-mod-nx-xu08","description":null,"published_at":"2025-12-12T10:51:44+08:00","created_at":"2025-12-11T15:37:18+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-attack-on-titan","device-iPhone 12 Pro","merge","reseller-attack-on-titan"],"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":43884064145507,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932717879395,"product_id":7937831010403,"position":7,"created_at":"2025-12-11T15:37:26+08:00","updated_at":"2025-12-11T15:37:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1b9cbcc59c28b33b65221921a7724ee7603c052.webp?v=1765438648","variant_ids":[43884064145507]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495089770595,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1b9cbcc59c28b33b65221921a7724ee7603c052.webp?v=1765438648"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884067455075,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932718338147,"product_id":7937831010403,"position":10,"created_at":"2025-12-11T15:37:29+08:00","updated_at":"2025-12-11T15:37:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c50fb27ff727ba9daab68abe1e0746ac17825b1e.webp?v=1765438652","variant_ids":[43884067455075]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495090196579,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c50fb27ff727ba9daab68abe1e0746ac17825b1e.webp?v=1765438652"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884067618915,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932718600291,"product_id":7937831010403,"position":11,"created_at":"2025-12-11T15:37:30+08:00","updated_at":"2025-12-11T15:37:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00618c344672ad1da023450990015539d73003ab.webp?v=1765438652","variant_ids":[43884067618915]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495090458723,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00618c344672ad1da023450990015539d73003ab.webp?v=1765438652"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884067684451,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932717256803,"product_id":7937831010403,"position":3,"created_at":"2025-12-11T15:37:24+08:00","updated_at":"2025-12-11T15:37:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e117ee3664993bdca06f92c952088984ef2d12b.webp?v=1765438646","variant_ids":[43884067684451]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495089115235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e117ee3664993bdca06f92c952088984ef2d12b.webp?v=1765438646"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884067717219,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932717682787,"product_id":7937831010403,"position":6,"created_at":"2025-12-11T15:37:25+08:00","updated_at":"2025-12-11T15:37:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc5d41d8d1d6c12fd72de45772ec31287da8b.webp?v=1765438647","variant_ids":[43884067717219]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495089639523,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc5d41d8d1d6c12fd72de45772ec31287da8b.webp?v=1765438647"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e912630ad9438f27035e965068f32f3a9f2c393.webp?v=1765438645","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77d9634ced6e7352dc28e51996e78d24ad43a404.webp?v=1765438645","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e117ee3664993bdca06f92c952088984ef2d12b.webp?v=1765438646","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb0ae45cbed5cc93a0b8752d8ddc5be03b6b53e1.webp?v=1765438646","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e5b34bd8526922ad01dae0774dd5ee8f95e2194.webp?v=1765438647","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc5d41d8d1d6c12fd72de45772ec31287da8b.webp?v=1765438647","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1b9cbcc59c28b33b65221921a7724ee7603c052.webp?v=1765438648","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6d5627c58c1b7be1016231a583b0e63900f3046.webp?v=1765438648","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31bf2766cf25778d47f6a3ba1125b5e3c94f9805.webp?v=1765438651","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c50fb27ff727ba9daab68abe1e0746ac17825b1e.webp?v=1765438652","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00618c344672ad1da023450990015539d73003ab.webp?v=1765438652"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e912630ad9438f27035e965068f32f3a9f2c393.webp?v=1765438645","options":["color"],"media":[{"alt":null,"id":26495088853091,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e912630ad9438f27035e965068f32f3a9f2c393.webp?v=1765438645"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e912630ad9438f27035e965068f32f3a9f2c393.webp?v=1765438645","width":2000},{"alt":null,"id":26495088984163,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77d9634ced6e7352dc28e51996e78d24ad43a404.webp?v=1765438645"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77d9634ced6e7352dc28e51996e78d24ad43a404.webp?v=1765438645","width":2000},{"alt":null,"id":26495089115235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e117ee3664993bdca06f92c952088984ef2d12b.webp?v=1765438646"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e117ee3664993bdca06f92c952088984ef2d12b.webp?v=1765438646","width":2000},{"alt":null,"id":26495089311843,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb0ae45cbed5cc93a0b8752d8ddc5be03b6b53e1.webp?v=1765438646"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb0ae45cbed5cc93a0b8752d8ddc5be03b6b53e1.webp?v=1765438646","width":2000},{"alt":null,"id":26495089475683,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e5b34bd8526922ad01dae0774dd5ee8f95e2194.webp?v=1765438647"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e5b34bd8526922ad01dae0774dd5ee8f95e2194.webp?v=1765438647","width":2000},{"alt":null,"id":26495089639523,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc5d41d8d1d6c12fd72de45772ec31287da8b.webp?v=1765438647"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc5d41d8d1d6c12fd72de45772ec31287da8b.webp?v=1765438647","width":2000},{"alt":null,"id":26495089770595,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1b9cbcc59c28b33b65221921a7724ee7603c052.webp?v=1765438648"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1b9cbcc59c28b33b65221921a7724ee7603c052.webp?v=1765438648","width":2000},{"alt":null,"id":26495089836131,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6d5627c58c1b7be1016231a583b0e63900f3046.webp?v=1765438648"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e6d5627c58c1b7be1016231a583b0e63900f3046.webp?v=1765438648","width":2000},{"alt":null,"id":26495090032739,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31bf2766cf25778d47f6a3ba1125b5e3c94f9805.webp?v=1765438651"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/31bf2766cf25778d47f6a3ba1125b5e3c94f9805.webp?v=1765438651","width":2000},{"alt":null,"id":26495090196579,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c50fb27ff727ba9daab68abe1e0746ac17825b1e.webp?v=1765438652"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c50fb27ff727ba9daab68abe1e0746ac17825b1e.webp?v=1765438652","width":2000},{"alt":null,"id":26495090458723,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00618c344672ad1da023450990015539d73003ab.webp?v=1765438652"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00618c344672ad1da023450990015539d73003ab.webp?v=1765438652","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":43884064145507,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932717879395,"product_id":7937831010403,"position":7,"created_at":"2025-12-11T15:37:26+08:00","updated_at":"2025-12-11T15:37:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1b9cbcc59c28b33b65221921a7724ee7603c052.webp?v=1765438648","variant_ids":[43884064145507]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495089770595,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1b9cbcc59c28b33b65221921a7724ee7603c052.webp?v=1765438648"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884067455075,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932718338147,"product_id":7937831010403,"position":10,"created_at":"2025-12-11T15:37:29+08:00","updated_at":"2025-12-11T15:37:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c50fb27ff727ba9daab68abe1e0746ac17825b1e.webp?v=1765438652","variant_ids":[43884067455075]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495090196579,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c50fb27ff727ba9daab68abe1e0746ac17825b1e.webp?v=1765438652"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884067618915,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932718600291,"product_id":7937831010403,"position":11,"created_at":"2025-12-11T15:37:30+08:00","updated_at":"2025-12-11T15:37:32+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00618c344672ad1da023450990015539d73003ab.webp?v=1765438652","variant_ids":[43884067618915]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495090458723,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00618c344672ad1da023450990015539d73003ab.webp?v=1765438652"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884067684451,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932717256803,"product_id":7937831010403,"position":3,"created_at":"2025-12-11T15:37:24+08:00","updated_at":"2025-12-11T15:37:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e117ee3664993bdca06f92c952088984ef2d12b.webp?v=1765438646","variant_ids":[43884067684451]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495089115235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e117ee3664993bdca06f92c952088984ef2d12b.webp?v=1765438646"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884067717219,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932717682787,"product_id":7937831010403,"position":6,"created_at":"2025-12-11T15:37:25+08:00","updated_at":"2025-12-11T15:37:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc5d41d8d1d6c12fd72de45772ec31287da8b.webp?v=1765438647","variant_ids":[43884067717219]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495089639523,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/28adc5d41d8d1d6c12fd72de45772ec31287da8b.webp?v=1765438647"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43884064145507,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-XU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34932717879395,"product_id":7937831010403,"position":7,"created_at":"2025-12-11T15:37:26+08:00","updated_at":"2025-12-11T15:37:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1b9cbcc59c28b33b65221921a7724ee7603c052.webp?v=1765438648","variant_ids":[43884064145507]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 進擊的巨人 - 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-XU08","featured_media":{"alt":null,"id":26495089770595,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1b9cbcc59c28b33b65221921a7724ee7603c052.webp?v=1765438648"}},"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: "停產"
}