$product = {"id":7893805858915,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) Chubbynida 游魚之伴","handle":"iphone-12-pro-mod-nx-magsafe-printable-chu04","description":null,"published_at":"2025-10-09T09:34:15+08:00","created_at":"2025-10-07T10:15:35+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":43763333791843,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553068716131,"product_id":7893805858915,"position":11,"created_at":"2025-10-07T10:15:47+08:00","updated_at":"2025-10-07T10:15:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396f476d5bac52ca415f9d8c9b814f1b3ecf8149.webp?v=1759803349","variant_ids":[43763333791843]},"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-CHU04","featured_media":{"alt":null,"id":26122716414051,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396f476d5bac52ca415f9d8c9b814f1b3ecf8149.webp?v=1759803349"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763338313827,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553066324067,"product_id":7893805858915,"position":1,"created_at":"2025-10-07T10:15:40+08:00","updated_at":"2025-10-07T10:15:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/606a2ec22f589599f5e43b6020058f0c7405bbda.webp?v=1759803342","variant_ids":[43763338313827]},"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-CHU04","featured_media":{"alt":null,"id":26122714021987,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/606a2ec22f589599f5e43b6020058f0c7405bbda.webp?v=1759803342"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763338379363,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553066815587,"product_id":7893805858915,"position":3,"created_at":"2025-10-07T10:15:42+08:00","updated_at":"2025-10-07T10:15:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8eac929e03447bf5996ff6ffe12a0a7499fad37.webp?v=1759803344","variant_ids":[43763338379363]},"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-CHU04","featured_media":{"alt":null,"id":26122714513507,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8eac929e03447bf5996ff6ffe12a0a7499fad37.webp?v=1759803344"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763338444899,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553066979427,"product_id":7893805858915,"position":4,"created_at":"2025-10-07T10:15:42+08:00","updated_at":"2025-10-07T10:15:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30879537b82f26acab58620dae4df1ea35039f37.webp?v=1759803344","variant_ids":[43763338444899]},"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-CHU04","featured_media":{"alt":null,"id":26122714677347,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30879537b82f26acab58620dae4df1ea35039f37.webp?v=1759803344"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763338477667,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553067864163,"product_id":7893805858915,"position":9,"created_at":"2025-10-07T10:15:46+08:00","updated_at":"2025-10-07T10:15:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34d0645b8a2aaa6ebae0e20ef8aac68b3c012b00.webp?v=1759803348","variant_ids":[43763338477667]},"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-CHU04","featured_media":{"alt":null,"id":26122715562083,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34d0645b8a2aaa6ebae0e20ef8aac68b3c012b00.webp?v=1759803348"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/606a2ec22f589599f5e43b6020058f0c7405bbda.webp?v=1759803342","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/199af0731ce3893f64e741fce6f253c43ed96814.webp?v=1759803344","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8eac929e03447bf5996ff6ffe12a0a7499fad37.webp?v=1759803344","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30879537b82f26acab58620dae4df1ea35039f37.webp?v=1759803344","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2df108c004b85cb12141dd75ce88c3a49eb85ca.webp?v=1759803345","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e258713d55cf494416dbe9bac32db70d0642ffdf.webp?v=1759803346","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d52185ac94cae80d948e826e60a5ef20e57edfc8.webp?v=1759803346","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78799b82f79e38812cb8214f59bc8310ac63eaea.webp?v=1759803347","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34d0645b8a2aaa6ebae0e20ef8aac68b3c012b00.webp?v=1759803348","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dabf3a2a4e6da17044a8284a974edf4a0fd4e71.webp?v=1759803349","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396f476d5bac52ca415f9d8c9b814f1b3ecf8149.webp?v=1759803349"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/606a2ec22f589599f5e43b6020058f0c7405bbda.webp?v=1759803342","options":["color"],"media":[{"alt":null,"id":26122714021987,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/606a2ec22f589599f5e43b6020058f0c7405bbda.webp?v=1759803342"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/606a2ec22f589599f5e43b6020058f0c7405bbda.webp?v=1759803342","width":2000},{"alt":null,"id":26122714251363,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/199af0731ce3893f64e741fce6f253c43ed96814.webp?v=1759803344"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/199af0731ce3893f64e741fce6f253c43ed96814.webp?v=1759803344","width":2000},{"alt":null,"id":26122714513507,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8eac929e03447bf5996ff6ffe12a0a7499fad37.webp?v=1759803344"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8eac929e03447bf5996ff6ffe12a0a7499fad37.webp?v=1759803344","width":2000},{"alt":null,"id":26122714677347,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30879537b82f26acab58620dae4df1ea35039f37.webp?v=1759803344"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30879537b82f26acab58620dae4df1ea35039f37.webp?v=1759803344","width":2000},{"alt":null,"id":26122714841187,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2df108c004b85cb12141dd75ce88c3a49eb85ca.webp?v=1759803345"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c2df108c004b85cb12141dd75ce88c3a49eb85ca.webp?v=1759803345","width":2000},{"alt":null,"id":26122714972259,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e258713d55cf494416dbe9bac32db70d0642ffdf.webp?v=1759803346"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e258713d55cf494416dbe9bac32db70d0642ffdf.webp?v=1759803346","width":2000},{"alt":null,"id":26122715103331,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d52185ac94cae80d948e826e60a5ef20e57edfc8.webp?v=1759803346"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d52185ac94cae80d948e826e60a5ef20e57edfc8.webp?v=1759803346","width":2000},{"alt":null,"id":26122715365475,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78799b82f79e38812cb8214f59bc8310ac63eaea.webp?v=1759803347"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78799b82f79e38812cb8214f59bc8310ac63eaea.webp?v=1759803347","width":2000},{"alt":null,"id":26122715562083,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34d0645b8a2aaa6ebae0e20ef8aac68b3c012b00.webp?v=1759803348"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34d0645b8a2aaa6ebae0e20ef8aac68b3c012b00.webp?v=1759803348","width":2000},{"alt":null,"id":26122715725923,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dabf3a2a4e6da17044a8284a974edf4a0fd4e71.webp?v=1759803349"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6dabf3a2a4e6da17044a8284a974edf4a0fd4e71.webp?v=1759803349","width":2000},{"alt":null,"id":26122716414051,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396f476d5bac52ca415f9d8c9b814f1b3ecf8149.webp?v=1759803349"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396f476d5bac52ca415f9d8c9b814f1b3ecf8149.webp?v=1759803349","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43763333791843,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553068716131,"product_id":7893805858915,"position":11,"created_at":"2025-10-07T10:15:47+08:00","updated_at":"2025-10-07T10:15:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396f476d5bac52ca415f9d8c9b814f1b3ecf8149.webp?v=1759803349","variant_ids":[43763333791843]},"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-CHU04","featured_media":{"alt":null,"id":26122716414051,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396f476d5bac52ca415f9d8c9b814f1b3ecf8149.webp?v=1759803349"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763338313827,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553066324067,"product_id":7893805858915,"position":1,"created_at":"2025-10-07T10:15:40+08:00","updated_at":"2025-10-07T10:15:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/606a2ec22f589599f5e43b6020058f0c7405bbda.webp?v=1759803342","variant_ids":[43763338313827]},"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-CHU04","featured_media":{"alt":null,"id":26122714021987,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/606a2ec22f589599f5e43b6020058f0c7405bbda.webp?v=1759803342"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763338379363,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553066815587,"product_id":7893805858915,"position":3,"created_at":"2025-10-07T10:15:42+08:00","updated_at":"2025-10-07T10:15:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8eac929e03447bf5996ff6ffe12a0a7499fad37.webp?v=1759803344","variant_ids":[43763338379363]},"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-CHU04","featured_media":{"alt":null,"id":26122714513507,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8eac929e03447bf5996ff6ffe12a0a7499fad37.webp?v=1759803344"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763338444899,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553066979427,"product_id":7893805858915,"position":4,"created_at":"2025-10-07T10:15:42+08:00","updated_at":"2025-10-07T10:15:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30879537b82f26acab58620dae4df1ea35039f37.webp?v=1759803344","variant_ids":[43763338444899]},"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-CHU04","featured_media":{"alt":null,"id":26122714677347,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30879537b82f26acab58620dae4df1ea35039f37.webp?v=1759803344"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43763338477667,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553067864163,"product_id":7893805858915,"position":9,"created_at":"2025-10-07T10:15:46+08:00","updated_at":"2025-10-07T10:15:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34d0645b8a2aaa6ebae0e20ef8aac68b3c012b00.webp?v=1759803348","variant_ids":[43763338477667]},"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-CHU04","featured_media":{"alt":null,"id":26122715562083,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/34d0645b8a2aaa6ebae0e20ef8aac68b3c012b00.webp?v=1759803348"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43763333791843,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-CHU04","requires_shipping":true,"taxable":true,"featured_image":{"id":34553068716131,"product_id":7893805858915,"position":11,"created_at":"2025-10-07T10:15:47+08:00","updated_at":"2025-10-07T10:15:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396f476d5bac52ca415f9d8c9b814f1b3ecf8149.webp?v=1759803349","variant_ids":[43763333791843]},"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-CHU04","featured_media":{"alt":null,"id":26122716414051,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/396f476d5bac52ca415f9d8c9b814f1b3ecf8149.webp?v=1759803349"}},"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: "停產"
}