$product = {"id":7921928437859,"title":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻","handle":"iphone-15-pro-max-solidx-hd74","description":null,"published_at":"2025-11-13T09:46:08+08:00","created_at":"2025-11-13T09:26:00+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 15 Pro Max","merge","reseller-incrediville"],"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":43834567065699,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793891463267,"product_id":7921928437859,"position":10,"created_at":"2025-11-13T09:26:11+08:00","updated_at":"2025-11-13T09:26:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4301a6a8240a6f06dcb4bd9f0bf5f04868d8ce1f.webp?v=1762997173","variant_ids":[43834567065699]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359311761507,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4301a6a8240a6f06dcb4bd9f0bf5f04868d8ce1f.webp?v=1762997173"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834567098467,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793890971747,"product_id":7921928437859,"position":8,"created_at":"2025-11-13T09:26:10+08:00","updated_at":"2025-11-13T09:26:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab8d1f6fd702501b606647093e72805bc9171006.webp?v=1762997172","variant_ids":[43834567098467]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359311302755,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab8d1f6fd702501b606647093e72805bc9171006.webp?v=1762997172"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834567131235,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793890644067,"product_id":7921928437859,"position":7,"created_at":"2025-11-13T09:26:09+08:00","updated_at":"2025-11-13T09:26:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50c937d7903b63f367efc23e7acf335a2224df5d.webp?v=1762997171","variant_ids":[43834567131235]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359310942307,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50c937d7903b63f367efc23e7acf335a2224df5d.webp?v=1762997171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834567229539,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793889136739,"product_id":7921928437859,"position":2,"created_at":"2025-11-13T09:26:06+08:00","updated_at":"2025-11-13T09:26:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2361c2d49f743306b7e50acfff7c6621480b0c75.webp?v=1762997168","variant_ids":[43834567229539]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359309467747,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2361c2d49f743306b7e50acfff7c6621480b0c75.webp?v=1762997168"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834567262307,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793889595491,"product_id":7921928437859,"position":4,"created_at":"2025-11-13T09:26:07+08:00","updated_at":"2025-11-13T09:26:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5fc308a9e74ec27f3c3244c0bf82d67ee17faf0.webp?v=1762997169","variant_ids":[43834567262307]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359309926499,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5fc308a9e74ec27f3c3244c0bf82d67ee17faf0.webp?v=1762997169"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d9557d20031620ba86335fe47ac11497abea9835.webp?v=1762997167","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2361c2d49f743306b7e50acfff7c6621480b0c75.webp?v=1762997168","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/998d2a29c14148f611e9dd03fa77ef1287a0ea82.webp?v=1762997168","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5fc308a9e74ec27f3c3244c0bf82d67ee17faf0.webp?v=1762997169","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c104ace7c23b375e0febcbac4c4f2734cb5c1ec2.webp?v=1762997170","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc7f7c40612c24ccfc270c702d613ce07734a62.webp?v=1762997171","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50c937d7903b63f367efc23e7acf335a2224df5d.webp?v=1762997171","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab8d1f6fd702501b606647093e72805bc9171006.webp?v=1762997172","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5faaff4f7dbc7b4550b7f3d275ba79e8e15eeb2.webp?v=1762997173","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4301a6a8240a6f06dcb4bd9f0bf5f04868d8ce1f.webp?v=1762997173"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d9557d20031620ba86335fe47ac11497abea9835.webp?v=1762997167","options":["color"],"media":[{"alt":null,"id":26359309238371,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d9557d20031620ba86335fe47ac11497abea9835.webp?v=1762997167"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d9557d20031620ba86335fe47ac11497abea9835.webp?v=1762997167","width":2000},{"alt":null,"id":26359309467747,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2361c2d49f743306b7e50acfff7c6621480b0c75.webp?v=1762997168"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2361c2d49f743306b7e50acfff7c6621480b0c75.webp?v=1762997168","width":2000},{"alt":null,"id":26359309664355,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/998d2a29c14148f611e9dd03fa77ef1287a0ea82.webp?v=1762997168"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/998d2a29c14148f611e9dd03fa77ef1287a0ea82.webp?v=1762997168","width":2000},{"alt":null,"id":26359309926499,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5fc308a9e74ec27f3c3244c0bf82d67ee17faf0.webp?v=1762997169"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5fc308a9e74ec27f3c3244c0bf82d67ee17faf0.webp?v=1762997169","width":2000},{"alt":null,"id":26359310221411,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c104ace7c23b375e0febcbac4c4f2734cb5c1ec2.webp?v=1762997170"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c104ace7c23b375e0febcbac4c4f2734cb5c1ec2.webp?v=1762997170","width":2000},{"alt":null,"id":26359310516323,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc7f7c40612c24ccfc270c702d613ce07734a62.webp?v=1762997171"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dfc7f7c40612c24ccfc270c702d613ce07734a62.webp?v=1762997171","width":2000},{"alt":null,"id":26359310942307,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50c937d7903b63f367efc23e7acf335a2224df5d.webp?v=1762997171"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50c937d7903b63f367efc23e7acf335a2224df5d.webp?v=1762997171","width":2000},{"alt":null,"id":26359311302755,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab8d1f6fd702501b606647093e72805bc9171006.webp?v=1762997172"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab8d1f6fd702501b606647093e72805bc9171006.webp?v=1762997172","width":2000},{"alt":null,"id":26359311564899,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5faaff4f7dbc7b4550b7f3d275ba79e8e15eeb2.webp?v=1762997173"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5faaff4f7dbc7b4550b7f3d275ba79e8e15eeb2.webp?v=1762997173","width":2000},{"alt":null,"id":26359311761507,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4301a6a8240a6f06dcb4bd9f0bf5f04868d8ce1f.webp?v=1762997173"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4301a6a8240a6f06dcb4bd9f0bf5f04868d8ce1f.webp?v=1762997173","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43834567065699,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793891463267,"product_id":7921928437859,"position":10,"created_at":"2025-11-13T09:26:11+08:00","updated_at":"2025-11-13T09:26:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4301a6a8240a6f06dcb4bd9f0bf5f04868d8ce1f.webp?v=1762997173","variant_ids":[43834567065699]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359311761507,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4301a6a8240a6f06dcb4bd9f0bf5f04868d8ce1f.webp?v=1762997173"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834567098467,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793890971747,"product_id":7921928437859,"position":8,"created_at":"2025-11-13T09:26:10+08:00","updated_at":"2025-11-13T09:26:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab8d1f6fd702501b606647093e72805bc9171006.webp?v=1762997172","variant_ids":[43834567098467]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359311302755,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ab8d1f6fd702501b606647093e72805bc9171006.webp?v=1762997172"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834567131235,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793890644067,"product_id":7921928437859,"position":7,"created_at":"2025-11-13T09:26:09+08:00","updated_at":"2025-11-13T09:26:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50c937d7903b63f367efc23e7acf335a2224df5d.webp?v=1762997171","variant_ids":[43834567131235]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359310942307,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/50c937d7903b63f367efc23e7acf335a2224df5d.webp?v=1762997171"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834567229539,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793889136739,"product_id":7921928437859,"position":2,"created_at":"2025-11-13T09:26:06+08:00","updated_at":"2025-11-13T09:26:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2361c2d49f743306b7e50acfff7c6621480b0c75.webp?v=1762997168","variant_ids":[43834567229539]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359309467747,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2361c2d49f743306b7e50acfff7c6621480b0c75.webp?v=1762997168"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43834567262307,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793889595491,"product_id":7921928437859,"position":4,"created_at":"2025-11-13T09:26:07+08:00","updated_at":"2025-11-13T09:26:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5fc308a9e74ec27f3c3244c0bf82d67ee17faf0.webp?v=1762997169","variant_ids":[43834567262307]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359309926499,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f5fc308a9e74ec27f3c3244c0bf82d67ee17faf0.webp?v=1762997169"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43834567065699,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-HD74","requires_shipping":true,"taxable":true,"featured_image":{"id":34793891463267,"product_id":7921928437859,"position":10,"created_at":"2025-11-13T09:26:11+08:00","updated_at":"2025-11-13T09:26:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4301a6a8240a6f06dcb4bd9f0bf5f04868d8ce1f.webp?v=1762997173","variant_ids":[43834567065699]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 阿媽家的吻 - 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-HD74","featured_media":{"alt":null,"id":26359311761507,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4301a6a8240a6f06dcb4bd9f0bf5f04868d8ce1f.webp?v=1762997173"}},"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: "停產"
}