$product = {"id":7823747874915,"title":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格","handle":"iphone-15-pro-max-solidx-it05","description":null,"published_at":"2025-07-01T19:22:26+08:00","created_at":"2025-06-20T10:21:06+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-godgwawa","device-iPhone 15 Pro Max","merge","reseller-godgwawa"],"price":125000,"price_min":125000,"price_max":125000,"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":43472634413155,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628133987,"product_id":7823747874915,"position":5,"created_at":"2026-03-09T11:35:36+08:00","updated_at":"2026-03-09T11:35:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22f3e794f85f9a42a0000cc929a2bebb872392f0.webp?v=1773027338","variant_ids":[43472634413155]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-IT05","featured_media":{"alt":null,"id":26958806679651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22f3e794f85f9a42a0000cc929a2bebb872392f0.webp?v=1773027338"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472639393891,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416629051491,"product_id":7823747874915,"position":8,"created_at":"2026-03-09T11:35:38+08:00","updated_at":"2026-03-09T11:35:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76c8a5d3dc72b13adc5fcf611ecc52e511c51624.webp?v=1773027340","variant_ids":[43472639393891]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-IT05","featured_media":{"alt":null,"id":26958807597155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76c8a5d3dc72b13adc5fcf611ecc52e511c51624.webp?v=1773027340"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472639492195,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628396131,"product_id":7823747874915,"position":6,"created_at":"2026-03-09T11:35:37+08:00","updated_at":"2026-03-09T11:35:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/163a06a1f60a48e79700832ac355cb0a1864a6f0.webp?v=1773027339","variant_ids":[43472639492195]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-IT05","featured_media":{"alt":null,"id":26958806941795,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/163a06a1f60a48e79700832ac355cb0a1864a6f0.webp?v=1773027339"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472639524963,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628723811,"product_id":7823747874915,"position":7,"created_at":"2026-03-09T11:35:38+08:00","updated_at":"2026-03-09T11:35:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/196dc11fe4fd2c1e3da77d04e74d0f67bed06dd7.webp?v=1773027339","variant_ids":[43472639524963]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-IT05","featured_media":{"alt":null,"id":26958807269475,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/196dc11fe4fd2c1e3da77d04e74d0f67bed06dd7.webp?v=1773027339"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43494029328483,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416629346403,"product_id":7823747874915,"position":9,"created_at":"2026-03-09T11:35:39+08:00","updated_at":"2026-03-09T11:35:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bbd0e6180aebf92be3dac9cda5c6bf2f03a78e4.webp?v=1773027341","variant_ids":[43494029328483]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-IT05","featured_media":{"alt":null,"id":26958807892067,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bbd0e6180aebf92be3dac9cda5c6bf2f03a78e4.webp?v=1773027341"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-IT05.png?v=1750386070","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-IT05_59f7b34d-b380-42f3-8b9c-89e2b8d61752.png?v=1750831411","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/255946bd9eb6d702beb3974e7ffffc38beb068b1.webp?v=1773027337","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4170338c792eaa92dabe820661aecbf5f1bcf761.webp?v=1773027338","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22f3e794f85f9a42a0000cc929a2bebb872392f0.webp?v=1773027338","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/163a06a1f60a48e79700832ac355cb0a1864a6f0.webp?v=1773027339","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/196dc11fe4fd2c1e3da77d04e74d0f67bed06dd7.webp?v=1773027339","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76c8a5d3dc72b13adc5fcf611ecc52e511c51624.webp?v=1773027340","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bbd0e6180aebf92be3dac9cda5c6bf2f03a78e4.webp?v=1773027341","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c7a89a321de7f658950351d0747e1570d19e326.webp?v=1773027341","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5be3bd6b178d1a09ede8b6fe12195b043644a035.webp?v=1773027342"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-IT05.png?v=1750386070","options":["color"],"media":[{"alt":null,"id":25720301060195,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-IT05.png?v=1750386070"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-298-IT05.png?v=1750386070","width":2000},{"alt":null,"id":25736181842019,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-IT05_59f7b34d-b380-42f3-8b9c-89e2b8d61752.png?v=1750831411"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidX-52-295-IT05_59f7b34d-b380-42f3-8b9c-89e2b8d61752.png?v=1750831411","width":2000},{"alt":null,"id":26958805925987,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/255946bd9eb6d702beb3974e7ffffc38beb068b1.webp?v=1773027337"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/255946bd9eb6d702beb3974e7ffffc38beb068b1.webp?v=1773027337","width":2000},{"alt":null,"id":26958806286435,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4170338c792eaa92dabe820661aecbf5f1bcf761.webp?v=1773027338"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4170338c792eaa92dabe820661aecbf5f1bcf761.webp?v=1773027338","width":2000},{"alt":null,"id":26958806679651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22f3e794f85f9a42a0000cc929a2bebb872392f0.webp?v=1773027338"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22f3e794f85f9a42a0000cc929a2bebb872392f0.webp?v=1773027338","width":2000},{"alt":null,"id":26958806941795,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/163a06a1f60a48e79700832ac355cb0a1864a6f0.webp?v=1773027339"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/163a06a1f60a48e79700832ac355cb0a1864a6f0.webp?v=1773027339","width":2000},{"alt":null,"id":26958807269475,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/196dc11fe4fd2c1e3da77d04e74d0f67bed06dd7.webp?v=1773027339"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/196dc11fe4fd2c1e3da77d04e74d0f67bed06dd7.webp?v=1773027339","width":2000},{"alt":null,"id":26958807597155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76c8a5d3dc72b13adc5fcf611ecc52e511c51624.webp?v=1773027340"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76c8a5d3dc72b13adc5fcf611ecc52e511c51624.webp?v=1773027340","width":2000},{"alt":null,"id":26958807892067,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bbd0e6180aebf92be3dac9cda5c6bf2f03a78e4.webp?v=1773027341"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bbd0e6180aebf92be3dac9cda5c6bf2f03a78e4.webp?v=1773027341","width":2000},{"alt":null,"id":26958808318051,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c7a89a321de7f658950351d0747e1570d19e326.webp?v=1773027341"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c7a89a321de7f658950351d0747e1570d19e326.webp?v=1773027341","width":2000},{"alt":null,"id":26958808711267,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5be3bd6b178d1a09ede8b6fe12195b043644a035.webp?v=1773027342"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5be3bd6b178d1a09ede8b6fe12195b043644a035.webp?v=1773027342","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43472634413155,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628133987,"product_id":7823747874915,"position":5,"created_at":"2026-03-09T11:35:36+08:00","updated_at":"2026-03-09T11:35:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22f3e794f85f9a42a0000cc929a2bebb872392f0.webp?v=1773027338","variant_ids":[43472634413155]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-IT05","featured_media":{"alt":null,"id":26958806679651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22f3e794f85f9a42a0000cc929a2bebb872392f0.webp?v=1773027338"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472639393891,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416629051491,"product_id":7823747874915,"position":8,"created_at":"2026-03-09T11:35:38+08:00","updated_at":"2026-03-09T11:35:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76c8a5d3dc72b13adc5fcf611ecc52e511c51624.webp?v=1773027340","variant_ids":[43472639393891]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-IT05","featured_media":{"alt":null,"id":26958807597155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/76c8a5d3dc72b13adc5fcf611ecc52e511c51624.webp?v=1773027340"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472639492195,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628396131,"product_id":7823747874915,"position":6,"created_at":"2026-03-09T11:35:37+08:00","updated_at":"2026-03-09T11:35:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/163a06a1f60a48e79700832ac355cb0a1864a6f0.webp?v=1773027339","variant_ids":[43472639492195]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-IT05","featured_media":{"alt":null,"id":26958806941795,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/163a06a1f60a48e79700832ac355cb0a1864a6f0.webp?v=1773027339"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43472639524963,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628723811,"product_id":7823747874915,"position":7,"created_at":"2026-03-09T11:35:38+08:00","updated_at":"2026-03-09T11:35:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/196dc11fe4fd2c1e3da77d04e74d0f67bed06dd7.webp?v=1773027339","variant_ids":[43472639524963]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-IT05","featured_media":{"alt":null,"id":26958807269475,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/196dc11fe4fd2c1e3da77d04e74d0f67bed06dd7.webp?v=1773027339"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43494029328483,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416629346403,"product_id":7823747874915,"position":9,"created_at":"2026-03-09T11:35:39+08:00","updated_at":"2026-03-09T11:35:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bbd0e6180aebf92be3dac9cda5c6bf2f03a78e4.webp?v=1773027341","variant_ids":[43494029328483]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-IT05","featured_media":{"alt":null,"id":26958807892067,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1bbd0e6180aebf92be3dac9cda5c6bf2f03a78e4.webp?v=1773027341"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43472634413155,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-IT05","requires_shipping":true,"taxable":true,"featured_image":{"id":35416628133987,"product_id":7823747874915,"position":5,"created_at":"2026-03-09T11:35:36+08:00","updated_at":"2026-03-09T11:35:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22f3e794f85f9a42a0000cc929a2bebb872392f0.webp?v=1773027338","variant_ids":[43472634413155]},"available":true,"name":"iPhone 15 Pro Max SolidX 變種吉娃娃 Godgwawa 頂吉四格 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-IT05","featured_media":{"alt":null,"id":26958806679651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/22f3e794f85f9a42a0000cc929a2bebb872392f0.webp?v=1773027338"}},"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: "停產"
}