$product = {"id":7873217331299,"title":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea","handle":"iphone-13-mini-solidsuit-classic-magsafe-kei09","description":null,"published_at":"2025-09-01T11:16:10+08:00","created_at":"2025-09-01T09:26:30+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-keigo","device-iPhone 13 Mini","merge","reseller-keigo"],"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":43658356228195,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST012280B-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409710977123,"product_id":7873217331299,"position":2,"created_at":"2025-09-01T09:26:35+08:00","updated_at":"2025-09-01T09:26:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/870401dc9aebf69dabb7fe11cc0e4839f74769d6.webp?v=1756689998","variant_ids":[43658356228195]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - 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":"MST012280B-KEI09","featured_media":{"alt":null,"id":25982025990243,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/870401dc9aebf69dabb7fe11cc0e4839f74769d6.webp?v=1756689998"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658356260963,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"MST01228Z9-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409711599715,"product_id":7873217331299,"position":5,"created_at":"2025-09-01T09:26:37+08:00","updated_at":"2025-09-01T09:26:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4cc3f0a84ce57b9de5cd6d5cde49693cf0d43d73.webp?v=1756690000","variant_ids":[43658356260963]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01228Z9-KEI09","featured_media":{"alt":null,"id":25982026645603,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4cc3f0a84ce57b9de5cd6d5cde49693cf0d43d73.webp?v=1756690000"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658356293731,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"MST01228Z8-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409712418915,"product_id":7873217331299,"position":9,"created_at":"2025-09-01T09:26:41+08:00","updated_at":"2025-09-01T09:26:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87b7ae240fccb2795f1c21bab08a97a9df88e071.webp?v=1756690003","variant_ids":[43658356293731]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01228Z8-KEI09","featured_media":{"alt":null,"id":25982027268195,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87b7ae240fccb2795f1c21bab08a97a9df88e071.webp?v=1756690003"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658356326499,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0122852-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409712615523,"product_id":7873217331299,"position":10,"created_at":"2025-09-01T09:26:41+08:00","updated_at":"2025-09-01T09:26:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58ee3663f355612a2dffed0c9d37f571dcbe7161.webp?v=1756690003","variant_ids":[43658356326499]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-KEI09","featured_media":{"alt":null,"id":25982027497571,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58ee3663f355612a2dffed0c9d37f571dcbe7161.webp?v=1756690003"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658356392035,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST012280E-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409711239267,"product_id":7873217331299,"position":3,"created_at":"2025-09-01T09:26:36+08:00","updated_at":"2025-09-01T09:26:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/04471c32c2ceaa67f073ba3fffa5d29d61010930.webp?v=1756689998","variant_ids":[43658356392035]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - 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":"MST012280E-KEI09","featured_media":{"alt":null,"id":25982026252387,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/04471c32c2ceaa67f073ba3fffa5d29d61010930.webp?v=1756689998"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158221741a941cd5a379a5ea91267f413b79fba1.webp?v=1756689997","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/870401dc9aebf69dabb7fe11cc0e4839f74769d6.webp?v=1756689998","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/04471c32c2ceaa67f073ba3fffa5d29d61010930.webp?v=1756689998","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b968f6ce6a5cd92e12f58a474aafd1d8a7516676.webp?v=1756689999","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4cc3f0a84ce57b9de5cd6d5cde49693cf0d43d73.webp?v=1756690000","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f9f7c3a2cae942019244f0b5bb640c45024f66d.webp?v=1756690000","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a4a07322886d660d451ec605ed9c64cfe046009.webp?v=1756690001","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e427a4a2ba7c6e0dba3b537076e1a6211c5ef5f8.webp?v=1756690002","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87b7ae240fccb2795f1c21bab08a97a9df88e071.webp?v=1756690003","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58ee3663f355612a2dffed0c9d37f571dcbe7161.webp?v=1756690003"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158221741a941cd5a379a5ea91267f413b79fba1.webp?v=1756689997","options":["color"],"media":[{"alt":null,"id":25982025760867,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158221741a941cd5a379a5ea91267f413b79fba1.webp?v=1756689997"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/158221741a941cd5a379a5ea91267f413b79fba1.webp?v=1756689997","width":2000},{"alt":null,"id":25982025990243,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/870401dc9aebf69dabb7fe11cc0e4839f74769d6.webp?v=1756689998"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/870401dc9aebf69dabb7fe11cc0e4839f74769d6.webp?v=1756689998","width":2000},{"alt":null,"id":25982026252387,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/04471c32c2ceaa67f073ba3fffa5d29d61010930.webp?v=1756689998"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/04471c32c2ceaa67f073ba3fffa5d29d61010930.webp?v=1756689998","width":2000},{"alt":null,"id":25982026448995,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b968f6ce6a5cd92e12f58a474aafd1d8a7516676.webp?v=1756689999"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b968f6ce6a5cd92e12f58a474aafd1d8a7516676.webp?v=1756689999","width":2000},{"alt":null,"id":25982026645603,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4cc3f0a84ce57b9de5cd6d5cde49693cf0d43d73.webp?v=1756690000"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4cc3f0a84ce57b9de5cd6d5cde49693cf0d43d73.webp?v=1756690000","width":2000},{"alt":null,"id":25982026809443,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f9f7c3a2cae942019244f0b5bb640c45024f66d.webp?v=1756690000"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3f9f7c3a2cae942019244f0b5bb640c45024f66d.webp?v=1756690000","width":2000},{"alt":null,"id":25982026907747,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a4a07322886d660d451ec605ed9c64cfe046009.webp?v=1756690001"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8a4a07322886d660d451ec605ed9c64cfe046009.webp?v=1756690001","width":2000},{"alt":null,"id":25982027104355,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e427a4a2ba7c6e0dba3b537076e1a6211c5ef5f8.webp?v=1756690002"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e427a4a2ba7c6e0dba3b537076e1a6211c5ef5f8.webp?v=1756690002","width":2000},{"alt":null,"id":25982027268195,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87b7ae240fccb2795f1c21bab08a97a9df88e071.webp?v=1756690003"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87b7ae240fccb2795f1c21bab08a97a9df88e071.webp?v=1756690003","width":2000},{"alt":null,"id":25982027497571,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58ee3663f355612a2dffed0c9d37f571dcbe7161.webp?v=1756690003"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58ee3663f355612a2dffed0c9d37f571dcbe7161.webp?v=1756690003","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43658356228195,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST012280B-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409710977123,"product_id":7873217331299,"position":2,"created_at":"2025-09-01T09:26:35+08:00","updated_at":"2025-09-01T09:26:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/870401dc9aebf69dabb7fe11cc0e4839f74769d6.webp?v=1756689998","variant_ids":[43658356228195]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - 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":"MST012280B-KEI09","featured_media":{"alt":null,"id":25982025990243,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/870401dc9aebf69dabb7fe11cc0e4839f74769d6.webp?v=1756689998"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658356260963,"title":"Tide Blue","option1":"Tide Blue","option2":null,"option3":null,"sku":"MST01228Z9-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409711599715,"product_id":7873217331299,"position":5,"created_at":"2025-09-01T09:26:37+08:00","updated_at":"2025-09-01T09:26:40+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4cc3f0a84ce57b9de5cd6d5cde49693cf0d43d73.webp?v=1756690000","variant_ids":[43658356260963]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - Tide Blue","public_title":"Tide Blue","options":["Tide Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01228Z9-KEI09","featured_media":{"alt":null,"id":25982026645603,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4cc3f0a84ce57b9de5cd6d5cde49693cf0d43d73.webp?v=1756690000"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658356293731,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"MST01228Z8-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409712418915,"product_id":7873217331299,"position":9,"created_at":"2025-09-01T09:26:41+08:00","updated_at":"2025-09-01T09:26:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87b7ae240fccb2795f1c21bab08a97a9df88e071.webp?v=1756690003","variant_ids":[43658356293731]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01228Z8-KEI09","featured_media":{"alt":null,"id":25982027268195,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/87b7ae240fccb2795f1c21bab08a97a9df88e071.webp?v=1756690003"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658356326499,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0122852-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409712615523,"product_id":7873217331299,"position":10,"created_at":"2025-09-01T09:26:41+08:00","updated_at":"2025-09-01T09:26:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58ee3663f355612a2dffed0c9d37f571dcbe7161.webp?v=1756690003","variant_ids":[43658356326499]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-KEI09","featured_media":{"alt":null,"id":25982027497571,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/58ee3663f355612a2dffed0c9d37f571dcbe7161.webp?v=1756690003"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43658356392035,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST012280E-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409711239267,"product_id":7873217331299,"position":3,"created_at":"2025-09-01T09:26:36+08:00","updated_at":"2025-09-01T09:26:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/04471c32c2ceaa67f073ba3fffa5d29d61010930.webp?v=1756689998","variant_ids":[43658356392035]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - 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":"MST012280E-KEI09","featured_media":{"alt":null,"id":25982026252387,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/04471c32c2ceaa67f073ba3fffa5d29d61010930.webp?v=1756689998"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43658356228195,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST012280B-KEI09","requires_shipping":true,"taxable":true,"featured_image":{"id":34409710977123,"product_id":7873217331299,"position":2,"created_at":"2025-09-01T09:26:35+08:00","updated_at":"2025-09-01T09:26:38+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/870401dc9aebf69dabb7fe11cc0e4839f74769d6.webp?v=1756689998","variant_ids":[43658356228195]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) Keigo Deep Sea - 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":"MST012280B-KEI09","featured_media":{"alt":null,"id":25982025990243,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/870401dc9aebf69dabb7fe11cc0e4839f74769d6.webp?v=1756689998"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}};
$device_handle = null;
$type = "";
var sellingStatus
if ($isMerge) {
$(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: "停產"
}