$product = {"id":7921206427747,"title":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Fly Freely","handle":"iphone-14-pro-mod-nx-magsafe-ec81","description":null,"published_at":"2025-11-14T10:42:40+08:00","created_at":"2025-11-11T10:20:01+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-bylobster","device-iPhone 14 Pro","merge","reseller-bylobster"],"price":110000,"price_min":110000,"price_max":110000,"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":43831154540643,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-EC81","requires_shipping":true,"taxable":true,"featured_image":{"id":36054667559011,"product_id":7921206427747,"position":14,"created_at":"2026-06-23T09:57:43+08:00","updated_at":"2026-06-23T09:57:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a_eefbc80a-56b8-4ae8-b173-b9cb7edd89dc.webp?v=1782179865","variant_ids":[43831154540643]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Fly Freely - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-EC81","featured_media":{"alt":null,"id":27567517958243,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a_eefbc80a-56b8-4ae8-b173-b9cb7edd89dc.webp?v=1782179865"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831154704483,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-EC81","requires_shipping":true,"taxable":true,"featured_image":{"id":36054667919459,"product_id":7921206427747,"position":15,"created_at":"2026-06-23T09:57:44+08:00","updated_at":"2026-06-23T09:57:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0375e805c96d22d726dd1c61d3498a5b1b6ef3a3_f6d93a88-0a15-43bc-a85b-672ca1e264d6.webp?v=1782179866","variant_ids":[43831154704483]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Fly Freely - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-EC81","featured_media":{"alt":null,"id":27567518089315,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0375e805c96d22d726dd1c61d3498a5b1b6ef3a3_f6d93a88-0a15-43bc-a85b-672ca1e264d6.webp?v=1782179866"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831154802787,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-EC81","requires_shipping":true,"taxable":true,"featured_image":{"id":36054667395171,"product_id":7921206427747,"position":13,"created_at":"2026-06-23T09:57:43+08:00","updated_at":"2026-06-23T09:57:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775d49552b0f1cd7b6d2cd934a2e8cc289b7af9d_7887f580-a9f1-4bce-ac8c-8107047d0443.webp?v=1782179865","variant_ids":[43831154802787]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Fly Freely - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126204-EC81","featured_media":{"alt":null,"id":27567517761635,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775d49552b0f1cd7b6d2cd934a2e8cc289b7af9d_7887f580-a9f1-4bce-ac8c-8107047d0443.webp?v=1782179865"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d66e928abc80c6be245d150f8f4b814e373972fe.webp?v=1762827604","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0375e805c96d22d726dd1c61d3498a5b1b6ef3a3.webp?v=1762827605","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fff25250fb83da1a843518d89ad0e2f779c9fbab.webp?v=1762827605","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5935beec8618e8a2f9dc1660022d4fe5414e6087.webp?v=1762827606","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b1c8cf13aa873439e6cf893316b0dbabae97de57.webp?v=1762827607","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a.webp?v=1762827607","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a11d3599e361c943777ed9e2d3710c67f4735979.webp?v=1762827608","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf31ed468e98da8fb8cbf0a6dfa2a005291497f2.webp?v=1762827609","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54d54b956d39e05f783042bd99601ea03a73b43a.webp?v=1762827609","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775d49552b0f1cd7b6d2cd934a2e8cc289b7af9d.webp?v=1762827610","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aadd1284058e507ad50198867cfff1fa8bdc307.webp?v=1762827611","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf5f6f2aaa040d9b012331442527b77743a2203e.webp?v=1762827612","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775d49552b0f1cd7b6d2cd934a2e8cc289b7af9d_7887f580-a9f1-4bce-ac8c-8107047d0443.webp?v=1782179865","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a_eefbc80a-56b8-4ae8-b173-b9cb7edd89dc.webp?v=1782179865","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0375e805c96d22d726dd1c61d3498a5b1b6ef3a3_f6d93a88-0a15-43bc-a85b-672ca1e264d6.webp?v=1782179866"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d66e928abc80c6be245d150f8f4b814e373972fe.webp?v=1762827604","options":["color"],"media":[{"alt":null,"id":26352037822563,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d66e928abc80c6be245d150f8f4b814e373972fe.webp?v=1762827604"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d66e928abc80c6be245d150f8f4b814e373972fe.webp?v=1762827604","width":2000},{"alt":null,"id":26352037986403,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0375e805c96d22d726dd1c61d3498a5b1b6ef3a3.webp?v=1762827605"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0375e805c96d22d726dd1c61d3498a5b1b6ef3a3.webp?v=1762827605","width":2000},{"alt":null,"id":26352038150243,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fff25250fb83da1a843518d89ad0e2f779c9fbab.webp?v=1762827605"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fff25250fb83da1a843518d89ad0e2f779c9fbab.webp?v=1762827605","width":2000},{"alt":null,"id":26352038445155,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5935beec8618e8a2f9dc1660022d4fe5414e6087.webp?v=1762827606"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5935beec8618e8a2f9dc1660022d4fe5414e6087.webp?v=1762827606","width":2000},{"alt":null,"id":26352038641763,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b1c8cf13aa873439e6cf893316b0dbabae97de57.webp?v=1762827607"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b1c8cf13aa873439e6cf893316b0dbabae97de57.webp?v=1762827607","width":2000},{"alt":null,"id":26352038903907,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a.webp?v=1762827607"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a.webp?v=1762827607","width":2000},{"alt":null,"id":26352039198819,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a11d3599e361c943777ed9e2d3710c67f4735979.webp?v=1762827608"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a11d3599e361c943777ed9e2d3710c67f4735979.webp?v=1762827608","width":2000},{"alt":null,"id":26352039395427,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf31ed468e98da8fb8cbf0a6dfa2a005291497f2.webp?v=1762827609"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf31ed468e98da8fb8cbf0a6dfa2a005291497f2.webp?v=1762827609","width":2000},{"alt":null,"id":26352039559267,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54d54b956d39e05f783042bd99601ea03a73b43a.webp?v=1762827609"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/54d54b956d39e05f783042bd99601ea03a73b43a.webp?v=1762827609","width":2000},{"alt":null,"id":26352039821411,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775d49552b0f1cd7b6d2cd934a2e8cc289b7af9d.webp?v=1762827610"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775d49552b0f1cd7b6d2cd934a2e8cc289b7af9d.webp?v=1762827610","width":2000},{"alt":null,"id":26352040149091,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aadd1284058e507ad50198867cfff1fa8bdc307.webp?v=1762827611"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0aadd1284058e507ad50198867cfff1fa8bdc307.webp?v=1762827611","width":2000},{"alt":null,"id":26352040411235,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf5f6f2aaa040d9b012331442527b77743a2203e.webp?v=1762827612"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf5f6f2aaa040d9b012331442527b77743a2203e.webp?v=1762827612","width":2000},{"alt":null,"id":27567517761635,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775d49552b0f1cd7b6d2cd934a2e8cc289b7af9d_7887f580-a9f1-4bce-ac8c-8107047d0443.webp?v=1782179865"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775d49552b0f1cd7b6d2cd934a2e8cc289b7af9d_7887f580-a9f1-4bce-ac8c-8107047d0443.webp?v=1782179865","width":2000},{"alt":null,"id":27567517958243,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a_eefbc80a-56b8-4ae8-b173-b9cb7edd89dc.webp?v=1782179865"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a_eefbc80a-56b8-4ae8-b173-b9cb7edd89dc.webp?v=1782179865","width":2000},{"alt":null,"id":27567518089315,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0375e805c96d22d726dd1c61d3498a5b1b6ef3a3_f6d93a88-0a15-43bc-a85b-672ca1e264d6.webp?v=1782179866"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0375e805c96d22d726dd1c61d3498a5b1b6ef3a3_f6d93a88-0a15-43bc-a85b-672ca1e264d6.webp?v=1782179866","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43831154540643,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-EC81","requires_shipping":true,"taxable":true,"featured_image":{"id":36054667559011,"product_id":7921206427747,"position":14,"created_at":"2026-06-23T09:57:43+08:00","updated_at":"2026-06-23T09:57:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a_eefbc80a-56b8-4ae8-b173-b9cb7edd89dc.webp?v=1782179865","variant_ids":[43831154540643]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Fly Freely - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-EC81","featured_media":{"alt":null,"id":27567517958243,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a_eefbc80a-56b8-4ae8-b173-b9cb7edd89dc.webp?v=1782179865"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831154704483,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MPB0126224-EC81","requires_shipping":true,"taxable":true,"featured_image":{"id":36054667919459,"product_id":7921206427747,"position":15,"created_at":"2026-06-23T09:57:44+08:00","updated_at":"2026-06-23T09:57:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0375e805c96d22d726dd1c61d3498a5b1b6ef3a3_f6d93a88-0a15-43bc-a85b-672ca1e264d6.webp?v=1782179866","variant_ids":[43831154704483]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Fly Freely - Black","public_title":"Black","options":["Black"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126224-EC81","featured_media":{"alt":null,"id":27567518089315,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0375e805c96d22d726dd1c61d3498a5b1b6ef3a3_f6d93a88-0a15-43bc-a85b-672ca1e264d6.webp?v=1782179866"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43831154802787,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MPB0126204-EC81","requires_shipping":true,"taxable":true,"featured_image":{"id":36054667395171,"product_id":7921206427747,"position":13,"created_at":"2026-06-23T09:57:43+08:00","updated_at":"2026-06-23T09:57:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775d49552b0f1cd7b6d2cd934a2e8cc289b7af9d_7887f580-a9f1-4bce-ac8c-8107047d0443.webp?v=1782179865","variant_ids":[43831154802787]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Fly Freely - White","public_title":"White","options":["White"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB0126204-EC81","featured_media":{"alt":null,"id":27567517761635,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/775d49552b0f1cd7b6d2cd934a2e8cc289b7af9d_7887f580-a9f1-4bce-ac8c-8107047d0443.webp?v=1782179865"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43831154540643,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"MPB01262J5-EC81","requires_shipping":true,"taxable":true,"featured_image":{"id":36054667559011,"product_id":7921206427747,"position":14,"created_at":"2026-06-23T09:57:43+08:00","updated_at":"2026-06-23T09:57:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a_eefbc80a-56b8-4ae8-b173-b9cb7edd89dc.webp?v=1782179865","variant_ids":[43831154540643]},"available":true,"name":"iPhone 14 Pro Mod NX (MagSafe 兼容) 懶散兔與啾先生 Fly Freely - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":110000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MPB01262J5-EC81","featured_media":{"alt":null,"id":27567517958243,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45ee7e8078eb00878706889843e0ae8d9f47eb4a_eefbc80a-56b8-4ae8-b173-b9cb7edd89dc.webp?v=1782179865"}},"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: "停產"
}