$product = {"id":7919957704803,"title":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的聖地巡禮","handle":"iphone-15-plus-mod-nx-hd65","description":null,"published_at":"2025-11-13T10:06:22+08:00","created_at":"2025-11-10T09:52:40+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 15 Plus","merge","reseller-incrediville"],"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":43827533906019,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0129657-HD65","requires_shipping":true,"taxable":true,"featured_image":{"id":34786186166371,"product_id":7919957704803,"position":16,"created_at":"2025-11-11T09:46:35+08:00","updated_at":"2025-11-11T09:46:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5_b78463b2-f915-4569-82f5-c28b80bc0309.webp?v=1762825597","variant_ids":[43827533906019]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的聖地巡禮 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129657-HD65","featured_media":{"alt":null,"id":26351643132003,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5_b78463b2-f915-4569-82f5-c28b80bc0309.webp?v=1762825597"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43827534037091,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0129624-HD65","requires_shipping":true,"taxable":true,"featured_image":{"id":34786186395747,"product_id":7919957704803,"position":17,"created_at":"2025-11-11T09:46:35+08:00","updated_at":"2025-11-11T09:46:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3c76e098559143e95d5f966f539ba71c777cead_525329ae-798d-4db7-9cb8-86989abae61f.webp?v=1762825597","variant_ids":[43827534037091]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的聖地巡禮 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129624-HD65","featured_media":{"alt":null,"id":26351643361379,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3c76e098559143e95d5f966f539ba71c777cead_525329ae-798d-4db7-9cb8-86989abae61f.webp?v=1762825597"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1ab8b6c4325c9eb97712613be6ac20cf64d322b.webp?v=1762739567","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07c3b8139ebb6e86a47e1145ef85c99706a273da.webp?v=1762739568","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa64bbbd9c4530bbd74cbd424f9d7ca7d5c2c4c5.webp?v=1762739568","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e8f93242d83da4bb6de7559daf0fae179c6e047.webp?v=1762739569","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2b29b5e2d77c5f9faa030d2ac1f97224fc02299.webp?v=1762739570","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3c76e098559143e95d5f966f539ba71c777cead.webp?v=1762739570","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5.webp?v=1762739571","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb9c263ab23c3b4c848bc83b68bea812c1a01f72.webp?v=1762739572","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a638efe168837b9d85027a7db23362b83f64e3.webp?v=1762739572","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07c3b8139ebb6e86a47e1145ef85c99706a273da_66dff283-dd21-421f-93dc-b0d79d399206.webp?v=1762825592","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e8f93242d83da4bb6de7559daf0fae179c6e047_73404c87-8dc5-497a-8a86-5e3937afd6de.webp?v=1762825593","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1ab8b6c4325c9eb97712613be6ac20cf64d322b_4b2957b5-ce84-4025-bc6a-fe4a29fe4614.webp?v=1762825594","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2b29b5e2d77c5f9faa030d2ac1f97224fc02299_adac1a8a-bb01-41a2-b799-b6f955a6da0c.webp?v=1762825594","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a638efe168837b9d85027a7db23362b83f64e3_b1817e5a-9a07-4450-bb9f-67437c7356c4.webp?v=1762825595","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa64bbbd9c4530bbd74cbd424f9d7ca7d5c2c4c5_d71db17e-8d3c-4efa-9b50-7c502a13a6e4.webp?v=1762825596","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5_b78463b2-f915-4569-82f5-c28b80bc0309.webp?v=1762825597","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3c76e098559143e95d5f966f539ba71c777cead_525329ae-798d-4db7-9cb8-86989abae61f.webp?v=1762825597","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb9c263ab23c3b4c848bc83b68bea812c1a01f72_165abff5-b53c-4628-86be-624e4aa3207b.webp?v=1762825598"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1ab8b6c4325c9eb97712613be6ac20cf64d322b.webp?v=1762739567","options":["color"],"media":[{"alt":null,"id":26345442934883,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1ab8b6c4325c9eb97712613be6ac20cf64d322b.webp?v=1762739567"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1ab8b6c4325c9eb97712613be6ac20cf64d322b.webp?v=1762739567","width":2000},{"alt":null,"id":26345443033187,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07c3b8139ebb6e86a47e1145ef85c99706a273da.webp?v=1762739568"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07c3b8139ebb6e86a47e1145ef85c99706a273da.webp?v=1762739568","width":2000},{"alt":null,"id":26345443164259,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa64bbbd9c4530bbd74cbd424f9d7ca7d5c2c4c5.webp?v=1762739568"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa64bbbd9c4530bbd74cbd424f9d7ca7d5c2c4c5.webp?v=1762739568","width":2000},{"alt":null,"id":26345443360867,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e8f93242d83da4bb6de7559daf0fae179c6e047.webp?v=1762739569"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e8f93242d83da4bb6de7559daf0fae179c6e047.webp?v=1762739569","width":2000},{"alt":null,"id":26345443491939,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2b29b5e2d77c5f9faa030d2ac1f97224fc02299.webp?v=1762739570"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2b29b5e2d77c5f9faa030d2ac1f97224fc02299.webp?v=1762739570","width":2000},{"alt":null,"id":26345443655779,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3c76e098559143e95d5f966f539ba71c777cead.webp?v=1762739570"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3c76e098559143e95d5f966f539ba71c777cead.webp?v=1762739570","width":2000},{"alt":null,"id":26345443754083,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5.webp?v=1762739571"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5.webp?v=1762739571","width":2000},{"alt":null,"id":26345444016227,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb9c263ab23c3b4c848bc83b68bea812c1a01f72.webp?v=1762739572"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb9c263ab23c3b4c848bc83b68bea812c1a01f72.webp?v=1762739572","width":2000},{"alt":null,"id":26345444180067,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a638efe168837b9d85027a7db23362b83f64e3.webp?v=1762739572"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a638efe168837b9d85027a7db23362b83f64e3.webp?v=1762739572","width":2000},{"alt":null,"id":26351641886819,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07c3b8139ebb6e86a47e1145ef85c99706a273da_66dff283-dd21-421f-93dc-b0d79d399206.webp?v=1762825592"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/07c3b8139ebb6e86a47e1145ef85c99706a273da_66dff283-dd21-421f-93dc-b0d79d399206.webp?v=1762825592","width":2000},{"alt":null,"id":26351642017891,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e8f93242d83da4bb6de7559daf0fae179c6e047_73404c87-8dc5-497a-8a86-5e3937afd6de.webp?v=1762825593"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5e8f93242d83da4bb6de7559daf0fae179c6e047_73404c87-8dc5-497a-8a86-5e3937afd6de.webp?v=1762825593","width":2000},{"alt":null,"id":26351642116195,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1ab8b6c4325c9eb97712613be6ac20cf64d322b_4b2957b5-ce84-4025-bc6a-fe4a29fe4614.webp?v=1762825594"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c1ab8b6c4325c9eb97712613be6ac20cf64d322b_4b2957b5-ce84-4025-bc6a-fe4a29fe4614.webp?v=1762825594","width":2000},{"alt":null,"id":26351642378339,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2b29b5e2d77c5f9faa030d2ac1f97224fc02299_adac1a8a-bb01-41a2-b799-b6f955a6da0c.webp?v=1762825594"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b2b29b5e2d77c5f9faa030d2ac1f97224fc02299_adac1a8a-bb01-41a2-b799-b6f955a6da0c.webp?v=1762825594","width":2000},{"alt":null,"id":26351642607715,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a638efe168837b9d85027a7db23362b83f64e3_b1817e5a-9a07-4450-bb9f-67437c7356c4.webp?v=1762825595"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12a638efe168837b9d85027a7db23362b83f64e3_b1817e5a-9a07-4450-bb9f-67437c7356c4.webp?v=1762825595","width":2000},{"alt":null,"id":26351643000931,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa64bbbd9c4530bbd74cbd424f9d7ca7d5c2c4c5_d71db17e-8d3c-4efa-9b50-7c502a13a6e4.webp?v=1762825596"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/aa64bbbd9c4530bbd74cbd424f9d7ca7d5c2c4c5_d71db17e-8d3c-4efa-9b50-7c502a13a6e4.webp?v=1762825596","width":2000},{"alt":null,"id":26351643132003,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5_b78463b2-f915-4569-82f5-c28b80bc0309.webp?v=1762825597"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5_b78463b2-f915-4569-82f5-c28b80bc0309.webp?v=1762825597","width":2000},{"alt":null,"id":26351643361379,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3c76e098559143e95d5f966f539ba71c777cead_525329ae-798d-4db7-9cb8-86989abae61f.webp?v=1762825597"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3c76e098559143e95d5f966f539ba71c777cead_525329ae-798d-4db7-9cb8-86989abae61f.webp?v=1762825597","width":2000},{"alt":null,"id":26351643689059,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb9c263ab23c3b4c848bc83b68bea812c1a01f72_165abff5-b53c-4628-86be-624e4aa3207b.webp?v=1762825598"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bb9c263ab23c3b4c848bc83b68bea812c1a01f72_165abff5-b53c-4628-86be-624e4aa3207b.webp?v=1762825598","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43827533906019,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0129657-HD65","requires_shipping":true,"taxable":true,"featured_image":{"id":34786186166371,"product_id":7919957704803,"position":16,"created_at":"2025-11-11T09:46:35+08:00","updated_at":"2025-11-11T09:46:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5_b78463b2-f915-4569-82f5-c28b80bc0309.webp?v=1762825597","variant_ids":[43827533906019]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的聖地巡禮 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129657-HD65","featured_media":{"alt":null,"id":26351643132003,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5_b78463b2-f915-4569-82f5-c28b80bc0309.webp?v=1762825597"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43827534037091,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0129624-HD65","requires_shipping":true,"taxable":true,"featured_image":{"id":34786186395747,"product_id":7919957704803,"position":17,"created_at":"2025-11-11T09:46:35+08:00","updated_at":"2025-11-11T09:46:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3c76e098559143e95d5f966f539ba71c777cead_525329ae-798d-4db7-9cb8-86989abae61f.webp?v=1762825597","variant_ids":[43827534037091]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的聖地巡禮 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129624-HD65","featured_media":{"alt":null,"id":26351643361379,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d3c76e098559143e95d5f966f539ba71c777cead_525329ae-798d-4db7-9cb8-86989abae61f.webp?v=1762825597"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43827533906019,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0129657-HD65","requires_shipping":true,"taxable":true,"featured_image":{"id":34786186166371,"product_id":7919957704803,"position":16,"created_at":"2025-11-11T09:46:35+08:00","updated_at":"2025-11-11T09:46:37+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5_b78463b2-f915-4569-82f5-c28b80bc0309.webp?v=1762825597","variant_ids":[43827533906019]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 所長的聖地巡禮 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129657-HD65","featured_media":{"alt":null,"id":26351643132003,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0a029cc8634f1d337f9e16b2e22ff56bf58974b5_b78463b2-f915-4569-82f5-c28b80bc0309.webp?v=1762825597"}},"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: "停產"
}