$product = {"id":7163966849123,"title":"iPhone 15 Pro Max Clear Snoopy 史努比 Chill moment","handle":"iphone-15-pro-max-jellytint-pl58","description":null,"published_at":"2024-01-30T11:56:13+08:00","created_at":"2024-01-30T10:01:58+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師JellyTint專區-Snoopy 史努比","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-snoopy","device-iPhone 15 Pro Max","merge","reseller-snoopy"],"price":118000,"price_min":118000,"price_max":118000,"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":41235102564451,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012980G-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580558639203,"product_id":7163966849123,"position":11,"created_at":"2026-04-02T11:21:25+08:00","updated_at":"2026-04-02T11:21:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef_d2c066f2-aa08-4d2b-b895-fb69fabb24ec.webp?v=1775100087","variant_ids":[41235102564451]},"available":true,"name":"iPhone 15 Pro Max Clear Snoopy 史努比 Chill moment - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":118000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980G-PL58","featured_media":{"alt":null,"id":27113180233827,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef_d2c066f2-aa08-4d2b-b895-fb69fabb24ec.webp?v=1775100087"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41235102629987,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012980I-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580559229027,"product_id":7163966849123,"position":12,"created_at":"2026-04-02T11:21:25+08:00","updated_at":"2026-04-02T11:21:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c68f29b655b437f96778b95036c09a2186b20f94_32b970c8-0c06-4004-ae54-2fd6994bb624.webp?v=1775100087","variant_ids":[41235102629987]},"available":true,"name":"iPhone 15 Pro Max Clear Snoopy 史努比 Chill moment - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":118000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980I-PL58","featured_media":{"alt":null,"id":27113180561507,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c68f29b655b437f96778b95036c09a2186b20f94_32b970c8-0c06-4004-ae54-2fd6994bb624.webp?v=1775100087"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41235102662755,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012980J-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580559589475,"product_id":7163966849123,"position":13,"created_at":"2026-04-02T11:21:26+08:00","updated_at":"2026-04-02T11:21:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c3defc2783f638b8620005ac5cc7099af8236db_a0e3ead8-29c7-434a-8109-f9a66dd230fc.webp?v=1775100088","variant_ids":[41235102662755]},"available":true,"name":"iPhone 15 Pro Max Clear Snoopy 史努比 Chill moment - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":118000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980J-PL58","featured_media":{"alt":null,"id":27113181184099,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c3defc2783f638b8620005ac5cc7099af8236db_a0e3ead8-29c7-434a-8109-f9a66dd230fc.webp?v=1775100088"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0da8d6cb27585e658b588ae432a4a970e50a33c1.webp?v=1706580124","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3da05434d1a3e56c804d9f75a097b042a62f7264_180f3ea5-b671-400d-bd9e-a29403bdf41e.webp?v=1706580127","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77c191d5033bea0695d3c3e7c97c6c866ba9e49b.webp?v=1706580129","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d81f952f7faa59213ddf6861b5261563956c690_a0058ce6-e687-46ff-89a3-49ab2914a6ee.webp?v=1706580131","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1d4ad2d208cd6ca2ae6fb471ab6dc7f2414921a6_baea0c02-13e3-4191-878c-d747323c8d82.webp?v=1706580136","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c38e8da38c3882a3bda077dba569bc0554beb68_5f690192-00ff-4a4a-b3ee-41434d9a666a.webp?v=1706580140","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c3defc2783f638b8620005ac5cc7099af8236db.webp?v=1774938602","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c5aaa8e2d4b85b2cbb0882a7a563b77705ee0de.webp?v=1774938602","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c68f29b655b437f96778b95036c09a2186b20f94.webp?v=1774938603","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef.webp?v=1774938604","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef_d2c066f2-aa08-4d2b-b895-fb69fabb24ec.webp?v=1775100087","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c68f29b655b437f96778b95036c09a2186b20f94_32b970c8-0c06-4004-ae54-2fd6994bb624.webp?v=1775100087","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c3defc2783f638b8620005ac5cc7099af8236db_a0e3ead8-29c7-434a-8109-f9a66dd230fc.webp?v=1775100088","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c5aaa8e2d4b85b2cbb0882a7a563b77705ee0de_a926c18c-c109-489e-94e3-42c1f8909759.webp?v=1775100088"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0da8d6cb27585e658b588ae432a4a970e50a33c1.webp?v=1706580124","options":["color"],"media":[{"alt":null,"id":23236953145443,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0da8d6cb27585e658b588ae432a4a970e50a33c1.webp?v=1706580124"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0da8d6cb27585e658b588ae432a4a970e50a33c1.webp?v=1706580124","width":2000},{"alt":null,"id":23236954718307,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3da05434d1a3e56c804d9f75a097b042a62f7264_180f3ea5-b671-400d-bd9e-a29403bdf41e.webp?v=1706580127"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3da05434d1a3e56c804d9f75a097b042a62f7264_180f3ea5-b671-400d-bd9e-a29403bdf41e.webp?v=1706580127","width":2000},{"alt":null,"id":23236956225635,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77c191d5033bea0695d3c3e7c97c6c866ba9e49b.webp?v=1706580129"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/77c191d5033bea0695d3c3e7c97c6c866ba9e49b.webp?v=1706580129","width":2000},{"alt":null,"id":23236957601891,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d81f952f7faa59213ddf6861b5261563956c690_a0058ce6-e687-46ff-89a3-49ab2914a6ee.webp?v=1706580131"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2d81f952f7faa59213ddf6861b5261563956c690_a0058ce6-e687-46ff-89a3-49ab2914a6ee.webp?v=1706580131","width":2000},{"alt":null,"id":23236959305827,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1d4ad2d208cd6ca2ae6fb471ab6dc7f2414921a6_baea0c02-13e3-4191-878c-d747323c8d82.webp?v=1706580136"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1d4ad2d208cd6ca2ae6fb471ab6dc7f2414921a6_baea0c02-13e3-4191-878c-d747323c8d82.webp?v=1706580136","width":2000},{"alt":null,"id":23236960682083,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c38e8da38c3882a3bda077dba569bc0554beb68_5f690192-00ff-4a4a-b3ee-41434d9a666a.webp?v=1706580140"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1c38e8da38c3882a3bda077dba569bc0554beb68_5f690192-00ff-4a4a-b3ee-41434d9a666a.webp?v=1706580140","width":2000},{"alt":null,"id":27102060183651,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c3defc2783f638b8620005ac5cc7099af8236db.webp?v=1774938602"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c3defc2783f638b8620005ac5cc7099af8236db.webp?v=1774938602","width":2000},{"alt":null,"id":27102060281955,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c5aaa8e2d4b85b2cbb0882a7a563b77705ee0de.webp?v=1774938602"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c5aaa8e2d4b85b2cbb0882a7a563b77705ee0de.webp?v=1774938602","width":2000},{"alt":null,"id":27102060347491,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c68f29b655b437f96778b95036c09a2186b20f94.webp?v=1774938603"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c68f29b655b437f96778b95036c09a2186b20f94.webp?v=1774938603","width":2000},{"alt":null,"id":27102060544099,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef.webp?v=1774938604"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef.webp?v=1774938604","width":2000},{"alt":null,"id":27113180233827,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef_d2c066f2-aa08-4d2b-b895-fb69fabb24ec.webp?v=1775100087"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef_d2c066f2-aa08-4d2b-b895-fb69fabb24ec.webp?v=1775100087","width":2000},{"alt":null,"id":27113180561507,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c68f29b655b437f96778b95036c09a2186b20f94_32b970c8-0c06-4004-ae54-2fd6994bb624.webp?v=1775100087"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c68f29b655b437f96778b95036c09a2186b20f94_32b970c8-0c06-4004-ae54-2fd6994bb624.webp?v=1775100087","width":2000},{"alt":null,"id":27113181184099,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c3defc2783f638b8620005ac5cc7099af8236db_a0e3ead8-29c7-434a-8109-f9a66dd230fc.webp?v=1775100088"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c3defc2783f638b8620005ac5cc7099af8236db_a0e3ead8-29c7-434a-8109-f9a66dd230fc.webp?v=1775100088","width":2000},{"alt":null,"id":27113181479011,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c5aaa8e2d4b85b2cbb0882a7a563b77705ee0de_a926c18c-c109-489e-94e3-42c1f8909759.webp?v=1775100088"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6c5aaa8e2d4b85b2cbb0882a7a563b77705ee0de_a926c18c-c109-489e-94e3-42c1f8909759.webp?v=1775100088","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":41235102564451,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012980G-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580558639203,"product_id":7163966849123,"position":11,"created_at":"2026-04-02T11:21:25+08:00","updated_at":"2026-04-02T11:21:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef_d2c066f2-aa08-4d2b-b895-fb69fabb24ec.webp?v=1775100087","variant_ids":[41235102564451]},"available":true,"name":"iPhone 15 Pro Max Clear Snoopy 史努比 Chill moment - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":118000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980G-PL58","featured_media":{"alt":null,"id":27113180233827,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef_d2c066f2-aa08-4d2b-b895-fb69fabb24ec.webp?v=1775100087"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41235102629987,"title":"Cyber Blue","option1":"Cyber Blue","option2":null,"option3":null,"sku":"CCN012980I-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580559229027,"product_id":7163966849123,"position":12,"created_at":"2026-04-02T11:21:25+08:00","updated_at":"2026-04-02T11:21:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c68f29b655b437f96778b95036c09a2186b20f94_32b970c8-0c06-4004-ae54-2fd6994bb624.webp?v=1775100087","variant_ids":[41235102629987]},"available":true,"name":"iPhone 15 Pro Max Clear Snoopy 史努比 Chill moment - Cyber Blue","public_title":"Cyber Blue","options":["Cyber Blue"],"price":118000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980I-PL58","featured_media":{"alt":null,"id":27113180561507,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c68f29b655b437f96778b95036c09a2186b20f94_32b970c8-0c06-4004-ae54-2fd6994bb624.webp?v=1775100087"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41235102662755,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"CCN012980J-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580559589475,"product_id":7163966849123,"position":13,"created_at":"2026-04-02T11:21:26+08:00","updated_at":"2026-04-02T11:21:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c3defc2783f638b8620005ac5cc7099af8236db_a0e3ead8-29c7-434a-8109-f9a66dd230fc.webp?v=1775100088","variant_ids":[41235102662755]},"available":true,"name":"iPhone 15 Pro Max Clear Snoopy 史努比 Chill moment - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":118000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980J-PL58","featured_media":{"alt":null,"id":27113181184099,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5c3defc2783f638b8620005ac5cc7099af8236db_a0e3ead8-29c7-434a-8109-f9a66dd230fc.webp?v=1775100088"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":41235102564451,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"CCN012980G-PL58","requires_shipping":true,"taxable":true,"featured_image":{"id":35580558639203,"product_id":7163966849123,"position":11,"created_at":"2026-04-02T11:21:25+08:00","updated_at":"2026-04-02T11:21:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef_d2c066f2-aa08-4d2b-b895-fb69fabb24ec.webp?v=1775100087","variant_ids":[41235102564451]},"available":true,"name":"iPhone 15 Pro Max Clear Snoopy 史努比 Chill moment - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":118000,"weight":1180,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"CCN012980G-PL58","featured_media":{"alt":null,"id":27113180233827,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06905a75e9544a0570df513a1b166624775da0ef_d2c066f2-aa08-4d2b-b895-fb69fabb24ec.webp?v=1775100087"}},"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: "停產"
}