$product = {"id":7937944977507,"title":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼","handle":"iphone-15-pro-solidx-xu01","description":null,"published_at":"2025-12-12T10:27:11+08:00","created_at":"2025-12-11T16:04:07+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-attack-on-titan","device-iPhone 15 Pro","merge","reseller-attack-on-titan"],"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":43884505694307,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933192130659,"product_id":7937944977507,"position":8,"created_at":"2025-12-11T16:04:14+08:00","updated_at":"2025-12-11T16:04:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3a11569180b246f7434c88b1d4e541cacebf7e.webp?v=1765440256","variant_ids":[43884505694307]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - 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":"NST012970B-XU01","featured_media":{"alt":null,"id":26495563858019,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3a11569180b246f7434c88b1d4e541cacebf7e.webp?v=1765440256"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884507660387,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933191180387,"product_id":7937944977507,"position":3,"created_at":"2025-12-11T16:04:11+08:00","updated_at":"2025-12-11T16:04:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb7a6d13aa1c5db00308df777bc16184e0d51783.webp?v=1765440253","variant_ids":[43884507660387]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - 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":"NST01297Z8-XU01","featured_media":{"alt":null,"id":26495562973283,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb7a6d13aa1c5db00308df777bc16184e0d51783.webp?v=1765440253"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884507758691,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933192032355,"product_id":7937944977507,"position":7,"created_at":"2025-12-11T16:04:13+08:00","updated_at":"2025-12-11T16:04:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71bdd4eab3b316a43b71902628a31be4d753816e.webp?v=1765440255","variant_ids":[43884507758691]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129752-XU01","featured_media":{"alt":null,"id":26495563759715,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71bdd4eab3b316a43b71902628a31be4d753816e.webp?v=1765440255"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884507791459,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933190918243,"product_id":7937944977507,"position":2,"created_at":"2025-12-11T16:04:11+08:00","updated_at":"2025-12-11T16:04:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/272cbe0407fcd474702a4778332d811aea0f609f.webp?v=1765440253","variant_ids":[43884507791459]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970A-XU01","featured_media":{"alt":null,"id":26495562711139,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/272cbe0407fcd474702a4778332d811aea0f609f.webp?v=1765440253"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884507856995,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933192196195,"product_id":7937944977507,"position":9,"created_at":"2025-12-11T16:04:14+08:00","updated_at":"2025-12-11T16:04:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d1fb12b6eaf205155a481abdeeb628eb9ce32f9.webp?v=1765440256","variant_ids":[43884507856995]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129753-XU01","featured_media":{"alt":null,"id":26495563923555,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d1fb12b6eaf205155a481abdeeb628eb9ce32f9.webp?v=1765440256"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e03319f8a94a29837db23096d6ec6b44c565abd.webp?v=1765440253","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/272cbe0407fcd474702a4778332d811aea0f609f.webp?v=1765440253","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb7a6d13aa1c5db00308df777bc16184e0d51783.webp?v=1765440253","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b5fc8ca55825747558dd7c8bfeac734fb318d079.webp?v=1765440254","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/418b7fceb8ec81c1602b3da9cac4506d4135e5c9.webp?v=1765440254","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64d83df1c24f55d3a12f6336e7051c7e8ace6a68.webp?v=1765440254","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71bdd4eab3b316a43b71902628a31be4d753816e.webp?v=1765440255","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3a11569180b246f7434c88b1d4e541cacebf7e.webp?v=1765440256","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d1fb12b6eaf205155a481abdeeb628eb9ce32f9.webp?v=1765440256","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83b8eda0bfdcd05af0e6d10b537c31688910a5d9.webp?v=1765440257"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e03319f8a94a29837db23096d6ec6b44c565abd.webp?v=1765440253","options":["color"],"media":[{"alt":null,"id":26495562448995,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e03319f8a94a29837db23096d6ec6b44c565abd.webp?v=1765440253"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4e03319f8a94a29837db23096d6ec6b44c565abd.webp?v=1765440253","width":2000},{"alt":null,"id":26495562711139,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/272cbe0407fcd474702a4778332d811aea0f609f.webp?v=1765440253"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/272cbe0407fcd474702a4778332d811aea0f609f.webp?v=1765440253","width":2000},{"alt":null,"id":26495562973283,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb7a6d13aa1c5db00308df777bc16184e0d51783.webp?v=1765440253"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb7a6d13aa1c5db00308df777bc16184e0d51783.webp?v=1765440253","width":2000},{"alt":null,"id":26495563300963,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b5fc8ca55825747558dd7c8bfeac734fb318d079.webp?v=1765440254"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b5fc8ca55825747558dd7c8bfeac734fb318d079.webp?v=1765440254","width":2000},{"alt":null,"id":26495563464803,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/418b7fceb8ec81c1602b3da9cac4506d4135e5c9.webp?v=1765440254"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/418b7fceb8ec81c1602b3da9cac4506d4135e5c9.webp?v=1765440254","width":2000},{"alt":null,"id":26495563628643,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64d83df1c24f55d3a12f6336e7051c7e8ace6a68.webp?v=1765440254"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64d83df1c24f55d3a12f6336e7051c7e8ace6a68.webp?v=1765440254","width":2000},{"alt":null,"id":26495563759715,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71bdd4eab3b316a43b71902628a31be4d753816e.webp?v=1765440255"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71bdd4eab3b316a43b71902628a31be4d753816e.webp?v=1765440255","width":2000},{"alt":null,"id":26495563858019,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3a11569180b246f7434c88b1d4e541cacebf7e.webp?v=1765440256"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3a11569180b246f7434c88b1d4e541cacebf7e.webp?v=1765440256","width":2000},{"alt":null,"id":26495563923555,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d1fb12b6eaf205155a481abdeeb628eb9ce32f9.webp?v=1765440256"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d1fb12b6eaf205155a481abdeeb628eb9ce32f9.webp?v=1765440256","width":2000},{"alt":null,"id":26495564021859,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83b8eda0bfdcd05af0e6d10b537c31688910a5d9.webp?v=1765440257"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/83b8eda0bfdcd05af0e6d10b537c31688910a5d9.webp?v=1765440257","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43884505694307,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933192130659,"product_id":7937944977507,"position":8,"created_at":"2025-12-11T16:04:14+08:00","updated_at":"2025-12-11T16:04:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3a11569180b246f7434c88b1d4e541cacebf7e.webp?v=1765440256","variant_ids":[43884505694307]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - 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":"NST012970B-XU01","featured_media":{"alt":null,"id":26495563858019,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3a11569180b246f7434c88b1d4e541cacebf7e.webp?v=1765440256"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884507660387,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"NST01297Z8-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933191180387,"product_id":7937944977507,"position":3,"created_at":"2025-12-11T16:04:11+08:00","updated_at":"2025-12-11T16:04:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb7a6d13aa1c5db00308df777bc16184e0d51783.webp?v=1765440253","variant_ids":[43884507660387]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - 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":"NST01297Z8-XU01","featured_media":{"alt":null,"id":26495562973283,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cb7a6d13aa1c5db00308df777bc16184e0d51783.webp?v=1765440253"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884507758691,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129752-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933192032355,"product_id":7937944977507,"position":7,"created_at":"2025-12-11T16:04:13+08:00","updated_at":"2025-12-11T16:04:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71bdd4eab3b316a43b71902628a31be4d753816e.webp?v=1765440255","variant_ids":[43884507758691]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129752-XU01","featured_media":{"alt":null,"id":26495563759715,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71bdd4eab3b316a43b71902628a31be4d753816e.webp?v=1765440255"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884507791459,"title":"Ocean Blue","option1":"Ocean Blue","option2":null,"option3":null,"sku":"NST012970A-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933190918243,"product_id":7937944977507,"position":2,"created_at":"2025-12-11T16:04:11+08:00","updated_at":"2025-12-11T16:04:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/272cbe0407fcd474702a4778332d811aea0f609f.webp?v=1765440253","variant_ids":[43884507791459]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - Ocean Blue","public_title":"Ocean Blue","options":["Ocean Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST012970A-XU01","featured_media":{"alt":null,"id":26495562711139,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/272cbe0407fcd474702a4778332d811aea0f609f.webp?v=1765440253"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43884507856995,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129753-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933192196195,"product_id":7937944977507,"position":9,"created_at":"2025-12-11T16:04:14+08:00","updated_at":"2025-12-11T16:04:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d1fb12b6eaf205155a481abdeeb628eb9ce32f9.webp?v=1765440256","variant_ids":[43884507856995]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129753-XU01","featured_media":{"alt":null,"id":26495563923555,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4d1fb12b6eaf205155a481abdeeb628eb9ce32f9.webp?v=1765440256"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43884505694307,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST012970B-XU01","requires_shipping":true,"taxable":true,"featured_image":{"id":34933192130659,"product_id":7937944977507,"position":8,"created_at":"2025-12-11T16:04:14+08:00","updated_at":"2025-12-11T16:04:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3a11569180b246f7434c88b1d4e541cacebf7e.webp?v=1765440256","variant_ids":[43884505694307]},"available":true,"name":"iPhone 15 Pro SolidX 進擊的巨人 Attack on Titan 自由之翼 - 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":"NST012970B-XU01","featured_media":{"alt":null,"id":26495563858019,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc3a11569180b246f7434c88b1d4e541cacebf7e.webp?v=1765440256"}},"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: "停產"
}