$product = {"id":7884358451299,"title":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市","handle":"iphone-12-pro-max-solidsuit-classic-magsafe-ifc05","description":null,"published_at":"2025-09-19T09:22:33+08:00","created_at":"2025-09-16T12:50:32+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-sakamoto-days","device-iPhone 12 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":43697837277283,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475569741923,"product_id":7884358451299,"position":2,"created_at":"2025-09-16T12:50:36+08:00","updated_at":"2025-09-16T12:50:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ddccd5adfe00c588f5874128b604ff594d1095.webp?v=1757998238","variant_ids":[43697837277283]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118752-IFC05","featured_media":{"alt":null,"id":26047175327843,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ddccd5adfe00c588f5874128b604ff594d1095.webp?v=1757998238"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697837342819,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST011870C-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475569610851,"product_id":7884358451299,"position":1,"created_at":"2025-09-16T12:50:36+08:00","updated_at":"2025-09-16T12:50:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3e11e1acfbb05c6fab39735220c041b93f7a6d.webp?v=1757998238","variant_ids":[43697837342819]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870C-IFC05","featured_media":{"alt":null,"id":26047175196771,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3e11e1acfbb05c6fab39735220c041b93f7a6d.webp?v=1757998238"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697837408355,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011870E-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475570561123,"product_id":7884358451299,"position":5,"created_at":"2025-09-16T12:50:38+08:00","updated_at":"2025-09-16T12:50:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73bb64b25768b10c0a26d4aa363318b86e8dabdc.webp?v=1757998240","variant_ids":[43697837408355]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870E-IFC05","featured_media":{"alt":null,"id":26047176147043,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73bb64b25768b10c0a26d4aa363318b86e8dabdc.webp?v=1757998240"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697837441123,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST011870B-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475570135139,"product_id":7884358451299,"position":4,"created_at":"2025-09-16T12:50:37+08:00","updated_at":"2025-09-16T12:50:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7d3118ff48370089e7b3395d8a6c3313d99e4fa.webp?v=1757998239","variant_ids":[43697837441123]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870B-IFC05","featured_media":{"alt":null,"id":26047175721059,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7d3118ff48370089e7b3395d8a6c3313d99e4fa.webp?v=1757998239"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697837473891,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01187O9-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475570004067,"product_id":7884358451299,"position":3,"created_at":"2025-09-16T12:50:37+08:00","updated_at":"2025-09-16T12:50:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b456823ca34fced8d326ccf63ef2a064251bb056.webp?v=1757998238","variant_ids":[43697837473891]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01187O9-IFC05","featured_media":{"alt":null,"id":26047175589987,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b456823ca34fced8d326ccf63ef2a064251bb056.webp?v=1757998238"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3e11e1acfbb05c6fab39735220c041b93f7a6d.webp?v=1757998238","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ddccd5adfe00c588f5874128b604ff594d1095.webp?v=1757998238","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b456823ca34fced8d326ccf63ef2a064251bb056.webp?v=1757998238","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7d3118ff48370089e7b3395d8a6c3313d99e4fa.webp?v=1757998239","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73bb64b25768b10c0a26d4aa363318b86e8dabdc.webp?v=1757998240","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/802b979220ddaf4114490505ed376be96f3e7aa6.webp?v=1757998241","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1aefdbda722180b7bd3f5d6fcee5db3db0a65047.webp?v=1757998241","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f728f54821b1273b8d87cbe482a0f3a1c4a4fe69.webp?v=1757998242","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/646ab5b0a3f3d18a1d4b6aec7d5903d3be22459d.webp?v=1757998242"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3e11e1acfbb05c6fab39735220c041b93f7a6d.webp?v=1757998238","options":["color"],"media":[{"alt":null,"id":26047175196771,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3e11e1acfbb05c6fab39735220c041b93f7a6d.webp?v=1757998238"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3e11e1acfbb05c6fab39735220c041b93f7a6d.webp?v=1757998238","width":2000},{"alt":null,"id":26047175327843,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ddccd5adfe00c588f5874128b604ff594d1095.webp?v=1757998238"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ddccd5adfe00c588f5874128b604ff594d1095.webp?v=1757998238","width":2000},{"alt":null,"id":26047175589987,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b456823ca34fced8d326ccf63ef2a064251bb056.webp?v=1757998238"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b456823ca34fced8d326ccf63ef2a064251bb056.webp?v=1757998238","width":2000},{"alt":null,"id":26047175721059,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7d3118ff48370089e7b3395d8a6c3313d99e4fa.webp?v=1757998239"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7d3118ff48370089e7b3395d8a6c3313d99e4fa.webp?v=1757998239","width":2000},{"alt":null,"id":26047176147043,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73bb64b25768b10c0a26d4aa363318b86e8dabdc.webp?v=1757998240"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73bb64b25768b10c0a26d4aa363318b86e8dabdc.webp?v=1757998240","width":2000},{"alt":null,"id":26047176310883,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/802b979220ddaf4114490505ed376be96f3e7aa6.webp?v=1757998241"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/802b979220ddaf4114490505ed376be96f3e7aa6.webp?v=1757998241","width":2000},{"alt":null,"id":26047176474723,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1aefdbda722180b7bd3f5d6fcee5db3db0a65047.webp?v=1757998241"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1aefdbda722180b7bd3f5d6fcee5db3db0a65047.webp?v=1757998241","width":2000},{"alt":null,"id":26047176704099,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f728f54821b1273b8d87cbe482a0f3a1c4a4fe69.webp?v=1757998242"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f728f54821b1273b8d87cbe482a0f3a1c4a4fe69.webp?v=1757998242","width":2000},{"alt":null,"id":26047176867939,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/646ab5b0a3f3d18a1d4b6aec7d5903d3be22459d.webp?v=1757998242"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/646ab5b0a3f3d18a1d4b6aec7d5903d3be22459d.webp?v=1757998242","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43697837277283,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475569741923,"product_id":7884358451299,"position":2,"created_at":"2025-09-16T12:50:36+08:00","updated_at":"2025-09-16T12:50:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ddccd5adfe00c588f5874128b604ff594d1095.webp?v=1757998238","variant_ids":[43697837277283]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118752-IFC05","featured_media":{"alt":null,"id":26047175327843,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ddccd5adfe00c588f5874128b604ff594d1095.webp?v=1757998238"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697837342819,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST011870C-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475569610851,"product_id":7884358451299,"position":1,"created_at":"2025-09-16T12:50:36+08:00","updated_at":"2025-09-16T12:50:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3e11e1acfbb05c6fab39735220c041b93f7a6d.webp?v=1757998238","variant_ids":[43697837342819]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870C-IFC05","featured_media":{"alt":null,"id":26047175196771,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8b3e11e1acfbb05c6fab39735220c041b93f7a6d.webp?v=1757998238"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697837408355,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011870E-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475570561123,"product_id":7884358451299,"position":5,"created_at":"2025-09-16T12:50:38+08:00","updated_at":"2025-09-16T12:50:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73bb64b25768b10c0a26d4aa363318b86e8dabdc.webp?v=1757998240","variant_ids":[43697837408355]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870E-IFC05","featured_media":{"alt":null,"id":26047176147043,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/73bb64b25768b10c0a26d4aa363318b86e8dabdc.webp?v=1757998240"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697837441123,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST011870B-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475570135139,"product_id":7884358451299,"position":4,"created_at":"2025-09-16T12:50:37+08:00","updated_at":"2025-09-16T12:50:39+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7d3118ff48370089e7b3395d8a6c3313d99e4fa.webp?v=1757998239","variant_ids":[43697837441123]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870B-IFC05","featured_media":{"alt":null,"id":26047175721059,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7d3118ff48370089e7b3395d8a6c3313d99e4fa.webp?v=1757998239"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697837473891,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01187O9-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475570004067,"product_id":7884358451299,"position":3,"created_at":"2025-09-16T12:50:37+08:00","updated_at":"2025-09-16T12:50:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b456823ca34fced8d326ccf63ef2a064251bb056.webp?v=1757998238","variant_ids":[43697837473891]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01187O9-IFC05","featured_media":{"alt":null,"id":26047175589987,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b456823ca34fced8d326ccf63ef2a064251bb056.webp?v=1757998238"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43697837277283,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-IFC05","requires_shipping":true,"taxable":true,"featured_image":{"id":34475569741923,"product_id":7884358451299,"position":2,"created_at":"2025-09-16T12:50:36+08:00","updated_at":"2025-09-16T12:50:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ddccd5adfe00c588f5874128b604ff594d1095.webp?v=1757998238","variant_ids":[43697837277283]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 坂本日常 南雲與市 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118752-IFC05","featured_media":{"alt":null,"id":26047175327843,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80ddccd5adfe00c588f5874128b604ff594d1095.webp?v=1757998238"}},"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: "停產"
}