$product = {"id":7937659994211,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓","handle":"iphone-12-pro-mod-nx-magsafe-cjy01","description":null,"published_at":"2025-12-12T09:31:44+08:00","created_at":"2025-12-11T10:13:58+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-jychoioioi","device-iPhone 12 Pro","merge","reseller-jychoioioi"],"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":43883364122723,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931355943011,"product_id":7937659994211,"position":3,"created_at":"2025-12-11T10:14:03+08:00","updated_at":"2025-12-11T10:14:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80026416dfa06da5f37db182acd5f23581653236.webp?v=1765419245","variant_ids":[43883364122723]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493730095203,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80026416dfa06da5f37db182acd5f23581653236.webp?v=1765419245"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883366383715,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931355877475,"product_id":7937659994211,"position":2,"created_at":"2025-12-11T10:14:02+08:00","updated_at":"2025-12-11T10:14:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59704fde287aa0029e7acb3ec0463278ad8ba3a4.webp?v=1765419244","variant_ids":[43883366383715]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493730029667,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59704fde287aa0029e7acb3ec0463278ad8ba3a4.webp?v=1765419244"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883366416483,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931356041315,"product_id":7937659994211,"position":4,"created_at":"2025-12-11T10:14:03+08:00","updated_at":"2025-12-11T10:14:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0970228218fa9e57158363a392479e42f418c7de.webp?v=1765419245","variant_ids":[43883366416483]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493730193507,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0970228218fa9e57158363a392479e42f418c7de.webp?v=1765419245"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883366547555,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931355779171,"product_id":7937659994211,"position":1,"created_at":"2025-12-11T10:14:02+08:00","updated_at":"2025-12-11T10:14:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ec52af3bf0374ded4ace8fc7751772a730e84d3.webp?v=1765419244","variant_ids":[43883366547555]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493729931363,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ec52af3bf0374ded4ace8fc7751772a730e84d3.webp?v=1765419244"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883366580323,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931358204003,"product_id":7937659994211,"position":11,"created_at":"2025-12-11T10:14:07+08:00","updated_at":"2025-12-11T10:14:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2101b7bf596143c8e1a3b2415835a345456901a5.webp?v=1765419249","variant_ids":[43883366580323]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493732356195,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2101b7bf596143c8e1a3b2415835a345456901a5.webp?v=1765419249"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ec52af3bf0374ded4ace8fc7751772a730e84d3.webp?v=1765419244","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59704fde287aa0029e7acb3ec0463278ad8ba3a4.webp?v=1765419244","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80026416dfa06da5f37db182acd5f23581653236.webp?v=1765419245","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0970228218fa9e57158363a392479e42f418c7de.webp?v=1765419245","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3f8ed6a8ff94dfcfc867f917d41b263cc62a6a.webp?v=1765419246","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c688cd631520cc390e3146ee2b8b431abae8d3f.webp?v=1765419246","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc2427953b782abef4ca8c1a0ef45d0230441f56.webp?v=1765419247","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cee7096c0cb45248f021ffb79aa261dd52ab6d15.webp?v=1765419248","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5131a9d653469cafc894115bf7aaf936e9ef163c.webp?v=1765419248","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a63ce7a85b460008299608413d8823985608d99.webp?v=1765419249","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2101b7bf596143c8e1a3b2415835a345456901a5.webp?v=1765419249"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ec52af3bf0374ded4ace8fc7751772a730e84d3.webp?v=1765419244","options":["color"],"media":[{"alt":null,"id":26493729931363,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ec52af3bf0374ded4ace8fc7751772a730e84d3.webp?v=1765419244"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ec52af3bf0374ded4ace8fc7751772a730e84d3.webp?v=1765419244","width":2000},{"alt":null,"id":26493730029667,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59704fde287aa0029e7acb3ec0463278ad8ba3a4.webp?v=1765419244"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59704fde287aa0029e7acb3ec0463278ad8ba3a4.webp?v=1765419244","width":2000},{"alt":null,"id":26493730095203,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80026416dfa06da5f37db182acd5f23581653236.webp?v=1765419245"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80026416dfa06da5f37db182acd5f23581653236.webp?v=1765419245","width":2000},{"alt":null,"id":26493730193507,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0970228218fa9e57158363a392479e42f418c7de.webp?v=1765419245"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0970228218fa9e57158363a392479e42f418c7de.webp?v=1765419245","width":2000},{"alt":null,"id":26493730291811,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3f8ed6a8ff94dfcfc867f917d41b263cc62a6a.webp?v=1765419246"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3f8ed6a8ff94dfcfc867f917d41b263cc62a6a.webp?v=1765419246","width":2000},{"alt":null,"id":26493730488419,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c688cd631520cc390e3146ee2b8b431abae8d3f.webp?v=1765419246"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8c688cd631520cc390e3146ee2b8b431abae8d3f.webp?v=1765419246","width":2000},{"alt":null,"id":26493730816099,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc2427953b782abef4ca8c1a0ef45d0230441f56.webp?v=1765419247"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc2427953b782abef4ca8c1a0ef45d0230441f56.webp?v=1765419247","width":2000},{"alt":null,"id":26493731242083,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cee7096c0cb45248f021ffb79aa261dd52ab6d15.webp?v=1765419248"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cee7096c0cb45248f021ffb79aa261dd52ab6d15.webp?v=1765419248","width":2000},{"alt":null,"id":26493731700835,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5131a9d653469cafc894115bf7aaf936e9ef163c.webp?v=1765419248"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5131a9d653469cafc894115bf7aaf936e9ef163c.webp?v=1765419248","width":2000},{"alt":null,"id":26493731995747,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a63ce7a85b460008299608413d8823985608d99.webp?v=1765419249"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7a63ce7a85b460008299608413d8823985608d99.webp?v=1765419249","width":2000},{"alt":null,"id":26493732356195,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2101b7bf596143c8e1a3b2415835a345456901a5.webp?v=1765419249"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2101b7bf596143c8e1a3b2415835a345456901a5.webp?v=1765419249","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43883364122723,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931355943011,"product_id":7937659994211,"position":3,"created_at":"2025-12-11T10:14:03+08:00","updated_at":"2025-12-11T10:14:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80026416dfa06da5f37db182acd5f23581653236.webp?v=1765419245","variant_ids":[43883364122723]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493730095203,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80026416dfa06da5f37db182acd5f23581653236.webp?v=1765419245"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883366383715,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931355877475,"product_id":7937659994211,"position":2,"created_at":"2025-12-11T10:14:02+08:00","updated_at":"2025-12-11T10:14:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59704fde287aa0029e7acb3ec0463278ad8ba3a4.webp?v=1765419244","variant_ids":[43883366383715]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493730029667,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/59704fde287aa0029e7acb3ec0463278ad8ba3a4.webp?v=1765419244"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883366416483,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931356041315,"product_id":7937659994211,"position":4,"created_at":"2025-12-11T10:14:03+08:00","updated_at":"2025-12-11T10:14:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0970228218fa9e57158363a392479e42f418c7de.webp?v=1765419245","variant_ids":[43883366416483]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493730193507,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0970228218fa9e57158363a392479e42f418c7de.webp?v=1765419245"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883366547555,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931355779171,"product_id":7937659994211,"position":1,"created_at":"2025-12-11T10:14:02+08:00","updated_at":"2025-12-11T10:14:04+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ec52af3bf0374ded4ace8fc7751772a730e84d3.webp?v=1765419244","variant_ids":[43883366547555]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493729931363,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6ec52af3bf0374ded4ace8fc7751772a730e84d3.webp?v=1765419244"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883366580323,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931358204003,"product_id":7937659994211,"position":11,"created_at":"2025-12-11T10:14:07+08:00","updated_at":"2025-12-11T10:14:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2101b7bf596143c8e1a3b2415835a345456901a5.webp?v=1765419249","variant_ids":[43883366580323]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493732356195,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2101b7bf596143c8e1a3b2415835a345456901a5.webp?v=1765419249"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43883364122723,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CJY01","requires_shipping":true,"taxable":true,"featured_image":{"id":34931355943011,"product_id":7937659994211,"position":3,"created_at":"2025-12-11T10:14:03+08:00","updated_at":"2025-12-11T10:14:05+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80026416dfa06da5f37db182acd5f23581653236.webp?v=1765419245","variant_ids":[43883364122723]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Jin Young Choi 陰陽貓 - 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-CJY01","featured_media":{"alt":null,"id":26493730095203,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80026416dfa06da5f37db182acd5f23581653236.webp?v=1765419245"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}};
$device_handle = null;
$type = "";
var sellingStatus
if ($isMerge) {
$(document).ready(function() {
var productImg = $product.images[0];
var bumperImg = window.getProductImageUrl($defaultVariant.sku.split('-')[0]);
var layers = ($type === 'mod-nx-backplate' || $type === 'mod-backplate')
? [productImg, bumperImg]
: [bumperImg, productImg];
window.mergeProductImages(layers).then(function (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: "停產"
}