$product = {"id":7884327551075,"title":"iPhone 15 Pro Max SolidX 坂本日常 坂本商店 - 限時特價中","handle":"iphone-15-pro-max-solidx-ifc19","description":null,"published_at":"2025-09-19T09:29:48+08:00","created_at":"2025-09-16T12:44:58+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":43697740578915,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475454496867,"product_id":7884327551075,"position":6,"created_at":"2025-09-16T12:45:06+08:00","updated_at":"2025-09-16T12:45:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba186aa0aa5d60cc64c427888028a58fcdb5f6e4.webp?v=1757997908","variant_ids":[43697740578915]},"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-IFC19","featured_media":{"alt":null,"id":26047060082787,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba186aa0aa5d60cc64c427888028a58fcdb5f6e4.webp?v=1757997908"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697743855715,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475453972579,"product_id":7884327551075,"position":4,"created_at":"2025-09-16T12:45:04+08:00","updated_at":"2025-09-16T12:45:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71cf062c83679b9b9f11100f51559bcfe7138e30.webp?v=1757997906","variant_ids":[43697743855715]},"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-IFC19","featured_media":{"alt":null,"id":26047059558499,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71cf062c83679b9b9f11100f51559bcfe7138e30.webp?v=1757997906"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697743921251,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475453710435,"product_id":7884327551075,"position":3,"created_at":"2025-09-16T12:45:04+08:00","updated_at":"2025-09-16T12:45:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78671067291feef91b23bd0a25c6d315d6195739.webp?v=1757997906","variant_ids":[43697743921251]},"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-IFC19","featured_media":{"alt":null,"id":26047059099747,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78671067291feef91b23bd0a25c6d315d6195739.webp?v=1757997906"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697743954019,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475455348835,"product_id":7884327551075,"position":8,"created_at":"2025-09-16T12:45:07+08:00","updated_at":"2025-09-16T12:45:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3143784f06ba08aeada17ea2148d975fbea89ace.webp?v=1757997909","variant_ids":[43697743954019]},"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-IFC19","featured_media":{"alt":null,"id":26047060967523,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3143784f06ba08aeada17ea2148d975fbea89ace.webp?v=1757997909"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697744019555,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475455021155,"product_id":7884327551075,"position":7,"created_at":"2025-09-16T12:45:06+08:00","updated_at":"2025-09-16T12:45:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/effe4d9fb7d745eadead8e6ae44529dac4c4691e.webp?v=1757997908","variant_ids":[43697744019555]},"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-IFC19","featured_media":{"alt":null,"id":26047060508771,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/effe4d9fb7d745eadead8e6ae44529dac4c4691e.webp?v=1757997908"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bac252dd6dc79b6c91bf4298c83de5c8865261ba.webp?v=1757997905","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f88ecb27b3a85a682ff37bd55fa5a04cc4a0399d.webp?v=1757997905","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78671067291feef91b23bd0a25c6d315d6195739.webp?v=1757997906","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71cf062c83679b9b9f11100f51559bcfe7138e30.webp?v=1757997906","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0acb659a4ae90081f4c51969ec87ac1671fef7ed.webp?v=1757997907","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba186aa0aa5d60cc64c427888028a58fcdb5f6e4.webp?v=1757997908","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/effe4d9fb7d745eadead8e6ae44529dac4c4691e.webp?v=1757997908","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3143784f06ba08aeada17ea2148d975fbea89ace.webp?v=1757997909","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bcdccb3dffd5e9d0fc9ef118ebe7c8a9f515136.webp?v=1757997909","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d02f288051b968836f57319725ce794d25f0602.webp?v=1757997910"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bac252dd6dc79b6c91bf4298c83de5c8865261ba.webp?v=1757997905","options":["color"],"media":[{"alt":null,"id":26047058673763,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bac252dd6dc79b6c91bf4298c83de5c8865261ba.webp?v=1757997905"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bac252dd6dc79b6c91bf4298c83de5c8865261ba.webp?v=1757997905","width":2000},{"alt":null,"id":26047058870371,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f88ecb27b3a85a682ff37bd55fa5a04cc4a0399d.webp?v=1757997905"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f88ecb27b3a85a682ff37bd55fa5a04cc4a0399d.webp?v=1757997905","width":2000},{"alt":null,"id":26047059099747,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78671067291feef91b23bd0a25c6d315d6195739.webp?v=1757997906"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78671067291feef91b23bd0a25c6d315d6195739.webp?v=1757997906","width":2000},{"alt":null,"id":26047059558499,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71cf062c83679b9b9f11100f51559bcfe7138e30.webp?v=1757997906"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71cf062c83679b9b9f11100f51559bcfe7138e30.webp?v=1757997906","width":2000},{"alt":null,"id":26047059853411,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0acb659a4ae90081f4c51969ec87ac1671fef7ed.webp?v=1757997907"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0acb659a4ae90081f4c51969ec87ac1671fef7ed.webp?v=1757997907","width":2000},{"alt":null,"id":26047060082787,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba186aa0aa5d60cc64c427888028a58fcdb5f6e4.webp?v=1757997908"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba186aa0aa5d60cc64c427888028a58fcdb5f6e4.webp?v=1757997908","width":2000},{"alt":null,"id":26047060508771,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/effe4d9fb7d745eadead8e6ae44529dac4c4691e.webp?v=1757997908"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/effe4d9fb7d745eadead8e6ae44529dac4c4691e.webp?v=1757997908","width":2000},{"alt":null,"id":26047060967523,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3143784f06ba08aeada17ea2148d975fbea89ace.webp?v=1757997909"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3143784f06ba08aeada17ea2148d975fbea89ace.webp?v=1757997909","width":2000},{"alt":null,"id":26047061229667,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bcdccb3dffd5e9d0fc9ef118ebe7c8a9f515136.webp?v=1757997909"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6bcdccb3dffd5e9d0fc9ef118ebe7c8a9f515136.webp?v=1757997909","width":2000},{"alt":null,"id":26047061459043,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d02f288051b968836f57319725ce794d25f0602.webp?v=1757997910"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d02f288051b968836f57319725ce794d25f0602.webp?v=1757997910","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43697740578915,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475454496867,"product_id":7884327551075,"position":6,"created_at":"2025-09-16T12:45:06+08:00","updated_at":"2025-09-16T12:45:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba186aa0aa5d60cc64c427888028a58fcdb5f6e4.webp?v=1757997908","variant_ids":[43697740578915]},"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-IFC19","featured_media":{"alt":null,"id":26047060082787,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba186aa0aa5d60cc64c427888028a58fcdb5f6e4.webp?v=1757997908"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697743855715,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475453972579,"product_id":7884327551075,"position":4,"created_at":"2025-09-16T12:45:04+08:00","updated_at":"2025-09-16T12:45:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71cf062c83679b9b9f11100f51559bcfe7138e30.webp?v=1757997906","variant_ids":[43697743855715]},"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-IFC19","featured_media":{"alt":null,"id":26047059558499,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71cf062c83679b9b9f11100f51559bcfe7138e30.webp?v=1757997906"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697743921251,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475453710435,"product_id":7884327551075,"position":3,"created_at":"2025-09-16T12:45:04+08:00","updated_at":"2025-09-16T12:45:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78671067291feef91b23bd0a25c6d315d6195739.webp?v=1757997906","variant_ids":[43697743921251]},"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-IFC19","featured_media":{"alt":null,"id":26047059099747,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/78671067291feef91b23bd0a25c6d315d6195739.webp?v=1757997906"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697743954019,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475455348835,"product_id":7884327551075,"position":8,"created_at":"2025-09-16T12:45:07+08:00","updated_at":"2025-09-16T12:45:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3143784f06ba08aeada17ea2148d975fbea89ace.webp?v=1757997909","variant_ids":[43697743954019]},"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-IFC19","featured_media":{"alt":null,"id":26047060967523,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3143784f06ba08aeada17ea2148d975fbea89ace.webp?v=1757997909"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43697744019555,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475455021155,"product_id":7884327551075,"position":7,"created_at":"2025-09-16T12:45:06+08:00","updated_at":"2025-09-16T12:45:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/effe4d9fb7d745eadead8e6ae44529dac4c4691e.webp?v=1757997908","variant_ids":[43697744019555]},"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-IFC19","featured_media":{"alt":null,"id":26047060508771,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/effe4d9fb7d745eadead8e6ae44529dac4c4691e.webp?v=1757997908"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43697740578915,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-IFC19","requires_shipping":true,"taxable":true,"featured_image":{"id":34475454496867,"product_id":7884327551075,"position":6,"created_at":"2025-09-16T12:45:06+08:00","updated_at":"2025-09-16T12:45:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba186aa0aa5d60cc64c427888028a58fcdb5f6e4.webp?v=1757997908","variant_ids":[43697740578915]},"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-IFC19","featured_media":{"alt":null,"id":26047060082787,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ba186aa0aa5d60cc64c427888028a58fcdb5f6e4.webp?v=1757997908"}},"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: "停產"
}