$product = {"id":7968420364387,"title":"Galaxy S26 Ultra SolidX Harry Potter Sticker-Wizarding World","handle":"samsung-galaxy-s26-ultra-solidx-oo34","description":null,"published_at":"2026-02-25T14:08:09+08:00","created_at":"2026-02-24T10:55:08+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Samsung","designer","designer-harry-potter","device-Galaxy S26 Ultra","merge","reseller-harry-potter"],"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":44020513996899,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0337452-OO34","requires_shipping":true,"taxable":true,"featured_image":{"id":36159133941859,"product_id":7968420364387,"position":9,"created_at":"2026-07-02T19:48:09+08:00","updated_at":"2026-07-02T19:48:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_85acd6ea-3007-484e-8e1e-11b1ab8c1638.webp?v=1782992891","variant_ids":[44020513996899]},"available":true,"name":"Galaxy S26 Ultra SolidX Harry Potter Sticker-Wizarding World - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0337452-OO34","featured_media":{"alt":null,"id":27663999729763,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_85acd6ea-3007-484e-8e1e-11b1ab8c1638.webp?v=1782992891"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44020520616035,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST033740B-OO34","requires_shipping":true,"taxable":true,"featured_image":{"id":36159133909091,"product_id":7968420364387,"position":8,"created_at":"2026-07-02T19:48:08+08:00","updated_at":"2026-07-02T19:48:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf04741e4d00489c06b44581aaa16782bd6d566b_9d45b1f3-fca8-4416-909f-897b4d8a3705.webp?v=1782992890","variant_ids":[44020520616035]},"available":true,"name":"Galaxy S26 Ultra SolidX Harry Potter Sticker-Wizarding World - 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":"NST033740B-OO34","featured_media":{"alt":null,"id":27663999696995,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf04741e4d00489c06b44581aaa16782bd6d566b_9d45b1f3-fca8-4416-909f-897b4d8a3705.webp?v=1782992890"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44020520714339,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST03374O8-OO34","requires_shipping":true,"taxable":true,"featured_image":{"id":36159134597219,"product_id":7968420364387,"position":10,"created_at":"2026-07-02T19:48:09+08:00","updated_at":"2026-07-02T19:48:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a_1b848080-65c6-470e-a0f8-27841fa8b332.webp?v=1782992892","variant_ids":[44020520714339]},"available":true,"name":"Galaxy S26 Ultra SolidX Harry Potter Sticker-Wizarding World - 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":"NST03374O8-OO34","featured_media":{"alt":null,"id":27663999991907,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a_1b848080-65c6-470e-a0f8-27841fa8b332.webp?v=1782992892"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44020521205859,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"NST033740C-OO34","requires_shipping":true,"taxable":true,"featured_image":{"id":36159135449187,"product_id":7968420364387,"position":11,"created_at":"2026-07-02T19:48:10+08:00","updated_at":"2026-07-02T19:48:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43_3afbe3fe-8c7d-453c-8436-056b16da591b.webp?v=1782992892","variant_ids":[44020521205859]},"available":true,"name":"Galaxy S26 Ultra SolidX Harry Potter Sticker-Wizarding World - 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":"NST033740C-OO34","featured_media":{"alt":null,"id":27664000745571,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43_3afbe3fe-8c7d-453c-8436-056b16da591b.webp?v=1782992892"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43.webp?v=1771901730","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964.webp?v=1771901730","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf04741e4d00489c06b44581aaa16782bd6d566b.webp?v=1771901731","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a.webp?v=1771901732","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_14901825-fab9-49f9-8332-fabaf286d4a2.webp?v=1782992052","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a_f5adeea1-9a41-484d-897d-cda6b85705d6.webp?v=1782992053","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43_874f783b-59b8-4a68-8d2e-441cfeb655a5.webp?v=1782992053","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf04741e4d00489c06b44581aaa16782bd6d566b_9d45b1f3-fca8-4416-909f-897b4d8a3705.webp?v=1782992890","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_85acd6ea-3007-484e-8e1e-11b1ab8c1638.webp?v=1782992891","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a_1b848080-65c6-470e-a0f8-27841fa8b332.webp?v=1782992892","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43_3afbe3fe-8c7d-453c-8436-056b16da591b.webp?v=1782992892"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43.webp?v=1771901730","options":["color"],"media":[{"alt":null,"id":26877353197667,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43.webp?v=1771901730"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43.webp?v=1771901730","width":2000},{"alt":null,"id":26877353427043,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964.webp?v=1771901730"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964.webp?v=1771901730","width":2000},{"alt":null,"id":26877353721955,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf04741e4d00489c06b44581aaa16782bd6d566b.webp?v=1771901731"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf04741e4d00489c06b44581aaa16782bd6d566b.webp?v=1771901731","width":2000},{"alt":null,"id":26877354147939,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a.webp?v=1771901732"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a.webp?v=1771901732","width":2000},{"alt":null,"id":27663760982115,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_14901825-fab9-49f9-8332-fabaf286d4a2.webp?v=1782992052"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_14901825-fab9-49f9-8332-fabaf286d4a2.webp?v=1782992052","width":2000},{"alt":null,"id":27663761342563,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a_f5adeea1-9a41-484d-897d-cda6b85705d6.webp?v=1782992053"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a_f5adeea1-9a41-484d-897d-cda6b85705d6.webp?v=1782992053","width":2000},{"alt":null,"id":27663761670243,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43_874f783b-59b8-4a68-8d2e-441cfeb655a5.webp?v=1782992053"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43_874f783b-59b8-4a68-8d2e-441cfeb655a5.webp?v=1782992053","width":2000},{"alt":null,"id":27663999696995,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf04741e4d00489c06b44581aaa16782bd6d566b_9d45b1f3-fca8-4416-909f-897b4d8a3705.webp?v=1782992890"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf04741e4d00489c06b44581aaa16782bd6d566b_9d45b1f3-fca8-4416-909f-897b4d8a3705.webp?v=1782992890","width":2000},{"alt":null,"id":27663999729763,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_85acd6ea-3007-484e-8e1e-11b1ab8c1638.webp?v=1782992891"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_85acd6ea-3007-484e-8e1e-11b1ab8c1638.webp?v=1782992891","width":2000},{"alt":null,"id":27663999991907,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a_1b848080-65c6-470e-a0f8-27841fa8b332.webp?v=1782992892"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a_1b848080-65c6-470e-a0f8-27841fa8b332.webp?v=1782992892","width":2000},{"alt":null,"id":27664000745571,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43_3afbe3fe-8c7d-453c-8436-056b16da591b.webp?v=1782992892"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43_3afbe3fe-8c7d-453c-8436-056b16da591b.webp?v=1782992892","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":44020513996899,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0337452-OO34","requires_shipping":true,"taxable":true,"featured_image":{"id":36159133941859,"product_id":7968420364387,"position":9,"created_at":"2026-07-02T19:48:09+08:00","updated_at":"2026-07-02T19:48:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_85acd6ea-3007-484e-8e1e-11b1ab8c1638.webp?v=1782992891","variant_ids":[44020513996899]},"available":true,"name":"Galaxy S26 Ultra SolidX Harry Potter Sticker-Wizarding World - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0337452-OO34","featured_media":{"alt":null,"id":27663999729763,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_85acd6ea-3007-484e-8e1e-11b1ab8c1638.webp?v=1782992891"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44020520616035,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"NST033740B-OO34","requires_shipping":true,"taxable":true,"featured_image":{"id":36159133909091,"product_id":7968420364387,"position":8,"created_at":"2026-07-02T19:48:08+08:00","updated_at":"2026-07-02T19:48:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf04741e4d00489c06b44581aaa16782bd6d566b_9d45b1f3-fca8-4416-909f-897b4d8a3705.webp?v=1782992890","variant_ids":[44020520616035]},"available":true,"name":"Galaxy S26 Ultra SolidX Harry Potter Sticker-Wizarding World - 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":"NST033740B-OO34","featured_media":{"alt":null,"id":27663999696995,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf04741e4d00489c06b44581aaa16782bd6d566b_9d45b1f3-fca8-4416-909f-897b4d8a3705.webp?v=1782992890"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44020520714339,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST03374O8-OO34","requires_shipping":true,"taxable":true,"featured_image":{"id":36159134597219,"product_id":7968420364387,"position":10,"created_at":"2026-07-02T19:48:09+08:00","updated_at":"2026-07-02T19:48:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a_1b848080-65c6-470e-a0f8-27841fa8b332.webp?v=1782992892","variant_ids":[44020520714339]},"available":true,"name":"Galaxy S26 Ultra SolidX Harry Potter Sticker-Wizarding World - 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":"NST03374O8-OO34","featured_media":{"alt":null,"id":27663999991907,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/178965c3a501d126f6e2f9016b713ca9dc70642a_1b848080-65c6-470e-a0f8-27841fa8b332.webp?v=1782992892"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44020521205859,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"NST033740C-OO34","requires_shipping":true,"taxable":true,"featured_image":{"id":36159135449187,"product_id":7968420364387,"position":11,"created_at":"2026-07-02T19:48:10+08:00","updated_at":"2026-07-02T19:48:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43_3afbe3fe-8c7d-453c-8436-056b16da591b.webp?v=1782992892","variant_ids":[44020521205859]},"available":true,"name":"Galaxy S26 Ultra SolidX Harry Potter Sticker-Wizarding World - 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":"NST033740C-OO34","featured_media":{"alt":null,"id":27664000745571,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb19945d086022d3ba96f07d3b27e29b02198d43_3afbe3fe-8c7d-453c-8436-056b16da591b.webp?v=1782992892"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":44020513996899,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0337452-OO34","requires_shipping":true,"taxable":true,"featured_image":{"id":36159133941859,"product_id":7968420364387,"position":9,"created_at":"2026-07-02T19:48:09+08:00","updated_at":"2026-07-02T19:48:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_85acd6ea-3007-484e-8e1e-11b1ab8c1638.webp?v=1782992891","variant_ids":[44020513996899]},"available":true,"name":"Galaxy S26 Ultra SolidX Harry Potter Sticker-Wizarding World - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0337452-OO34","featured_media":{"alt":null,"id":27663999729763,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7dda50d4a3b55e552bd7cb6273f822d0f5aa3964_85acd6ea-3007-484e-8e1e-11b1ab8c1638.webp?v=1782992891"}},"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: "停產"
}