$product = {"id":7998516920419,"title":"iPhone XR Mod NX 太空 Behemoth Black Hole Found In An Unlikely Place - QR Code Edition","handle":"iphone-xr-mod-nx-xk49","description":null,"published_at":"2026-04-20T11:31:08+08:00","created_at":"2026-04-20T10:29:26+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nasa","device-iPhone XR","merge","reseller-nasa"],"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":44126750605411,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01085C1-XK49","requires_shipping":true,"taxable":true,"featured_image":{"id":36256420298851,"product_id":7998516920419,"position":9,"created_at":"2026-07-14T12:06:45+08:00","updated_at":"2026-07-14T12:06:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356_508cd3cf-4df6-4da8-b1ce-32112066fbd5.webp?v=1784002008","variant_ids":[44126750605411]},"available":true,"name":"iPhone XR Mod NX 太空 Behemoth Black Hole Found In An Unlikely Place - QR Code Edition - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01085C1-XK49","featured_media":{"alt":null,"id":27760529735779,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356_508cd3cf-4df6-4da8-b1ce-32112066fbd5.webp?v=1784002008"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126751326307,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0108524-XK49","requires_shipping":true,"taxable":true,"featured_image":{"id":36256420790371,"product_id":7998516920419,"position":10,"created_at":"2026-07-14T12:06:46+08:00","updated_at":"2026-07-14T12:06:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58bf013d1154a1b3d1a719e50ccdaea63f49adc2_6ea27339-7694-4682-84d4-368d4b565677.webp?v=1784002009","variant_ids":[44126751326307]},"available":true,"name":"iPhone XR Mod NX 太空 Behemoth Black Hole Found In An Unlikely Place - QR Code Edition - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108524-XK49","featured_media":{"alt":null,"id":27760530227299,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58bf013d1154a1b3d1a719e50ccdaea63f49adc2_6ea27339-7694-4682-84d4-368d4b565677.webp?v=1784002009"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126751588451,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0108515-XK49","requires_shipping":true,"taxable":true,"featured_image":{"id":36256421249123,"product_id":7998516920419,"position":11,"created_at":"2026-07-14T12:06:47+08:00","updated_at":"2026-07-14T12:06:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863_6cf3ea59-af60-4571-ad0e-73f805070233.webp?v=1784002009","variant_ids":[44126751588451]},"available":true,"name":"iPhone XR Mod NX 太空 Behemoth Black Hole Found In An Unlikely Place - QR Code Edition - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108515-XK49","featured_media":{"alt":null,"id":27760530686051,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863_6cf3ea59-af60-4571-ad0e-73f805070233.webp?v=1784002009"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126752079971,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0108504-XK49","requires_shipping":true,"taxable":true,"featured_image":{"id":36256419709027,"product_id":7998516920419,"position":8,"created_at":"2026-07-14T12:06:44+08:00","updated_at":"2026-07-14T12:06:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8afa4498c4f8594ab08c35ecfc370ade7383d5a6_2c7293d5-cdbe-438d-aaae-4bb0c9dd7e39.webp?v=1784002006","variant_ids":[44126752079971]},"available":true,"name":"iPhone XR Mod NX 太空 Behemoth Black Hole Found In An Unlikely Place - QR Code Edition - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108504-XK49","featured_media":{"alt":null,"id":27760529145955,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8afa4498c4f8594ab08c35ecfc370ade7383d5a6_2c7293d5-cdbe-438d-aaae-4bb0c9dd7e39.webp?v=1784002006"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863.webp?v=1776652201","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fd42cdd0a54eb286b4a2e16ac717388e7190e25.webp?v=1776652202","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58bf013d1154a1b3d1a719e50ccdaea63f49adc2.webp?v=1776652203","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356.webp?v=1776652203","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8afa4498c4f8594ab08c35ecfc370ade7383d5a6.webp?v=1776652204","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e826057525fde33672a6023320dccf63738548.webp?v=1776652205","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70118046d6387d1cb5ab1449fd30e57da36c7bae.webp?v=1776652206","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8afa4498c4f8594ab08c35ecfc370ade7383d5a6_2c7293d5-cdbe-438d-aaae-4bb0c9dd7e39.webp?v=1784002006","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356_508cd3cf-4df6-4da8-b1ce-32112066fbd5.webp?v=1784002008","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58bf013d1154a1b3d1a719e50ccdaea63f49adc2_6ea27339-7694-4682-84d4-368d4b565677.webp?v=1784002009","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863_6cf3ea59-af60-4571-ad0e-73f805070233.webp?v=1784002009"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863.webp?v=1776652201","options":["color"],"media":[{"alt":null,"id":27201422393443,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863.webp?v=1776652201"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863.webp?v=1776652201","width":2000},{"alt":null,"id":27201422819427,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fd42cdd0a54eb286b4a2e16ac717388e7190e25.webp?v=1776652202"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3fd42cdd0a54eb286b4a2e16ac717388e7190e25.webp?v=1776652202","width":2000},{"alt":null,"id":27201423114339,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58bf013d1154a1b3d1a719e50ccdaea63f49adc2.webp?v=1776652203"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58bf013d1154a1b3d1a719e50ccdaea63f49adc2.webp?v=1776652203","width":2000},{"alt":null,"id":27201423343715,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356.webp?v=1776652203"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356.webp?v=1776652203","width":2000},{"alt":null,"id":27201423671395,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8afa4498c4f8594ab08c35ecfc370ade7383d5a6.webp?v=1776652204"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8afa4498c4f8594ab08c35ecfc370ade7383d5a6.webp?v=1776652204","width":2000},{"alt":null,"id":27201423999075,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e826057525fde33672a6023320dccf63738548.webp?v=1776652205"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/17e826057525fde33672a6023320dccf63738548.webp?v=1776652205","width":2000},{"alt":null,"id":27201424064611,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70118046d6387d1cb5ab1449fd30e57da36c7bae.webp?v=1776652206"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/70118046d6387d1cb5ab1449fd30e57da36c7bae.webp?v=1776652206","width":2000},{"alt":null,"id":27760529145955,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8afa4498c4f8594ab08c35ecfc370ade7383d5a6_2c7293d5-cdbe-438d-aaae-4bb0c9dd7e39.webp?v=1784002006"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8afa4498c4f8594ab08c35ecfc370ade7383d5a6_2c7293d5-cdbe-438d-aaae-4bb0c9dd7e39.webp?v=1784002006","width":2000},{"alt":null,"id":27760529735779,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356_508cd3cf-4df6-4da8-b1ce-32112066fbd5.webp?v=1784002008"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356_508cd3cf-4df6-4da8-b1ce-32112066fbd5.webp?v=1784002008","width":2000},{"alt":null,"id":27760530227299,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58bf013d1154a1b3d1a719e50ccdaea63f49adc2_6ea27339-7694-4682-84d4-368d4b565677.webp?v=1784002009"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58bf013d1154a1b3d1a719e50ccdaea63f49adc2_6ea27339-7694-4682-84d4-368d4b565677.webp?v=1784002009","width":2000},{"alt":null,"id":27760530686051,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863_6cf3ea59-af60-4571-ad0e-73f805070233.webp?v=1784002009"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863_6cf3ea59-af60-4571-ad0e-73f805070233.webp?v=1784002009","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":44126750605411,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01085C1-XK49","requires_shipping":true,"taxable":true,"featured_image":{"id":36256420298851,"product_id":7998516920419,"position":9,"created_at":"2026-07-14T12:06:45+08:00","updated_at":"2026-07-14T12:06:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356_508cd3cf-4df6-4da8-b1ce-32112066fbd5.webp?v=1784002008","variant_ids":[44126750605411]},"available":true,"name":"iPhone XR Mod NX 太空 Behemoth Black Hole Found In An Unlikely Place - QR Code Edition - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01085C1-XK49","featured_media":{"alt":null,"id":27760529735779,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356_508cd3cf-4df6-4da8-b1ce-32112066fbd5.webp?v=1784002008"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126751326307,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0108524-XK49","requires_shipping":true,"taxable":true,"featured_image":{"id":36256420790371,"product_id":7998516920419,"position":10,"created_at":"2026-07-14T12:06:46+08:00","updated_at":"2026-07-14T12:06:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58bf013d1154a1b3d1a719e50ccdaea63f49adc2_6ea27339-7694-4682-84d4-368d4b565677.webp?v=1784002009","variant_ids":[44126751326307]},"available":true,"name":"iPhone XR Mod NX 太空 Behemoth Black Hole Found In An Unlikely Place - QR Code Edition - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108524-XK49","featured_media":{"alt":null,"id":27760530227299,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58bf013d1154a1b3d1a719e50ccdaea63f49adc2_6ea27339-7694-4682-84d4-368d4b565677.webp?v=1784002009"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126751588451,"title":"Camo Green","option1":"Camo Green","option2":null,"option3":null,"sku":"NPB0108515-XK49","requires_shipping":true,"taxable":true,"featured_image":{"id":36256421249123,"product_id":7998516920419,"position":11,"created_at":"2026-07-14T12:06:47+08:00","updated_at":"2026-07-14T12:06:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863_6cf3ea59-af60-4571-ad0e-73f805070233.webp?v=1784002009","variant_ids":[44126751588451]},"available":true,"name":"iPhone XR Mod NX 太空 Behemoth Black Hole Found In An Unlikely Place - QR Code Edition - Camo Green","public_title":"Camo Green","options":["Camo Green"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108515-XK49","featured_media":{"alt":null,"id":27760530686051,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2165de1b6e8dbcfa930603ccbe828bade10e1863_6cf3ea59-af60-4571-ad0e-73f805070233.webp?v=1784002009"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44126752079971,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NPB0108504-XK49","requires_shipping":true,"taxable":true,"featured_image":{"id":36256419709027,"product_id":7998516920419,"position":8,"created_at":"2026-07-14T12:06:44+08:00","updated_at":"2026-07-14T12:06:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8afa4498c4f8594ab08c35ecfc370ade7383d5a6_2c7293d5-cdbe-438d-aaae-4bb0c9dd7e39.webp?v=1784002006","variant_ids":[44126752079971]},"available":true,"name":"iPhone XR Mod NX 太空 Behemoth Black Hole Found In An Unlikely Place - QR Code Edition - White","public_title":"White","options":["White"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0108504-XK49","featured_media":{"alt":null,"id":27760529145955,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8afa4498c4f8594ab08c35ecfc370ade7383d5a6_2c7293d5-cdbe-438d-aaae-4bb0c9dd7e39.webp?v=1784002006"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":44126750605411,"title":"Lavender","option1":"Lavender","option2":null,"option3":null,"sku":"NPB01085C1-XK49","requires_shipping":true,"taxable":true,"featured_image":{"id":36256420298851,"product_id":7998516920419,"position":9,"created_at":"2026-07-14T12:06:45+08:00","updated_at":"2026-07-14T12:06:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356_508cd3cf-4df6-4da8-b1ce-32112066fbd5.webp?v=1784002008","variant_ids":[44126750605411]},"available":true,"name":"iPhone XR Mod NX 太空 Behemoth Black Hole Found In An Unlikely Place - QR Code Edition - Lavender","public_title":"Lavender","options":["Lavender"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01085C1-XK49","featured_media":{"alt":null,"id":27760529735779,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd3568f9d599551210ee43ffef73866badbeb356_508cd3cf-4df6-4da8-b1ce-32112066fbd5.webp?v=1784002008"}},"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: "停產"
}