$product = {"id":7884314574947,"title":"iPhone 15 Pro Max SolidX 坂本日常 南雲與市","handle":"iphone-15-pro-max-solidx-ifc05","description":null,"published_at":"2025-09-19T09:32:42+08:00","created_at":"2025-09-16T12:42:47+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-sakamoto-days","device-iPhone 15 Pro Max","merge","reseller-sakamoto-days"],"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":43697703583843,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475408916579,"product_id":7884314574947,"position":9,"created_at":"2025-09-16T12:42:55+08:00","updated_at":"2025-09-16T12:42:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6b4e929e09f7aca33dce4d6207b3cb51e9e61c6.webp?v=1757997778","variant_ids":[43697703583843]},"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-IFC05","featured_media":{"alt":null,"id":26047014502499,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6b4e929e09f7aca33dce4d6207b3cb51e9e61c6.webp?v=1757997778"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697706172515,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475407540323,"product_id":7884314574947,"position":4,"created_at":"2025-09-16T12:42:53+08:00","updated_at":"2025-09-16T12:42:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e3a41fd06a002b3808451e60a87611541ed0406.webp?v=1757997775","variant_ids":[43697706172515]},"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-IFC05","featured_media":{"alt":null,"id":26047013126243,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e3a41fd06a002b3808451e60a87611541ed0406.webp?v=1757997775"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697706238051,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475407933539,"product_id":7884314574947,"position":5,"created_at":"2025-09-16T12:42:53+08:00","updated_at":"2025-09-16T12:42:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a39fcb70c8324a78a8b1362e7c7b26d18f28c5d.webp?v=1757997775","variant_ids":[43697706238051]},"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-IFC05","featured_media":{"alt":null,"id":26047013519459,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a39fcb70c8324a78a8b1362e7c7b26d18f28c5d.webp?v=1757997775"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697706270819,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475407081571,"product_id":7884314574947,"position":2,"created_at":"2025-09-16T12:42:52+08:00","updated_at":"2025-09-16T12:42:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10c6d1800df0861c8b98c4c8b5e5c587301fbdef.webp?v=1757997774","variant_ids":[43697706270819]},"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-IFC05","featured_media":{"alt":null,"id":26047012634723,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10c6d1800df0861c8b98c4c8b5e5c587301fbdef.webp?v=1757997774"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697706336355,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475407310947,"product_id":7884314574947,"position":3,"created_at":"2025-09-16T12:42:52+08:00","updated_at":"2025-09-16T12:42:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a6ce10af29cbbf81b0b6bdc0841022b4fc52aea9.webp?v=1757997774","variant_ids":[43697706336355]},"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-IFC05","featured_media":{"alt":null,"id":26047012896867,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a6ce10af29cbbf81b0b6bdc0841022b4fc52aea9.webp?v=1757997774"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c39e2b2e0dba91c36ec3f8167b5b99189ef1bc38.webp?v=1757997773","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10c6d1800df0861c8b98c4c8b5e5c587301fbdef.webp?v=1757997774","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a6ce10af29cbbf81b0b6bdc0841022b4fc52aea9.webp?v=1757997774","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e3a41fd06a002b3808451e60a87611541ed0406.webp?v=1757997775","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a39fcb70c8324a78a8b1362e7c7b26d18f28c5d.webp?v=1757997775","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b30944d04544c1f07c52602c37d85ba3f22ef9b1.webp?v=1757997776","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/713f19d2980dddfb8089d5402b50947d11bb7e9d.webp?v=1757997777","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/358c57f2946634326e0fc148a5553c0898d15edd.webp?v=1757997777","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6b4e929e09f7aca33dce4d6207b3cb51e9e61c6.webp?v=1757997778","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9257df42db3733ee0d70ab83333cc8ae7f6d4c47.webp?v=1757997778"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c39e2b2e0dba91c36ec3f8167b5b99189ef1bc38.webp?v=1757997773","options":["color"],"media":[{"alt":null,"id":26047011946595,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c39e2b2e0dba91c36ec3f8167b5b99189ef1bc38.webp?v=1757997773"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c39e2b2e0dba91c36ec3f8167b5b99189ef1bc38.webp?v=1757997773","width":2000},{"alt":null,"id":26047012634723,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10c6d1800df0861c8b98c4c8b5e5c587301fbdef.webp?v=1757997774"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10c6d1800df0861c8b98c4c8b5e5c587301fbdef.webp?v=1757997774","width":2000},{"alt":null,"id":26047012896867,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a6ce10af29cbbf81b0b6bdc0841022b4fc52aea9.webp?v=1757997774"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a6ce10af29cbbf81b0b6bdc0841022b4fc52aea9.webp?v=1757997774","width":2000},{"alt":null,"id":26047013126243,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e3a41fd06a002b3808451e60a87611541ed0406.webp?v=1757997775"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e3a41fd06a002b3808451e60a87611541ed0406.webp?v=1757997775","width":2000},{"alt":null,"id":26047013519459,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a39fcb70c8324a78a8b1362e7c7b26d18f28c5d.webp?v=1757997775"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a39fcb70c8324a78a8b1362e7c7b26d18f28c5d.webp?v=1757997775","width":2000},{"alt":null,"id":26047013748835,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b30944d04544c1f07c52602c37d85ba3f22ef9b1.webp?v=1757997776"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b30944d04544c1f07c52602c37d85ba3f22ef9b1.webp?v=1757997776","width":2000},{"alt":null,"id":26047013945443,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/713f19d2980dddfb8089d5402b50947d11bb7e9d.webp?v=1757997777"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/713f19d2980dddfb8089d5402b50947d11bb7e9d.webp?v=1757997777","width":2000},{"alt":null,"id":26047014109283,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/358c57f2946634326e0fc148a5553c0898d15edd.webp?v=1757997777"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/358c57f2946634326e0fc148a5553c0898d15edd.webp?v=1757997777","width":2000},{"alt":null,"id":26047014502499,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6b4e929e09f7aca33dce4d6207b3cb51e9e61c6.webp?v=1757997778"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6b4e929e09f7aca33dce4d6207b3cb51e9e61c6.webp?v=1757997778","width":2000},{"alt":null,"id":26047014666339,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9257df42db3733ee0d70ab83333cc8ae7f6d4c47.webp?v=1757997778"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9257df42db3733ee0d70ab83333cc8ae7f6d4c47.webp?v=1757997778","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43697703583843,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475408916579,"product_id":7884314574947,"position":9,"created_at":"2025-09-16T12:42:55+08:00","updated_at":"2025-09-16T12:42:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6b4e929e09f7aca33dce4d6207b3cb51e9e61c6.webp?v=1757997778","variant_ids":[43697703583843]},"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-IFC05","featured_media":{"alt":null,"id":26047014502499,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6b4e929e09f7aca33dce4d6207b3cb51e9e61c6.webp?v=1757997778"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697706172515,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475407540323,"product_id":7884314574947,"position":4,"created_at":"2025-09-16T12:42:53+08:00","updated_at":"2025-09-16T12:42:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e3a41fd06a002b3808451e60a87611541ed0406.webp?v=1757997775","variant_ids":[43697706172515]},"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-IFC05","featured_media":{"alt":null,"id":26047013126243,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e3a41fd06a002b3808451e60a87611541ed0406.webp?v=1757997775"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697706238051,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475407933539,"product_id":7884314574947,"position":5,"created_at":"2025-09-16T12:42:53+08:00","updated_at":"2025-09-16T12:42:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a39fcb70c8324a78a8b1362e7c7b26d18f28c5d.webp?v=1757997775","variant_ids":[43697706238051]},"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-IFC05","featured_media":{"alt":null,"id":26047013519459,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4a39fcb70c8324a78a8b1362e7c7b26d18f28c5d.webp?v=1757997775"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697706270819,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475407081571,"product_id":7884314574947,"position":2,"created_at":"2025-09-16T12:42:52+08:00","updated_at":"2025-09-16T12:42:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10c6d1800df0861c8b98c4c8b5e5c587301fbdef.webp?v=1757997774","variant_ids":[43697706270819]},"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-IFC05","featured_media":{"alt":null,"id":26047012634723,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/10c6d1800df0861c8b98c4c8b5e5c587301fbdef.webp?v=1757997774"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697706336355,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475407310947,"product_id":7884314574947,"position":3,"created_at":"2025-09-16T12:42:52+08:00","updated_at":"2025-09-16T12:42:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a6ce10af29cbbf81b0b6bdc0841022b4fc52aea9.webp?v=1757997774","variant_ids":[43697706336355]},"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-IFC05","featured_media":{"alt":null,"id":26047012896867,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a6ce10af29cbbf81b0b6bdc0841022b4fc52aea9.webp?v=1757997774"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43697703583843,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475408916579,"product_id":7884314574947,"position":9,"created_at":"2025-09-16T12:42:55+08:00","updated_at":"2025-09-16T12:42:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6b4e929e09f7aca33dce4d6207b3cb51e9e61c6.webp?v=1757997778","variant_ids":[43697703583843]},"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-IFC05","featured_media":{"alt":null,"id":26047014502499,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6b4e929e09f7aca33dce4d6207b3cb51e9e61c6.webp?v=1757997778"}},"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: "停產"
}