$product = {"id":7892397097059,"title":"iPhone 15 Pro Max SolidX 小王子 小王子的世界","handle":"iphone-15-pro-max-solidx-to54","description":null,"published_at":"2025-10-03T10:09:23+08:00","created_at":"2025-10-01T15:47:01+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-le-petit-prince","device-iPhone 15 Pro Max","merge","reseller-le-petit-prince"],"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":43755551916131,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542121746531,"product_id":7892397097059,"position":5,"created_at":"2025-10-01T15:47:09+08:00","updated_at":"2025-10-01T15:47:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0853fc8a89f790cf38647da22ced7ba3544c2aba.webp?v=1759304830","variant_ids":[43755551916131]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111886819427,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0853fc8a89f790cf38647da22ced7ba3544c2aba.webp?v=1759304830"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755551948899,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542121451619,"product_id":7892397097059,"position":4,"created_at":"2025-10-01T15:47:08+08:00","updated_at":"2025-10-01T15:47:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2178c26382f34df8a423b80f8354ee0b1670211d.webp?v=1759304830","variant_ids":[43755551948899]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111886458979,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2178c26382f34df8a423b80f8354ee0b1670211d.webp?v=1759304830"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755552047203,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542121189475,"product_id":7892397097059,"position":3,"created_at":"2025-10-01T15:47:07+08:00","updated_at":"2025-10-01T15:47:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/340cbfb7ef5c31ee314d1997d57ff69771a90dec.webp?v=1759304829","variant_ids":[43755552047203]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111886262371,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/340cbfb7ef5c31ee314d1997d57ff69771a90dec.webp?v=1759304829"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755552079971,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542120763491,"product_id":7892397097059,"position":1,"created_at":"2025-10-01T15:47:06+08:00","updated_at":"2025-10-01T15:47:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ac510628c1b6ef92399eb8fa8001bb3466fede24.webp?v=1759304827","variant_ids":[43755552079971]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111885869155,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ac510628c1b6ef92399eb8fa8001bb3466fede24.webp?v=1759304827"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755552145507,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542122434659,"product_id":7892397097059,"position":8,"created_at":"2025-10-01T15:47:11+08:00","updated_at":"2025-10-01T15:47:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86757c4bf8226801ca0565f4631d34f018de3f65.webp?v=1759304833","variant_ids":[43755552145507]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111887507555,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86757c4bf8226801ca0565f4631d34f018de3f65.webp?v=1759304833"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ac510628c1b6ef92399eb8fa8001bb3466fede24.webp?v=1759304827","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23818dce1ec37f8accf43f35491e13ace5338ff6.webp?v=1759304828","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/340cbfb7ef5c31ee314d1997d57ff69771a90dec.webp?v=1759304829","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2178c26382f34df8a423b80f8354ee0b1670211d.webp?v=1759304830","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0853fc8a89f790cf38647da22ced7ba3544c2aba.webp?v=1759304830","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9238d39f336251525482ef9438a1ee3229f6101.webp?v=1759304831","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4e5e55b1308ea6ec6784280f66585d302d3ff10.webp?v=1759304832","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86757c4bf8226801ca0565f4631d34f018de3f65.webp?v=1759304833","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7683fdcc3c03fe7f1d5c31e6132317bd3aec7d28.webp?v=1759304833","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42c97d852f39e9ed4b1ed0c411b11ad4055bbb75.webp?v=1759304834"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ac510628c1b6ef92399eb8fa8001bb3466fede24.webp?v=1759304827","options":["color"],"media":[{"alt":null,"id":26111885869155,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ac510628c1b6ef92399eb8fa8001bb3466fede24.webp?v=1759304827"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ac510628c1b6ef92399eb8fa8001bb3466fede24.webp?v=1759304827","width":2000},{"alt":null,"id":26111886065763,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23818dce1ec37f8accf43f35491e13ace5338ff6.webp?v=1759304828"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/23818dce1ec37f8accf43f35491e13ace5338ff6.webp?v=1759304828","width":2000},{"alt":null,"id":26111886262371,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/340cbfb7ef5c31ee314d1997d57ff69771a90dec.webp?v=1759304829"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/340cbfb7ef5c31ee314d1997d57ff69771a90dec.webp?v=1759304829","width":2000},{"alt":null,"id":26111886458979,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2178c26382f34df8a423b80f8354ee0b1670211d.webp?v=1759304830"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2178c26382f34df8a423b80f8354ee0b1670211d.webp?v=1759304830","width":2000},{"alt":null,"id":26111886819427,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0853fc8a89f790cf38647da22ced7ba3544c2aba.webp?v=1759304830"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0853fc8a89f790cf38647da22ced7ba3544c2aba.webp?v=1759304830","width":2000},{"alt":null,"id":26111887048803,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9238d39f336251525482ef9438a1ee3229f6101.webp?v=1759304831"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e9238d39f336251525482ef9438a1ee3229f6101.webp?v=1759304831","width":2000},{"alt":null,"id":26111887245411,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4e5e55b1308ea6ec6784280f66585d302d3ff10.webp?v=1759304832"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f4e5e55b1308ea6ec6784280f66585d302d3ff10.webp?v=1759304832","width":2000},{"alt":null,"id":26111887507555,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86757c4bf8226801ca0565f4631d34f018de3f65.webp?v=1759304833"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86757c4bf8226801ca0565f4631d34f018de3f65.webp?v=1759304833","width":2000},{"alt":null,"id":26111887736931,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7683fdcc3c03fe7f1d5c31e6132317bd3aec7d28.webp?v=1759304833"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7683fdcc3c03fe7f1d5c31e6132317bd3aec7d28.webp?v=1759304833","width":2000},{"alt":null,"id":26111887900771,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42c97d852f39e9ed4b1ed0c411b11ad4055bbb75.webp?v=1759304834"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/42c97d852f39e9ed4b1ed0c411b11ad4055bbb75.webp?v=1759304834","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43755551916131,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542121746531,"product_id":7892397097059,"position":5,"created_at":"2025-10-01T15:47:09+08:00","updated_at":"2025-10-01T15:47:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0853fc8a89f790cf38647da22ced7ba3544c2aba.webp?v=1759304830","variant_ids":[43755551916131]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111886819427,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0853fc8a89f790cf38647da22ced7ba3544c2aba.webp?v=1759304830"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755551948899,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542121451619,"product_id":7892397097059,"position":4,"created_at":"2025-10-01T15:47:08+08:00","updated_at":"2025-10-01T15:47:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2178c26382f34df8a423b80f8354ee0b1670211d.webp?v=1759304830","variant_ids":[43755551948899]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111886458979,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2178c26382f34df8a423b80f8354ee0b1670211d.webp?v=1759304830"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755552047203,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542121189475,"product_id":7892397097059,"position":3,"created_at":"2025-10-01T15:47:07+08:00","updated_at":"2025-10-01T15:47:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/340cbfb7ef5c31ee314d1997d57ff69771a90dec.webp?v=1759304829","variant_ids":[43755552047203]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111886262371,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/340cbfb7ef5c31ee314d1997d57ff69771a90dec.webp?v=1759304829"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755552079971,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542120763491,"product_id":7892397097059,"position":1,"created_at":"2025-10-01T15:47:06+08:00","updated_at":"2025-10-01T15:47:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ac510628c1b6ef92399eb8fa8001bb3466fede24.webp?v=1759304827","variant_ids":[43755552079971]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111885869155,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ac510628c1b6ef92399eb8fa8001bb3466fede24.webp?v=1759304827"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43755552145507,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542122434659,"product_id":7892397097059,"position":8,"created_at":"2025-10-01T15:47:11+08:00","updated_at":"2025-10-01T15:47:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86757c4bf8226801ca0565f4631d34f018de3f65.webp?v=1759304833","variant_ids":[43755552145507]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111887507555,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/86757c4bf8226801ca0565f4631d34f018de3f65.webp?v=1759304833"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43755551916131,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-TO54","requires_shipping":true,"taxable":true,"featured_image":{"id":34542121746531,"product_id":7892397097059,"position":5,"created_at":"2025-10-01T15:47:09+08:00","updated_at":"2025-10-01T15:47:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0853fc8a89f790cf38647da22ced7ba3544c2aba.webp?v=1759304830","variant_ids":[43755551916131]},"available":true,"name":"iPhone 15 Pro Max SolidX 小王子 小王子的世界 - 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-TO54","featured_media":{"alt":null,"id":26111886819427,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0853fc8a89f790cf38647da22ced7ba3544c2aba.webp?v=1759304830"}},"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: "停產"
}