$product = {"id":7893864448099,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放","handle":"iphone-12-pro-mod-nx-magsafe-printable-chu08","description":null,"published_at":"2025-10-09T09:23:28+08:00","created_at":"2025-10-07T10:31:25+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-chubbynida","device-iPhone 12 Pro","merge","reseller-chubbynida"],"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":43763561529443,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553295601763,"product_id":7893864448099,"position":5,"created_at":"2025-10-07T10:31:30+08:00","updated_at":"2025-10-07T10:31:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158837aec902625b9dfeeae093f2679e6a850636.webp?v=1759804293","variant_ids":[43763561529443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122943234147,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158837aec902625b9dfeeae093f2679e6a850636.webp?v=1759804293"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763564576867,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553296420963,"product_id":7893864448099,"position":9,"created_at":"2025-10-07T10:31:33+08:00","updated_at":"2025-10-07T10:31:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ede1451ab06495cfe4fbe26504949730965f3b7.webp?v=1759804295","variant_ids":[43763564576867]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122944053347,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ede1451ab06495cfe4fbe26504949730965f3b7.webp?v=1759804295"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763564642403,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553296814179,"product_id":7893864448099,"position":10,"created_at":"2025-10-07T10:31:34+08:00","updated_at":"2025-10-07T10:31:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbefab40772506841f350582b18983be2fc1ec0a.webp?v=1759804296","variant_ids":[43763564642403]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122944446563,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbefab40772506841f350582b18983be2fc1ec0a.webp?v=1759804296"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763564707939,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553296158819,"product_id":7893864448099,"position":8,"created_at":"2025-10-07T10:31:32+08:00","updated_at":"2025-10-07T10:31:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55696dd91d1950b376d70d53208ffcdf0da3e2f7.webp?v=1759804295","variant_ids":[43763564707939]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122943791203,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55696dd91d1950b376d70d53208ffcdf0da3e2f7.webp?v=1759804295"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763564740707,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553295929443,"product_id":7893864448099,"position":7,"created_at":"2025-10-07T10:31:32+08:00","updated_at":"2025-10-07T10:31:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4402b04751be88ff7c0d6f164c09b1b78a191f4.webp?v=1759804294","variant_ids":[43763564740707]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122943561827,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4402b04751be88ff7c0d6f164c09b1b78a191f4.webp?v=1759804294"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66edcf3e0f0ec1993fc9c19894d97866c647a9b8.webp?v=1759804288","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d031f6972abca95d38c5ab0b0649672532ef4389.webp?v=1759804290","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e804b420a50c32d94d758fc413cb6e1e1912c83.webp?v=1759804292","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5d928ca35da6e01607735312774497016aa8db3.webp?v=1759804292","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158837aec902625b9dfeeae093f2679e6a850636.webp?v=1759804293","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3faa93a99caf7f2d759a4616b40375192df7d5b5.webp?v=1759804293","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4402b04751be88ff7c0d6f164c09b1b78a191f4.webp?v=1759804294","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55696dd91d1950b376d70d53208ffcdf0da3e2f7.webp?v=1759804295","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ede1451ab06495cfe4fbe26504949730965f3b7.webp?v=1759804295","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbefab40772506841f350582b18983be2fc1ec0a.webp?v=1759804296","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f672b0e915a7a2cf434956a9c62d9820d8144123.webp?v=1759804297"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66edcf3e0f0ec1993fc9c19894d97866c647a9b8.webp?v=1759804288","options":["color"],"media":[{"alt":null,"id":26122942480483,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66edcf3e0f0ec1993fc9c19894d97866c647a9b8.webp?v=1759804288"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/66edcf3e0f0ec1993fc9c19894d97866c647a9b8.webp?v=1759804288","width":2000},{"alt":null,"id":26122942677091,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d031f6972abca95d38c5ab0b0649672532ef4389.webp?v=1759804290"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d031f6972abca95d38c5ab0b0649672532ef4389.webp?v=1759804290","width":2000},{"alt":null,"id":26122942840931,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e804b420a50c32d94d758fc413cb6e1e1912c83.webp?v=1759804292"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1e804b420a50c32d94d758fc413cb6e1e1912c83.webp?v=1759804292","width":2000},{"alt":null,"id":26122943135843,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5d928ca35da6e01607735312774497016aa8db3.webp?v=1759804292"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e5d928ca35da6e01607735312774497016aa8db3.webp?v=1759804292","width":2000},{"alt":null,"id":26122943234147,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158837aec902625b9dfeeae093f2679e6a850636.webp?v=1759804293"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158837aec902625b9dfeeae093f2679e6a850636.webp?v=1759804293","width":2000},{"alt":null,"id":26122943397987,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3faa93a99caf7f2d759a4616b40375192df7d5b5.webp?v=1759804293"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3faa93a99caf7f2d759a4616b40375192df7d5b5.webp?v=1759804293","width":2000},{"alt":null,"id":26122943561827,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4402b04751be88ff7c0d6f164c09b1b78a191f4.webp?v=1759804294"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4402b04751be88ff7c0d6f164c09b1b78a191f4.webp?v=1759804294","width":2000},{"alt":null,"id":26122943791203,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55696dd91d1950b376d70d53208ffcdf0da3e2f7.webp?v=1759804295"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55696dd91d1950b376d70d53208ffcdf0da3e2f7.webp?v=1759804295","width":2000},{"alt":null,"id":26122944053347,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ede1451ab06495cfe4fbe26504949730965f3b7.webp?v=1759804295"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ede1451ab06495cfe4fbe26504949730965f3b7.webp?v=1759804295","width":2000},{"alt":null,"id":26122944446563,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbefab40772506841f350582b18983be2fc1ec0a.webp?v=1759804296"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbefab40772506841f350582b18983be2fc1ec0a.webp?v=1759804296","width":2000},{"alt":null,"id":26122944643171,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f672b0e915a7a2cf434956a9c62d9820d8144123.webp?v=1759804297"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f672b0e915a7a2cf434956a9c62d9820d8144123.webp?v=1759804297","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43763561529443,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553295601763,"product_id":7893864448099,"position":5,"created_at":"2025-10-07T10:31:30+08:00","updated_at":"2025-10-07T10:31:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158837aec902625b9dfeeae093f2679e6a850636.webp?v=1759804293","variant_ids":[43763561529443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122943234147,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158837aec902625b9dfeeae093f2679e6a850636.webp?v=1759804293"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763564576867,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553296420963,"product_id":7893864448099,"position":9,"created_at":"2025-10-07T10:31:33+08:00","updated_at":"2025-10-07T10:31:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ede1451ab06495cfe4fbe26504949730965f3b7.webp?v=1759804295","variant_ids":[43763564576867]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122944053347,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9ede1451ab06495cfe4fbe26504949730965f3b7.webp?v=1759804295"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763564642403,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553296814179,"product_id":7893864448099,"position":10,"created_at":"2025-10-07T10:31:34+08:00","updated_at":"2025-10-07T10:31:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbefab40772506841f350582b18983be2fc1ec0a.webp?v=1759804296","variant_ids":[43763564642403]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122944446563,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dbefab40772506841f350582b18983be2fc1ec0a.webp?v=1759804296"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763564707939,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553296158819,"product_id":7893864448099,"position":8,"created_at":"2025-10-07T10:31:32+08:00","updated_at":"2025-10-07T10:31:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55696dd91d1950b376d70d53208ffcdf0da3e2f7.webp?v=1759804295","variant_ids":[43763564707939]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122943791203,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/55696dd91d1950b376d70d53208ffcdf0da3e2f7.webp?v=1759804295"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763564740707,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553295929443,"product_id":7893864448099,"position":7,"created_at":"2025-10-07T10:31:32+08:00","updated_at":"2025-10-07T10:31:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4402b04751be88ff7c0d6f164c09b1b78a191f4.webp?v=1759804294","variant_ids":[43763564740707]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122943561827,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4402b04751be88ff7c0d6f164c09b1b78a191f4.webp?v=1759804294"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43763561529443,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CHU08","requires_shipping":true,"taxable":true,"featured_image":{"id":34553295601763,"product_id":7893864448099,"position":5,"created_at":"2025-10-07T10:31:30+08:00","updated_at":"2025-10-07T10:31:33+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158837aec902625b9dfeeae093f2679e6a850636.webp?v=1759804293","variant_ids":[43763561529443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 含苞綻放 - 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-CHU08","featured_media":{"alt":null,"id":26122943234147,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158837aec902625b9dfeeae093f2679e6a850636.webp?v=1759804293"}},"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: "停產"
}