$product = {"id":7967221481571,"title":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔","handle":"iphone-16-plus-mod-nx-sd05","description":null,"published_at":"2026-02-26T15:43:28+08:00","created_at":"2026-02-23T12:26:20+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-the-mandalorian","device-iPhone 16 Plus","merge","reseller-the-mandalorian"],"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":44016672473187,"title":"Platinum Gray","option1":"Platinum Gray","option2":null,"option3":null,"sku":"NPB01326C0-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324959326307,"product_id":7967221481571,"position":3,"created_at":"2026-02-23T12:26:39+08:00","updated_at":"2026-02-23T12:26:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33578ad5374b32418d3bfa50879e2e0f938a1f99.webp?v=1771820801","variant_ids":[44016672473187]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Platinum Gray","public_title":"Platinum Gray","options":["Platinum Gray"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01326C0-SD05","featured_media":{"alt":null,"id":26868777517155,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33578ad5374b32418d3bfa50879e2e0f938a1f99.webp?v=1771820801"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44016680894563,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01326C1-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324960440419,"product_id":7967221481571,"position":6,"created_at":"2026-02-23T12:26:41+08:00","updated_at":"2026-02-23T12:26:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/491a4b8dd32b3fae671a04d95bf6fbec24c70d78.webp?v=1771820803","variant_ids":[44016680894563]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01326C1-SD05","featured_media":{"alt":null,"id":26868778631267,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/491a4b8dd32b3fae671a04d95bf6fbec24c70d78.webp?v=1771820803"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44016681582691,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01326J5-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324959621219,"product_id":7967221481571,"position":4,"created_at":"2026-02-23T12:26:40+08:00","updated_at":"2026-02-23T12:26:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1af4a947bc1ae588ad2f93d1c991c2e03952a876.webp?v=1771820801","variant_ids":[44016681582691]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - 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":"NPB01326J5-SD05","featured_media":{"alt":null,"id":26868777812067,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1af4a947bc1ae588ad2f93d1c991c2e03952a876.webp?v=1771820801"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44016681877603,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0132624-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324960014435,"product_id":7967221481571,"position":5,"created_at":"2026-02-23T12:26:40+08:00","updated_at":"2026-02-23T12:26:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db2c7f3db4a421c371378571dcaf4155ec2b50ca.webp?v=1771820802","variant_ids":[44016681877603]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0132624-SD05","featured_media":{"alt":null,"id":26868778238051,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db2c7f3db4a421c371378571dcaf4155ec2b50ca.webp?v=1771820802"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44016682238051,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0132657-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324958539875,"product_id":7967221481571,"position":1,"created_at":"2026-02-23T12:26:38+08:00","updated_at":"2026-02-23T12:26:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e891c6c0aaddae3a4e0d0d458f2b1b9dec43512f.webp?v=1771820800","variant_ids":[44016682238051]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0132657-SD05","featured_media":{"alt":null,"id":26868776763491,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e891c6c0aaddae3a4e0d0d458f2b1b9dec43512f.webp?v=1771820800"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44016682696803,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0132669-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324958933091,"product_id":7967221481571,"position":2,"created_at":"2026-02-23T12:26:39+08:00","updated_at":"2026-02-23T12:26:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a90cd11dc23c008975a25001439e3718e9133cb6.webp?v=1771820800","variant_ids":[44016682696803]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0132669-SD05","featured_media":{"alt":null,"id":26868777123939,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a90cd11dc23c008975a25001439e3718e9133cb6.webp?v=1771820800"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e891c6c0aaddae3a4e0d0d458f2b1b9dec43512f.webp?v=1771820800","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a90cd11dc23c008975a25001439e3718e9133cb6.webp?v=1771820800","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33578ad5374b32418d3bfa50879e2e0f938a1f99.webp?v=1771820801","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1af4a947bc1ae588ad2f93d1c991c2e03952a876.webp?v=1771820801","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db2c7f3db4a421c371378571dcaf4155ec2b50ca.webp?v=1771820802","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/491a4b8dd32b3fae671a04d95bf6fbec24c70d78.webp?v=1771820803"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e891c6c0aaddae3a4e0d0d458f2b1b9dec43512f.webp?v=1771820800","options":["color"],"media":[{"alt":null,"id":26868776763491,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e891c6c0aaddae3a4e0d0d458f2b1b9dec43512f.webp?v=1771820800"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e891c6c0aaddae3a4e0d0d458f2b1b9dec43512f.webp?v=1771820800","width":2000},{"alt":null,"id":26868777123939,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a90cd11dc23c008975a25001439e3718e9133cb6.webp?v=1771820800"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a90cd11dc23c008975a25001439e3718e9133cb6.webp?v=1771820800","width":2000},{"alt":null,"id":26868777517155,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33578ad5374b32418d3bfa50879e2e0f938a1f99.webp?v=1771820801"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33578ad5374b32418d3bfa50879e2e0f938a1f99.webp?v=1771820801","width":2000},{"alt":null,"id":26868777812067,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1af4a947bc1ae588ad2f93d1c991c2e03952a876.webp?v=1771820801"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1af4a947bc1ae588ad2f93d1c991c2e03952a876.webp?v=1771820801","width":2000},{"alt":null,"id":26868778238051,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db2c7f3db4a421c371378571dcaf4155ec2b50ca.webp?v=1771820802"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db2c7f3db4a421c371378571dcaf4155ec2b50ca.webp?v=1771820802","width":2000},{"alt":null,"id":26868778631267,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/491a4b8dd32b3fae671a04d95bf6fbec24c70d78.webp?v=1771820803"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/491a4b8dd32b3fae671a04d95bf6fbec24c70d78.webp?v=1771820803","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":44016672473187,"title":"Platinum Gray","option1":"Platinum Gray","option2":null,"option3":null,"sku":"NPB01326C0-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324959326307,"product_id":7967221481571,"position":3,"created_at":"2026-02-23T12:26:39+08:00","updated_at":"2026-02-23T12:26:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33578ad5374b32418d3bfa50879e2e0f938a1f99.webp?v=1771820801","variant_ids":[44016672473187]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Platinum Gray","public_title":"Platinum Gray","options":["Platinum Gray"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01326C0-SD05","featured_media":{"alt":null,"id":26868777517155,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33578ad5374b32418d3bfa50879e2e0f938a1f99.webp?v=1771820801"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44016680894563,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01326C1-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324960440419,"product_id":7967221481571,"position":6,"created_at":"2026-02-23T12:26:41+08:00","updated_at":"2026-02-23T12:26:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/491a4b8dd32b3fae671a04d95bf6fbec24c70d78.webp?v=1771820803","variant_ids":[44016680894563]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01326C1-SD05","featured_media":{"alt":null,"id":26868778631267,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/491a4b8dd32b3fae671a04d95bf6fbec24c70d78.webp?v=1771820803"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44016681582691,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01326J5-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324959621219,"product_id":7967221481571,"position":4,"created_at":"2026-02-23T12:26:40+08:00","updated_at":"2026-02-23T12:26:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1af4a947bc1ae588ad2f93d1c991c2e03952a876.webp?v=1771820801","variant_ids":[44016681582691]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - 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":"NPB01326J5-SD05","featured_media":{"alt":null,"id":26868777812067,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1af4a947bc1ae588ad2f93d1c991c2e03952a876.webp?v=1771820801"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44016681877603,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0132624-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324960014435,"product_id":7967221481571,"position":5,"created_at":"2026-02-23T12:26:40+08:00","updated_at":"2026-02-23T12:26:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db2c7f3db4a421c371378571dcaf4155ec2b50ca.webp?v=1771820802","variant_ids":[44016681877603]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0132624-SD05","featured_media":{"alt":null,"id":26868778238051,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/db2c7f3db4a421c371378571dcaf4155ec2b50ca.webp?v=1771820802"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44016682238051,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0132657-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324958539875,"product_id":7967221481571,"position":1,"created_at":"2026-02-23T12:26:38+08:00","updated_at":"2026-02-23T12:26:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e891c6c0aaddae3a4e0d0d458f2b1b9dec43512f.webp?v=1771820800","variant_ids":[44016682238051]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0132657-SD05","featured_media":{"alt":null,"id":26868776763491,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e891c6c0aaddae3a4e0d0d458f2b1b9dec43512f.webp?v=1771820800"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44016682696803,"title":"Graphite","option1":"Graphite","option2":null,"option3":null,"sku":"NPB0132669-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324958933091,"product_id":7967221481571,"position":2,"created_at":"2026-02-23T12:26:39+08:00","updated_at":"2026-02-23T12:26:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a90cd11dc23c008975a25001439e3718e9133cb6.webp?v=1771820800","variant_ids":[44016682696803]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Graphite","public_title":"Graphite","options":["Graphite"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0132669-SD05","featured_media":{"alt":null,"id":26868777123939,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a90cd11dc23c008975a25001439e3718e9133cb6.webp?v=1771820800"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":44016672473187,"title":"Platinum Gray","option1":"Platinum Gray","option2":null,"option3":null,"sku":"NPB01326C0-SD05","requires_shipping":true,"taxable":true,"featured_image":{"id":35324959326307,"product_id":7967221481571,"position":3,"created_at":"2026-02-23T12:26:39+08:00","updated_at":"2026-02-23T12:26:41+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33578ad5374b32418d3bfa50879e2e0f938a1f99.webp?v=1771820801","variant_ids":[44016672473187]},"available":true,"name":"iPhone 16 Plus Mod NX 曼達洛人 曼多 — 頭盔 - Platinum Gray","public_title":"Platinum Gray","options":["Platinum Gray"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01326C0-SD05","featured_media":{"alt":null,"id":26868777517155,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/33578ad5374b32418d3bfa50879e2e0f938a1f99.webp?v=1771820801"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}};
$device_handle = null
var sellingStatus
if ($bumper) {
$(document).ready(function() {
var productImg = $product.images[0]
var bumperVariants = $bumper.variants;
var bumperColors = new Object();
var currentVariant = '';
var productType = '';
bumperVariants.forEach(variant => {
bumperColors[`${variant.title.split(' (')[0].toLowerCase()}`] = variant.featured_image.src;
});
if (productType === 'mod-nx-backplate' || productType === 'mod-backplate') {
mergeImages(
[productImg, bumperColors[currentVariant]],
{ crossOrigin: 'anonymous' }
).then(mergedImg => {
$('.merged-img').attr('src', mergedImg);
});
} else {
mergeImages(
[bumperColors[currentVariant], productImg],
{ crossOrigin: 'anonymous' }
).then(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: "停產"
}