$product = {"id":7848098955363,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo","handle":"iphone-12-pro-mod-nx-magsafe-bumper-crossover-design-fv61","description":null,"published_at":"2025-08-07T09:01:40+08:00","created_at":"2025-08-05T09:49:04+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-hijohnnn","device-iPhone 12 Pro","merge","reseller-hijohnnn"],"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":43563037196387,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288083632227,"product_id":7848098955363,"position":6,"created_at":"2025-08-05T09:49:11+08:00","updated_at":"2025-08-05T09:49:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/923f79badd89f1bc9c157d48d8b88caf0589fb12.webp?v=1754358553","variant_ids":[43563037196387]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888991903843,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/923f79badd89f1bc9c157d48d8b88caf0589fb12.webp?v=1754358553"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43563040047203,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288083894371,"product_id":7848098955363,"position":7,"created_at":"2025-08-05T09:49:11+08:00","updated_at":"2025-08-05T09:49:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9633576fda88bd76e4d9a61a93f03a8ada1e8dbc.webp?v=1754358554","variant_ids":[43563040047203]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888992034915,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9633576fda88bd76e4d9a61a93f03a8ada1e8dbc.webp?v=1754358554"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43563040112739,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288085467235,"product_id":7848098955363,"position":10,"created_at":"2025-08-05T09:49:14+08:00","updated_at":"2025-08-05T09:49:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e09b22973fec05652bfcf26829ef0ef8f797b11.webp?v=1754358556","variant_ids":[43563040112739]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888992559203,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e09b22973fec05652bfcf26829ef0ef8f797b11.webp?v=1754358556"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43563040211043,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288083206243,"product_id":7848098955363,"position":3,"created_at":"2025-08-05T09:49:09+08:00","updated_at":"2025-08-05T09:49:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67dccfdc0e12a1866f037cb01b4eed050392a1e9.webp?v=1754358552","variant_ids":[43563040211043]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888991576163,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67dccfdc0e12a1866f037cb01b4eed050392a1e9.webp?v=1754358552"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43563040309347,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288082485347,"product_id":7848098955363,"position":1,"created_at":"2025-08-05T09:49:08+08:00","updated_at":"2025-08-05T09:49:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef23fd5870e54d993bffc2580b9ab41aa35e344.webp?v=1754358550","variant_ids":[43563040309347]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888991248483,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef23fd5870e54d993bffc2580b9ab41aa35e344.webp?v=1754358550"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef23fd5870e54d993bffc2580b9ab41aa35e344.webp?v=1754358550","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1f0e2a8fbea59b1be791c0ec4961dcbb87445d7.webp?v=1754358550","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67dccfdc0e12a1866f037cb01b4eed050392a1e9.webp?v=1754358552","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e8a0c3c35b2f0b81e655eab097c0971bc20dc7e.webp?v=1754358552","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a6ad32455fadffd25786b0e415fe3178bc25436c.webp?v=1754358553","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/923f79badd89f1bc9c157d48d8b88caf0589fb12.webp?v=1754358553","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9633576fda88bd76e4d9a61a93f03a8ada1e8dbc.webp?v=1754358554","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb520dbab6b96a168151488e6371f421fd374195.webp?v=1754358555","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8db0e5410ca4e7b01d360cf21fea501277c2e0e.webp?v=1754358556","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e09b22973fec05652bfcf26829ef0ef8f797b11.webp?v=1754358556","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6786406d7870c5ab5c92a48cd1b23db9f7ca42d8.webp?v=1754358557"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef23fd5870e54d993bffc2580b9ab41aa35e344.webp?v=1754358550","options":["color"],"media":[{"alt":null,"id":25888991248483,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef23fd5870e54d993bffc2580b9ab41aa35e344.webp?v=1754358550"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef23fd5870e54d993bffc2580b9ab41aa35e344.webp?v=1754358550","width":2000},{"alt":null,"id":25888991412323,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1f0e2a8fbea59b1be791c0ec4961dcbb87445d7.webp?v=1754358550"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e1f0e2a8fbea59b1be791c0ec4961dcbb87445d7.webp?v=1754358550","width":2000},{"alt":null,"id":25888991576163,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67dccfdc0e12a1866f037cb01b4eed050392a1e9.webp?v=1754358552"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67dccfdc0e12a1866f037cb01b4eed050392a1e9.webp?v=1754358552","width":2000},{"alt":null,"id":25888991641699,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e8a0c3c35b2f0b81e655eab097c0971bc20dc7e.webp?v=1754358552"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e8a0c3c35b2f0b81e655eab097c0971bc20dc7e.webp?v=1754358552","width":2000},{"alt":null,"id":25888991772771,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a6ad32455fadffd25786b0e415fe3178bc25436c.webp?v=1754358553"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a6ad32455fadffd25786b0e415fe3178bc25436c.webp?v=1754358553","width":2000},{"alt":null,"id":25888991903843,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/923f79badd89f1bc9c157d48d8b88caf0589fb12.webp?v=1754358553"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/923f79badd89f1bc9c157d48d8b88caf0589fb12.webp?v=1754358553","width":2000},{"alt":null,"id":25888992034915,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9633576fda88bd76e4d9a61a93f03a8ada1e8dbc.webp?v=1754358554"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9633576fda88bd76e4d9a61a93f03a8ada1e8dbc.webp?v=1754358554","width":2000},{"alt":null,"id":25888992264291,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb520dbab6b96a168151488e6371f421fd374195.webp?v=1754358555"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb520dbab6b96a168151488e6371f421fd374195.webp?v=1754358555","width":2000},{"alt":null,"id":25888992395363,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8db0e5410ca4e7b01d360cf21fea501277c2e0e.webp?v=1754358556"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e8db0e5410ca4e7b01d360cf21fea501277c2e0e.webp?v=1754358556","width":2000},{"alt":null,"id":25888992559203,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e09b22973fec05652bfcf26829ef0ef8f797b11.webp?v=1754358556"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e09b22973fec05652bfcf26829ef0ef8f797b11.webp?v=1754358556","width":2000},{"alt":null,"id":25888992788579,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6786406d7870c5ab5c92a48cd1b23db9f7ca42d8.webp?v=1754358557"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6786406d7870c5ab5c92a48cd1b23db9f7ca42d8.webp?v=1754358557","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43563037196387,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288083632227,"product_id":7848098955363,"position":6,"created_at":"2025-08-05T09:49:11+08:00","updated_at":"2025-08-05T09:49:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/923f79badd89f1bc9c157d48d8b88caf0589fb12.webp?v=1754358553","variant_ids":[43563037196387]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888991903843,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/923f79badd89f1bc9c157d48d8b88caf0589fb12.webp?v=1754358553"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43563040047203,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288083894371,"product_id":7848098955363,"position":7,"created_at":"2025-08-05T09:49:11+08:00","updated_at":"2025-08-05T09:49:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9633576fda88bd76e4d9a61a93f03a8ada1e8dbc.webp?v=1754358554","variant_ids":[43563040047203]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888992034915,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9633576fda88bd76e4d9a61a93f03a8ada1e8dbc.webp?v=1754358554"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43563040112739,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288085467235,"product_id":7848098955363,"position":10,"created_at":"2025-08-05T09:49:14+08:00","updated_at":"2025-08-05T09:49:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e09b22973fec05652bfcf26829ef0ef8f797b11.webp?v=1754358556","variant_ids":[43563040112739]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888992559203,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e09b22973fec05652bfcf26829ef0ef8f797b11.webp?v=1754358556"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43563040211043,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288083206243,"product_id":7848098955363,"position":3,"created_at":"2025-08-05T09:49:09+08:00","updated_at":"2025-08-05T09:49:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67dccfdc0e12a1866f037cb01b4eed050392a1e9.webp?v=1754358552","variant_ids":[43563040211043]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888991576163,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/67dccfdc0e12a1866f037cb01b4eed050392a1e9.webp?v=1754358552"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43563040309347,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288082485347,"product_id":7848098955363,"position":1,"created_at":"2025-08-05T09:49:08+08:00","updated_at":"2025-08-05T09:49:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef23fd5870e54d993bffc2580b9ab41aa35e344.webp?v=1754358550","variant_ids":[43563040309347]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888991248483,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2ef23fd5870e54d993bffc2580b9ab41aa35e344.webp?v=1754358550"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43563037196387,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34288083632227,"product_id":7848098955363,"position":6,"created_at":"2025-08-05T09:49:11+08:00","updated_at":"2025-08-05T09:49:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/923f79badd89f1bc9c157d48d8b88caf0589fb12.webp?v=1754358553","variant_ids":[43563037196387]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Peekaboo - 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-FV61","featured_media":{"alt":null,"id":25888991903843,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/923f79badd89f1bc9c157d48d8b88caf0589fb12.webp?v=1754358553"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}};
$device_handle = null;
$brand_handle = null;
$type = "";
var sellingStatus
// 只有設計款(SKU 含 '-')才需要合圖
if ($isMerge && $defaultVariant.sku.includes('-')) {
$(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: "停產"
}