$product = {"id":7888461955171,"title":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對","handle":"iphone-15-pro-max-solidx-es01","description":null,"published_at":"2025-09-22T17:27:05+08:00","created_at":"2025-09-22T15:49:28+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-annnbrownie","device-iPhone 15 Pro Max","merge","reseller-annnbrownie"],"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":43743208570979,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514514313315,"product_id":7888461955171,"position":4,"created_at":"2025-09-22T15:49:33+08:00","updated_at":"2025-09-22T15:49:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3037809233cd6fd48e127f29978195c304de8065.webp?v=1758527375","variant_ids":[43743208570979]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084956831843,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3037809233cd6fd48e127f29978195c304de8065.webp?v=1758527375"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743208603747,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514515460195,"product_id":7888461955171,"position":10,"created_at":"2025-09-22T15:49:36+08:00","updated_at":"2025-09-22T15:49:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ba4617fa284585399407ea32c5b920597fd33c0.webp?v=1758527378","variant_ids":[43743208603747]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084957978723,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ba4617fa284585399407ea32c5b920597fd33c0.webp?v=1758527378"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743208669283,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514515132515,"product_id":7888461955171,"position":8,"created_at":"2025-09-22T15:49:35+08:00","updated_at":"2025-09-22T15:49:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c9905b6b521b9e152f907d72989ce63322b9fac.webp?v=1758527377","variant_ids":[43743208669283]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084957651043,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c9905b6b521b9e152f907d72989ce63322b9fac.webp?v=1758527377"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743208702051,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514514968675,"product_id":7888461955171,"position":7,"created_at":"2025-09-22T15:49:35+08:00","updated_at":"2025-09-22T15:49:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19f67188016ecfc45fbe382b3b71adf0a4fe4b05.webp?v=1758527376","variant_ids":[43743208702051]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084957487203,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19f67188016ecfc45fbe382b3b71adf0a4fe4b05.webp?v=1758527376"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743208833123,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514514477155,"product_id":7888461955171,"position":5,"created_at":"2025-09-22T15:49:34+08:00","updated_at":"2025-09-22T15:49:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fec73be49c49fd7910ddb637ec5d33c3a114670.webp?v=1758527376","variant_ids":[43743208833123]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084956995683,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fec73be49c49fd7910ddb637ec5d33c3a114670.webp?v=1758527376"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d032cff7e9c95fd363005021bf7558b226ab3cbc.webp?v=1758527374","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4da64d51cdfeb667211d04a7347c87ef3edf5a1.webp?v=1758527374","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1c1f57ac6dc90fcc21fbed198d67e15e5929f4.webp?v=1758527375","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3037809233cd6fd48e127f29978195c304de8065.webp?v=1758527375","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fec73be49c49fd7910ddb637ec5d33c3a114670.webp?v=1758527376","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/082954aded385bf97a5c1be4917ac7d686e20afe.webp?v=1758527376","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19f67188016ecfc45fbe382b3b71adf0a4fe4b05.webp?v=1758527376","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c9905b6b521b9e152f907d72989ce63322b9fac.webp?v=1758527377","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f20adab8b973e1eb49b5a7bd56e5370007c242b.webp?v=1758527378","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ba4617fa284585399407ea32c5b920597fd33c0.webp?v=1758527378"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d032cff7e9c95fd363005021bf7558b226ab3cbc.webp?v=1758527374","options":["color"],"media":[{"alt":null,"id":26084956242019,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d032cff7e9c95fd363005021bf7558b226ab3cbc.webp?v=1758527374"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d032cff7e9c95fd363005021bf7558b226ab3cbc.webp?v=1758527374","width":2000},{"alt":null,"id":26084956438627,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4da64d51cdfeb667211d04a7347c87ef3edf5a1.webp?v=1758527374"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d4da64d51cdfeb667211d04a7347c87ef3edf5a1.webp?v=1758527374","width":2000},{"alt":null,"id":26084956635235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1c1f57ac6dc90fcc21fbed198d67e15e5929f4.webp?v=1758527375"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ef1c1f57ac6dc90fcc21fbed198d67e15e5929f4.webp?v=1758527375","width":2000},{"alt":null,"id":26084956831843,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3037809233cd6fd48e127f29978195c304de8065.webp?v=1758527375"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3037809233cd6fd48e127f29978195c304de8065.webp?v=1758527375","width":2000},{"alt":null,"id":26084956995683,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fec73be49c49fd7910ddb637ec5d33c3a114670.webp?v=1758527376"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fec73be49c49fd7910ddb637ec5d33c3a114670.webp?v=1758527376","width":2000},{"alt":null,"id":26084957192291,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/082954aded385bf97a5c1be4917ac7d686e20afe.webp?v=1758527376"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/082954aded385bf97a5c1be4917ac7d686e20afe.webp?v=1758527376","width":2000},{"alt":null,"id":26084957487203,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19f67188016ecfc45fbe382b3b71adf0a4fe4b05.webp?v=1758527376"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19f67188016ecfc45fbe382b3b71adf0a4fe4b05.webp?v=1758527376","width":2000},{"alt":null,"id":26084957651043,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c9905b6b521b9e152f907d72989ce63322b9fac.webp?v=1758527377"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c9905b6b521b9e152f907d72989ce63322b9fac.webp?v=1758527377","width":2000},{"alt":null,"id":26084957814883,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f20adab8b973e1eb49b5a7bd56e5370007c242b.webp?v=1758527378"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2f20adab8b973e1eb49b5a7bd56e5370007c242b.webp?v=1758527378","width":2000},{"alt":null,"id":26084957978723,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ba4617fa284585399407ea32c5b920597fd33c0.webp?v=1758527378"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ba4617fa284585399407ea32c5b920597fd33c0.webp?v=1758527378","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43743208570979,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514514313315,"product_id":7888461955171,"position":4,"created_at":"2025-09-22T15:49:33+08:00","updated_at":"2025-09-22T15:49:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3037809233cd6fd48e127f29978195c304de8065.webp?v=1758527375","variant_ids":[43743208570979]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084956831843,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3037809233cd6fd48e127f29978195c304de8065.webp?v=1758527375"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743208603747,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514515460195,"product_id":7888461955171,"position":10,"created_at":"2025-09-22T15:49:36+08:00","updated_at":"2025-09-22T15:49:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ba4617fa284585399407ea32c5b920597fd33c0.webp?v=1758527378","variant_ids":[43743208603747]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084957978723,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5ba4617fa284585399407ea32c5b920597fd33c0.webp?v=1758527378"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743208669283,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514515132515,"product_id":7888461955171,"position":8,"created_at":"2025-09-22T15:49:35+08:00","updated_at":"2025-09-22T15:49:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c9905b6b521b9e152f907d72989ce63322b9fac.webp?v=1758527377","variant_ids":[43743208669283]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084957651043,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c9905b6b521b9e152f907d72989ce63322b9fac.webp?v=1758527377"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743208702051,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514514968675,"product_id":7888461955171,"position":7,"created_at":"2025-09-22T15:49:35+08:00","updated_at":"2025-09-22T15:49:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19f67188016ecfc45fbe382b3b71adf0a4fe4b05.webp?v=1758527376","variant_ids":[43743208702051]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084957487203,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/19f67188016ecfc45fbe382b3b71adf0a4fe4b05.webp?v=1758527376"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743208833123,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514514477155,"product_id":7888461955171,"position":5,"created_at":"2025-09-22T15:49:34+08:00","updated_at":"2025-09-22T15:49:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fec73be49c49fd7910ddb637ec5d33c3a114670.webp?v=1758527376","variant_ids":[43743208833123]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084956995683,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0fec73be49c49fd7910ddb637ec5d33c3a114670.webp?v=1758527376"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43743208570979,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES01","requires_shipping":true,"taxable":true,"featured_image":{"id":34514514313315,"product_id":7888461955171,"position":4,"created_at":"2025-09-22T15:49:33+08:00","updated_at":"2025-09-22T15:49:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3037809233cd6fd48e127f29978195c304de8065.webp?v=1758527375","variant_ids":[43743208570979]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 生日派對 - 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-ES01","featured_media":{"alt":null,"id":26084956831843,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3037809233cd6fd48e127f29978195c304de8065.webp?v=1758527375"}},"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: "停產"
}