$product = {"id":7937774583907,"title":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章","handle":"iphone-12-pro-mod-nx-xu16","description":null,"published_at":"2025-12-12T11:03:30+08:00","created_at":"2025-12-11T15:23:34+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-attack-on-titan","device-iPhone 12 Pro","merge","reseller-attack-on-titan"],"price":90000,"price_min":90000,"price_max":90000,"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":43883842797667,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932475330659,"product_id":7937774583907,"position":9,"created_at":"2025-12-11T15:23:43+08:00","updated_at":"2025-12-11T15:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dc36cf2ff7de2a8c29c40bd49b2ccdfd3173bb8.webp?v=1765437824","variant_ids":[43883842797667]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-XU16","featured_media":{"alt":null,"id":26494847287395,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dc36cf2ff7de2a8c29c40bd49b2ccdfd3173bb8.webp?v=1765437824"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883846008931,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932475101283,"product_id":7937774583907,"position":7,"created_at":"2025-12-11T15:23:42+08:00","updated_at":"2025-12-11T15:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86076257feb113da0d290ca5430dbf6d5077f88.webp?v=1765437824","variant_ids":[43883846008931]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118569-XU16","featured_media":{"alt":null,"id":26494847058019,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86076257feb113da0d290ca5430dbf6d5077f88.webp?v=1765437824"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883846172771,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932475232355,"product_id":7937774583907,"position":8,"created_at":"2025-12-11T15:23:42+08:00","updated_at":"2025-12-11T15:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/316627bc129d5971f3e2a33eb2832670d7fa0344.webp?v=1765437824","variant_ids":[43883846172771]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118524-XU16","featured_media":{"alt":null,"id":26494847189091,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/316627bc129d5971f3e2a33eb2832670d7fa0344.webp?v=1765437824"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883846238307,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932474413155,"product_id":7937774583907,"position":2,"created_at":"2025-12-11T15:23:39+08:00","updated_at":"2025-12-11T15:23:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce0d3253360f527dbb17ccd512b30bff91001c05.webp?v=1765437820","variant_ids":[43883846238307]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118504-XU16","featured_media":{"alt":null,"id":26494846271587,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce0d3253360f527dbb17ccd512b30bff91001c05.webp?v=1765437820"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883846271075,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932474904675,"product_id":7937774583907,"position":5,"created_at":"2025-12-11T15:23:41+08:00","updated_at":"2025-12-11T15:23:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e93e418e5f812e55b33b99e5774c2e45967b6851.webp?v=1765437823","variant_ids":[43883846271075]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185J5-XU16","featured_media":{"alt":null,"id":26494846763107,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e93e418e5f812e55b33b99e5774c2e45967b6851.webp?v=1765437823"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeb074fc145afa2352656b6b14f56de858c28060.webp?v=1765437820","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce0d3253360f527dbb17ccd512b30bff91001c05.webp?v=1765437820","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1795ae024730d3d8f53ec0f0a1ef4d98a4e63730.webp?v=1765437822","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e8753f7550111681dbd5080a79381b4e2f0a934.webp?v=1765437822","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e93e418e5f812e55b33b99e5774c2e45967b6851.webp?v=1765437823","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b3d89324a941debe34f433eddaf3273613940ab.webp?v=1765437823","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86076257feb113da0d290ca5430dbf6d5077f88.webp?v=1765437824","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/316627bc129d5971f3e2a33eb2832670d7fa0344.webp?v=1765437824","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dc36cf2ff7de2a8c29c40bd49b2ccdfd3173bb8.webp?v=1765437824","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee57c79631a7bce18bee9c429623f91de4bb20bf.webp?v=1765437825","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/919f771fdf9be3803c2f96e1d59997cbcd15ce6a.webp?v=1765437826"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeb074fc145afa2352656b6b14f56de858c28060.webp?v=1765437820","options":["color"],"media":[{"alt":null,"id":26494846173283,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeb074fc145afa2352656b6b14f56de858c28060.webp?v=1765437820"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aeb074fc145afa2352656b6b14f56de858c28060.webp?v=1765437820","width":2000},{"alt":null,"id":26494846271587,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce0d3253360f527dbb17ccd512b30bff91001c05.webp?v=1765437820"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce0d3253360f527dbb17ccd512b30bff91001c05.webp?v=1765437820","width":2000},{"alt":null,"id":26494846402659,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1795ae024730d3d8f53ec0f0a1ef4d98a4e63730.webp?v=1765437822"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1795ae024730d3d8f53ec0f0a1ef4d98a4e63730.webp?v=1765437822","width":2000},{"alt":null,"id":26494846632035,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e8753f7550111681dbd5080a79381b4e2f0a934.webp?v=1765437822"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e8753f7550111681dbd5080a79381b4e2f0a934.webp?v=1765437822","width":2000},{"alt":null,"id":26494846763107,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e93e418e5f812e55b33b99e5774c2e45967b6851.webp?v=1765437823"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e93e418e5f812e55b33b99e5774c2e45967b6851.webp?v=1765437823","width":2000},{"alt":null,"id":26494846959715,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b3d89324a941debe34f433eddaf3273613940ab.webp?v=1765437823"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3b3d89324a941debe34f433eddaf3273613940ab.webp?v=1765437823","width":2000},{"alt":null,"id":26494847058019,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86076257feb113da0d290ca5430dbf6d5077f88.webp?v=1765437824"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86076257feb113da0d290ca5430dbf6d5077f88.webp?v=1765437824","width":2000},{"alt":null,"id":26494847189091,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/316627bc129d5971f3e2a33eb2832670d7fa0344.webp?v=1765437824"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/316627bc129d5971f3e2a33eb2832670d7fa0344.webp?v=1765437824","width":2000},{"alt":null,"id":26494847287395,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dc36cf2ff7de2a8c29c40bd49b2ccdfd3173bb8.webp?v=1765437824"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dc36cf2ff7de2a8c29c40bd49b2ccdfd3173bb8.webp?v=1765437824","width":2000},{"alt":null,"id":26494847451235,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee57c79631a7bce18bee9c429623f91de4bb20bf.webp?v=1765437825"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee57c79631a7bce18bee9c429623f91de4bb20bf.webp?v=1765437825","width":2000},{"alt":null,"id":26494847615075,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/919f771fdf9be3803c2f96e1d59997cbcd15ce6a.webp?v=1765437826"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/919f771fdf9be3803c2f96e1d59997cbcd15ce6a.webp?v=1765437826","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43883842797667,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932475330659,"product_id":7937774583907,"position":9,"created_at":"2025-12-11T15:23:43+08:00","updated_at":"2025-12-11T15:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dc36cf2ff7de2a8c29c40bd49b2ccdfd3173bb8.webp?v=1765437824","variant_ids":[43883842797667]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-XU16","featured_media":{"alt":null,"id":26494847287395,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dc36cf2ff7de2a8c29c40bd49b2ccdfd3173bb8.webp?v=1765437824"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883846008931,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0118569-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932475101283,"product_id":7937774583907,"position":7,"created_at":"2025-12-11T15:23:42+08:00","updated_at":"2025-12-11T15:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86076257feb113da0d290ca5430dbf6d5077f88.webp?v=1765437824","variant_ids":[43883846008931]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118569-XU16","featured_media":{"alt":null,"id":26494847058019,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86076257feb113da0d290ca5430dbf6d5077f88.webp?v=1765437824"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883846172771,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0118524-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932475232355,"product_id":7937774583907,"position":8,"created_at":"2025-12-11T15:23:42+08:00","updated_at":"2025-12-11T15:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/316627bc129d5971f3e2a33eb2832670d7fa0344.webp?v=1765437824","variant_ids":[43883846172771]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118524-XU16","featured_media":{"alt":null,"id":26494847189091,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/316627bc129d5971f3e2a33eb2832670d7fa0344.webp?v=1765437824"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883846238307,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0118504-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932474413155,"product_id":7937774583907,"position":2,"created_at":"2025-12-11T15:23:39+08:00","updated_at":"2025-12-11T15:23:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce0d3253360f527dbb17ccd512b30bff91001c05.webp?v=1765437820","variant_ids":[43883846238307]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0118504-XU16","featured_media":{"alt":null,"id":26494846271587,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ce0d3253360f527dbb17ccd512b30bff91001c05.webp?v=1765437820"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43883846271075,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01185J5-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932474904675,"product_id":7937774583907,"position":5,"created_at":"2025-12-11T15:23:41+08:00","updated_at":"2025-12-11T15:23:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e93e418e5f812e55b33b99e5774c2e45967b6851.webp?v=1765437823","variant_ids":[43883846271075]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185J5-XU16","featured_media":{"alt":null,"id":26494846763107,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e93e418e5f812e55b33b99e5774c2e45967b6851.webp?v=1765437823"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43883842797667,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01185C1-XU16","requires_shipping":true,"taxable":true,"featured_image":{"id":34932475330659,"product_id":7937774583907,"position":9,"created_at":"2025-12-11T15:23:43+08:00","updated_at":"2025-12-11T15:23:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dc36cf2ff7de2a8c29c40bd49b2ccdfd3173bb8.webp?v=1765437824","variant_ids":[43883842797667]},"available":true,"name":"iPhone 12 \/ 12 Pro Mod NX 進擊的巨人 Attack on Titan 自由之翼小徽章 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01185C1-XU16","featured_media":{"alt":null,"id":26494847287395,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1dc36cf2ff7de2a8c29c40bd49b2ccdfd3173bb8.webp?v=1765437824"}},"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: "停產"
}