$product = {"id":7848017100899,"title":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds","handle":"iphone-12-pro-mod-nx-magsafe-bumper-crossover-design-fv63","description":null,"published_at":"2025-08-07T09:24:29+08:00","created_at":"2025-08-05T09:35:06+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":43562768433251,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287618654307,"product_id":7848017100899,"position":4,"created_at":"2025-08-05T09:35:12+08:00","updated_at":"2025-08-05T09:35:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/139bac8a0c7062553e991927710b019711c0030b.webp?v=1754357714","variant_ids":[43562768433251]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888758169699,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/139bac8a0c7062553e991927710b019711c0030b.webp?v=1754357714"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562771513443,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287617671267,"product_id":7848017100899,"position":1,"created_at":"2025-08-05T09:35:10+08:00","updated_at":"2025-08-05T09:35:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b027a2068bdf73ac6e2dc1885b746151d6cb0220.webp?v=1754357712","variant_ids":[43562771513443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888757710947,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b027a2068bdf73ac6e2dc1885b746151d6cb0220.webp?v=1754357712"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562771578979,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287619833955,"product_id":7848017100899,"position":8,"created_at":"2025-08-05T09:35:14+08:00","updated_at":"2025-08-05T09:35:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b9a6e3c7350e8e5ed5c0dd065aa93330e24e7d88.webp?v=1754357716","variant_ids":[43562771578979]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888758857827,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b9a6e3c7350e8e5ed5c0dd065aa93330e24e7d88.webp?v=1754357716"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562771677283,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287620194403,"product_id":7848017100899,"position":9,"created_at":"2025-08-05T09:35:15+08:00","updated_at":"2025-08-05T09:35:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5b8c4858c4eec6af8a130499000bea34dc5257e.webp?v=1754357717","variant_ids":[43562771677283]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888758988899,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5b8c4858c4eec6af8a130499000bea34dc5257e.webp?v=1754357717"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562771775587,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287618228323,"product_id":7848017100899,"position":3,"created_at":"2025-08-05T09:35:11+08:00","updated_at":"2025-08-05T09:35:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53ee2e4fe5b06b0c605c46f0a4a2ade014c77079.webp?v=1754357713","variant_ids":[43562771775587]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888758071395,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53ee2e4fe5b06b0c605c46f0a4a2ade014c77079.webp?v=1754357713"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b027a2068bdf73ac6e2dc1885b746151d6cb0220.webp?v=1754357712","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b25700a70bafbdf9258748ab2300e401083b85b.webp?v=1754357713","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53ee2e4fe5b06b0c605c46f0a4a2ade014c77079.webp?v=1754357713","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/139bac8a0c7062553e991927710b019711c0030b.webp?v=1754357714","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb6161425222357b5eb7507747cff312eee45cdb.webp?v=1754357714","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5a17343d4dcd0f513a6dfd5a153562462ba6e4a.webp?v=1754357715","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/191ea41fbc34df588c6c1b55861c5365e8aca3f8.webp?v=1754357716","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b9a6e3c7350e8e5ed5c0dd065aa93330e24e7d88.webp?v=1754357716","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5b8c4858c4eec6af8a130499000bea34dc5257e.webp?v=1754357717","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/282e19c23bcaee91e16f8c5891a8df5ea0d75f11.webp?v=1754357718","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11ab2cc2b415a5055c7d94e6e7f4f2c2da1d9c30.webp?v=1754357718"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b027a2068bdf73ac6e2dc1885b746151d6cb0220.webp?v=1754357712","options":["color"],"media":[{"alt":null,"id":25888757710947,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b027a2068bdf73ac6e2dc1885b746151d6cb0220.webp?v=1754357712"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b027a2068bdf73ac6e2dc1885b746151d6cb0220.webp?v=1754357712","width":2000},{"alt":null,"id":25888757874787,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b25700a70bafbdf9258748ab2300e401083b85b.webp?v=1754357713"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6b25700a70bafbdf9258748ab2300e401083b85b.webp?v=1754357713","width":2000},{"alt":null,"id":25888758071395,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53ee2e4fe5b06b0c605c46f0a4a2ade014c77079.webp?v=1754357713"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53ee2e4fe5b06b0c605c46f0a4a2ade014c77079.webp?v=1754357713","width":2000},{"alt":null,"id":25888758169699,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/139bac8a0c7062553e991927710b019711c0030b.webp?v=1754357714"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/139bac8a0c7062553e991927710b019711c0030b.webp?v=1754357714","width":2000},{"alt":null,"id":25888758366307,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb6161425222357b5eb7507747cff312eee45cdb.webp?v=1754357714"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb6161425222357b5eb7507747cff312eee45cdb.webp?v=1754357714","width":2000},{"alt":null,"id":25888758530147,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5a17343d4dcd0f513a6dfd5a153562462ba6e4a.webp?v=1754357715"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c5a17343d4dcd0f513a6dfd5a153562462ba6e4a.webp?v=1754357715","width":2000},{"alt":null,"id":25888758726755,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/191ea41fbc34df588c6c1b55861c5365e8aca3f8.webp?v=1754357716"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/191ea41fbc34df588c6c1b55861c5365e8aca3f8.webp?v=1754357716","width":2000},{"alt":null,"id":25888758857827,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b9a6e3c7350e8e5ed5c0dd065aa93330e24e7d88.webp?v=1754357716"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b9a6e3c7350e8e5ed5c0dd065aa93330e24e7d88.webp?v=1754357716","width":2000},{"alt":null,"id":25888758988899,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5b8c4858c4eec6af8a130499000bea34dc5257e.webp?v=1754357717"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5b8c4858c4eec6af8a130499000bea34dc5257e.webp?v=1754357717","width":2000},{"alt":null,"id":25888759119971,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/282e19c23bcaee91e16f8c5891a8df5ea0d75f11.webp?v=1754357718"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/282e19c23bcaee91e16f8c5891a8df5ea0d75f11.webp?v=1754357718","width":2000},{"alt":null,"id":25888759349347,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11ab2cc2b415a5055c7d94e6e7f4f2c2da1d9c30.webp?v=1754357718"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/11ab2cc2b415a5055c7d94e6e7f4f2c2da1d9c30.webp?v=1754357718","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43562768433251,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287618654307,"product_id":7848017100899,"position":4,"created_at":"2025-08-05T09:35:12+08:00","updated_at":"2025-08-05T09:35:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/139bac8a0c7062553e991927710b019711c0030b.webp?v=1754357714","variant_ids":[43562768433251]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888758169699,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/139bac8a0c7062553e991927710b019711c0030b.webp?v=1754357714"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562771513443,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"MPB0118569-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287617671267,"product_id":7848017100899,"position":1,"created_at":"2025-08-05T09:35:10+08:00","updated_at":"2025-08-05T09:35:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b027a2068bdf73ac6e2dc1885b746151d6cb0220.webp?v=1754357712","variant_ids":[43562771513443]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888757710947,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b027a2068bdf73ac6e2dc1885b746151d6cb0220.webp?v=1754357712"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562771578979,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0118504-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287619833955,"product_id":7848017100899,"position":8,"created_at":"2025-08-05T09:35:14+08:00","updated_at":"2025-08-05T09:35:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b9a6e3c7350e8e5ed5c0dd065aa93330e24e7d88.webp?v=1754357716","variant_ids":[43562771578979]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888758857827,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b9a6e3c7350e8e5ed5c0dd065aa93330e24e7d88.webp?v=1754357716"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562771677283,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01185J5-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287620194403,"product_id":7848017100899,"position":9,"created_at":"2025-08-05T09:35:15+08:00","updated_at":"2025-08-05T09:35:17+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5b8c4858c4eec6af8a130499000bea34dc5257e.webp?v=1754357717","variant_ids":[43562771677283]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888758988899,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5b8c4858c4eec6af8a130499000bea34dc5257e.webp?v=1754357717"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562771775587,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0118524-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287618228323,"product_id":7848017100899,"position":3,"created_at":"2025-08-05T09:35:11+08:00","updated_at":"2025-08-05T09:35:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53ee2e4fe5b06b0c605c46f0a4a2ade014c77079.webp?v=1754357713","variant_ids":[43562771775587]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888758071395,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/53ee2e4fe5b06b0c605c46f0a4a2ade014c77079.webp?v=1754357713"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43562768433251,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"MPB01185C1-FV63","requires_shipping":true,"taxable":true,"featured_image":{"id":34287618654307,"product_id":7848017100899,"position":4,"created_at":"2025-08-05T09:35:12+08:00","updated_at":"2025-08-05T09:35:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/139bac8a0c7062553e991927710b019711c0030b.webp?v=1754357714","variant_ids":[43562768433251]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX (MagSafe 兼容) 嗨小強 Bread Buds - 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-FV63","featured_media":{"alt":null,"id":25888758169699,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/139bac8a0c7062553e991927710b019711c0030b.webp?v=1754357714"}},"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: "停產"
}