$product = {"id":7998381031523,"title":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed","handle":"iphone-14-plus-solidsuit-classic-magsafe-xk36","description":null,"published_at":"2026-04-20T12:00:31+08:00","created_at":"2026-04-20T09:56:19+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nasa","device-iPhone 14 Plus","merge","reseller-nasa"],"price":125000,"price_min":125000,"price_max":125000,"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":44126223925347,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673548030051,"product_id":7998381031523,"position":1,"created_at":"2026-04-20T09:56:45+08:00","updated_at":"2026-04-20T09:56:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/765411d330bbf62a2bc648033a8e4a68a5eb1e09.webp?v=1776650207","variant_ids":[44126223925347]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-XK36","featured_media":{"alt":null,"id":27200819069027,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/765411d330bbf62a2bc648033a8e4a68a5eb1e09.webp?v=1776650207"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126227071075,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST012610D-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673549471843,"product_id":7998381031523,"position":6,"created_at":"2026-04-20T09:56:48+08:00","updated_at":"2026-04-20T09:56:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e2dfb8a01f96e40d1421c258bf58a0aeedfe5cf.webp?v=1776650210","variant_ids":[44126227071075]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Bordeaux Red","public_title":"Bordeaux Red","options":["Bordeaux Red"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610D-XK36","featured_media":{"alt":null,"id":27200820543587,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e2dfb8a01f96e40d1421c258bf58a0aeedfe5cf.webp?v=1776650210"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126227464291,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012610C-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673548947555,"product_id":7998381031523,"position":4,"created_at":"2026-04-20T09:56:47+08:00","updated_at":"2026-04-20T09:56:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45d3dd08452a84e330e3c2542ff5603461643391.webp?v=1776650209","variant_ids":[44126227464291]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610C-XK36","featured_media":{"alt":null,"id":27200820019299,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45d3dd08452a84e330e3c2542ff5603461643391.webp?v=1776650209"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126227759203,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01261O9-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673548324963,"product_id":7998381031523,"position":2,"created_at":"2026-04-20T09:56:46+08:00","updated_at":"2026-04-20T09:56:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55232c4f2c18d0158d39139f9bf9a7af23dbe7f0.webp?v=1776650207","variant_ids":[44126227759203]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01261O9-XK36","featured_media":{"alt":null,"id":27200819396707,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55232c4f2c18d0158d39139f9bf9a7af23dbe7f0.webp?v=1776650207"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126227988579,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MST0126157-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673549176931,"product_id":7998381031523,"position":5,"created_at":"2026-04-20T09:56:47+08:00","updated_at":"2026-04-20T09:56:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aaa5f3c5b31087b131b16086ee1382c0580f31c.webp?v=1776650209","variant_ids":[44126227988579]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126157-XK36","featured_media":{"alt":null,"id":27200820248675,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aaa5f3c5b31087b131b16086ee1382c0580f31c.webp?v=1776650209"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126228217955,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0126152-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673548685411,"product_id":7998381031523,"position":3,"created_at":"2026-04-20T09:56:46+08:00","updated_at":"2026-04-20T09:56:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d52857f1e57b04ec660220090b07f37e5c75f9ac.webp?v=1776650208","variant_ids":[44126228217955]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126152-XK36","featured_media":{"alt":null,"id":27200819724387,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d52857f1e57b04ec660220090b07f37e5c75f9ac.webp?v=1776650208"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/765411d330bbf62a2bc648033a8e4a68a5eb1e09.webp?v=1776650207","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55232c4f2c18d0158d39139f9bf9a7af23dbe7f0.webp?v=1776650207","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d52857f1e57b04ec660220090b07f37e5c75f9ac.webp?v=1776650208","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45d3dd08452a84e330e3c2542ff5603461643391.webp?v=1776650209","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aaa5f3c5b31087b131b16086ee1382c0580f31c.webp?v=1776650209","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e2dfb8a01f96e40d1421c258bf58a0aeedfe5cf.webp?v=1776650210"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/765411d330bbf62a2bc648033a8e4a68a5eb1e09.webp?v=1776650207","options":["color"],"media":[{"alt":null,"id":27200819069027,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/765411d330bbf62a2bc648033a8e4a68a5eb1e09.webp?v=1776650207"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/765411d330bbf62a2bc648033a8e4a68a5eb1e09.webp?v=1776650207","width":2000},{"alt":null,"id":27200819396707,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55232c4f2c18d0158d39139f9bf9a7af23dbe7f0.webp?v=1776650207"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55232c4f2c18d0158d39139f9bf9a7af23dbe7f0.webp?v=1776650207","width":2000},{"alt":null,"id":27200819724387,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d52857f1e57b04ec660220090b07f37e5c75f9ac.webp?v=1776650208"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d52857f1e57b04ec660220090b07f37e5c75f9ac.webp?v=1776650208","width":2000},{"alt":null,"id":27200820019299,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45d3dd08452a84e330e3c2542ff5603461643391.webp?v=1776650209"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45d3dd08452a84e330e3c2542ff5603461643391.webp?v=1776650209","width":2000},{"alt":null,"id":27200820248675,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aaa5f3c5b31087b131b16086ee1382c0580f31c.webp?v=1776650209"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aaa5f3c5b31087b131b16086ee1382c0580f31c.webp?v=1776650209","width":2000},{"alt":null,"id":27200820543587,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e2dfb8a01f96e40d1421c258bf58a0aeedfe5cf.webp?v=1776650210"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e2dfb8a01f96e40d1421c258bf58a0aeedfe5cf.webp?v=1776650210","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":44126223925347,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673548030051,"product_id":7998381031523,"position":1,"created_at":"2026-04-20T09:56:45+08:00","updated_at":"2026-04-20T09:56:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/765411d330bbf62a2bc648033a8e4a68a5eb1e09.webp?v=1776650207","variant_ids":[44126223925347]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-XK36","featured_media":{"alt":null,"id":27200819069027,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/765411d330bbf62a2bc648033a8e4a68a5eb1e09.webp?v=1776650207"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126227071075,"title":"Bordeaux Red","option1":"Bordeaux Red","option2":null,"option3":null,"sku":"MST012610D-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673549471843,"product_id":7998381031523,"position":6,"created_at":"2026-04-20T09:56:48+08:00","updated_at":"2026-04-20T09:56:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e2dfb8a01f96e40d1421c258bf58a0aeedfe5cf.webp?v=1776650210","variant_ids":[44126227071075]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Bordeaux Red","public_title":"Bordeaux Red","options":["Bordeaux Red"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610D-XK36","featured_media":{"alt":null,"id":27200820543587,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e2dfb8a01f96e40d1421c258bf58a0aeedfe5cf.webp?v=1776650210"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126227464291,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012610C-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673548947555,"product_id":7998381031523,"position":4,"created_at":"2026-04-20T09:56:47+08:00","updated_at":"2026-04-20T09:56:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45d3dd08452a84e330e3c2542ff5603461643391.webp?v=1776650209","variant_ids":[44126227464291]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610C-XK36","featured_media":{"alt":null,"id":27200820019299,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45d3dd08452a84e330e3c2542ff5603461643391.webp?v=1776650209"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126227759203,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01261O9-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673548324963,"product_id":7998381031523,"position":2,"created_at":"2026-04-20T09:56:46+08:00","updated_at":"2026-04-20T09:56:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55232c4f2c18d0158d39139f9bf9a7af23dbe7f0.webp?v=1776650207","variant_ids":[44126227759203]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01261O9-XK36","featured_media":{"alt":null,"id":27200819396707,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55232c4f2c18d0158d39139f9bf9a7af23dbe7f0.webp?v=1776650207"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126227988579,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"MST0126157-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673549176931,"product_id":7998381031523,"position":5,"created_at":"2026-04-20T09:56:47+08:00","updated_at":"2026-04-20T09:56:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aaa5f3c5b31087b131b16086ee1382c0580f31c.webp?v=1776650209","variant_ids":[44126227988579]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126157-XK36","featured_media":{"alt":null,"id":27200820248675,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aaa5f3c5b31087b131b16086ee1382c0580f31c.webp?v=1776650209"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126228217955,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0126152-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673548685411,"product_id":7998381031523,"position":3,"created_at":"2026-04-20T09:56:46+08:00","updated_at":"2026-04-20T09:56:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d52857f1e57b04ec660220090b07f37e5c75f9ac.webp?v=1776650208","variant_ids":[44126228217955]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0126152-XK36","featured_media":{"alt":null,"id":27200819724387,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d52857f1e57b04ec660220090b07f37e5c75f9ac.webp?v=1776650208"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":44126223925347,"title":"Neon Orange","option1":"Neon Orange","option2":null,"option3":null,"sku":"MST012610F-XK36","requires_shipping":true,"taxable":true,"featured_image":{"id":35673548030051,"product_id":7998381031523,"position":1,"created_at":"2026-04-20T09:56:45+08:00","updated_at":"2026-04-20T09:56:47+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/765411d330bbf62a2bc648033a8e4a68a5eb1e09.webp?v=1776650207","variant_ids":[44126223925347]},"available":true,"name":"iPhone 14 Plus SolidSuit (MagSafe 兼容) 太空 NASA Space Food Bag - Vacuum Sealed - Neon Orange","public_title":"Neon Orange","options":["Neon Orange"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012610F-XK36","featured_media":{"alt":null,"id":27200819069027,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/765411d330bbf62a2bc648033a8e4a68a5eb1e09.webp?v=1776650207"}},"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: "停產"
}