$product = {"id":7937555824739,"title":"iPhone 13 Pro Max Mod NX Jin Young Choi 小心輕放","handle":"iphone-13-pro-max-mod-nx-cjy13","description":null,"published_at":"2025-12-12T09:50:31+08:00","created_at":"2025-12-11T09:44:37+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-jychoioioi","device-iPhone 13 Pro Max","merge","reseller-jychoioioi"],"price":90000,"price_min":90000,"price_max":90000,"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":43882962157667,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01232J5-CJY13","requires_shipping":true,"taxable":true,"featured_image":{"id":34930963546211,"product_id":7937555824739,"position":14,"created_at":"2025-12-11T09:53:24+08:00","updated_at":"2025-12-11T09:53:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b_bf57d82a-16e7-4174-86a0-ee174da480a3.webp?v=1765418006","variant_ids":[43882962157667]},"available":true,"name":"iPhone 13 Pro Max Mod NX Jin Young Choi 小心輕放 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01232J5-CJY13","featured_media":{"alt":null,"id":26493337895011,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b_bf57d82a-16e7-4174-86a0-ee174da480a3.webp?v=1765418006"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43882962190435,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0123224-CJY13","requires_shipping":true,"taxable":true,"featured_image":{"id":34930962759779,"product_id":7937555824739,"position":11,"created_at":"2025-12-11T09:53:22+08:00","updated_at":"2025-12-11T09:53:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b4a6978fc45315d29cd06aac11176eab24bd1d13_38c72a7e-7159-4778-965b-7d541f5d33ff.webp?v=1765418004","variant_ids":[43882962190435]},"available":true,"name":"iPhone 13 Pro Max Mod NX Jin Young Choi 小心輕放 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0123224-CJY13","featured_media":{"alt":null,"id":26493337108579,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b4a6978fc45315d29cd06aac11176eab24bd1d13_38c72a7e-7159-4778-965b-7d541f5d33ff.webp?v=1765418004"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b75538bfe3680dd493adca7d9e4874df5fd61c30.webp?v=1765417483","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3f183e8ad6bc12e4850f07dc7a2dd7d147058a6.webp?v=1765417483","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b.webp?v=1765417486","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a04bd068c3d29aaa19dc2804be07134e1284cd96.webp?v=1765417486","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846f3949c65f3048103a3ebd80b3b3b81b9feda2.webp?v=1765417487","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c25977634823e97fda6e3db7c94b8a45d9f06cd6.webp?v=1765417487","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b4a6978fc45315d29cd06aac11176eab24bd1d13.webp?v=1765417488","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee3e784547c23adabe08277c030ca82aab574d64.webp?v=1765417489","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addb732a4f782f398ccda1d223940ba1dbf67c08.webp?v=1765417489","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee3e784547c23adabe08277c030ca82aab574d64_138c6788-a873-442a-86e2-431237e8aea5.webp?v=1765418003","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b4a6978fc45315d29cd06aac11176eab24bd1d13_38c72a7e-7159-4778-965b-7d541f5d33ff.webp?v=1765418004","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3f183e8ad6bc12e4850f07dc7a2dd7d147058a6_b989e379-50df-4aa1-808c-765d67f083c9.webp?v=1765418004","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a04bd068c3d29aaa19dc2804be07134e1284cd96_1127b161-6b77-4da9-9f9d-14f7dcaaaef7.webp?v=1765418005","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b_bf57d82a-16e7-4174-86a0-ee174da480a3.webp?v=1765418006","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846f3949c65f3048103a3ebd80b3b3b81b9feda2_95ceb3fa-1544-49e2-b0e6-5d3d7faf15a0.webp?v=1765418006","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b75538bfe3680dd493adca7d9e4874df5fd61c30_50a81931-d3e8-43e9-87cb-2a65d72fa443.webp?v=1765418006","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c25977634823e97fda6e3db7c94b8a45d9f06cd6_16c6e342-c774-4c06-b9ec-bc25059df64c.webp?v=1765418007","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addb732a4f782f398ccda1d223940ba1dbf67c08_78769a69-396c-4ec8-a8d4-d268f0ce6a2f.webp?v=1765418008"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b75538bfe3680dd493adca7d9e4874df5fd61c30.webp?v=1765417483","options":["color"],"media":[{"alt":null,"id":26493204627555,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b75538bfe3680dd493adca7d9e4874df5fd61c30.webp?v=1765417483"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b75538bfe3680dd493adca7d9e4874df5fd61c30.webp?v=1765417483","width":2000},{"alt":null,"id":26493204758627,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3f183e8ad6bc12e4850f07dc7a2dd7d147058a6.webp?v=1765417483"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3f183e8ad6bc12e4850f07dc7a2dd7d147058a6.webp?v=1765417483","width":2000},{"alt":null,"id":26493205020771,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b.webp?v=1765417486"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b.webp?v=1765417486","width":2000},{"alt":null,"id":26493205413987,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a04bd068c3d29aaa19dc2804be07134e1284cd96.webp?v=1765417486"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a04bd068c3d29aaa19dc2804be07134e1284cd96.webp?v=1765417486","width":2000},{"alt":null,"id":26493205610595,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846f3949c65f3048103a3ebd80b3b3b81b9feda2.webp?v=1765417487"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846f3949c65f3048103a3ebd80b3b3b81b9feda2.webp?v=1765417487","width":2000},{"alt":null,"id":26493205839971,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c25977634823e97fda6e3db7c94b8a45d9f06cd6.webp?v=1765417487"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c25977634823e97fda6e3db7c94b8a45d9f06cd6.webp?v=1765417487","width":2000},{"alt":null,"id":26493206036579,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b4a6978fc45315d29cd06aac11176eab24bd1d13.webp?v=1765417488"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b4a6978fc45315d29cd06aac11176eab24bd1d13.webp?v=1765417488","width":2000},{"alt":null,"id":26493206233187,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee3e784547c23adabe08277c030ca82aab574d64.webp?v=1765417489"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee3e784547c23adabe08277c030ca82aab574d64.webp?v=1765417489","width":2000},{"alt":null,"id":26493206397027,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addb732a4f782f398ccda1d223940ba1dbf67c08.webp?v=1765417489"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addb732a4f782f398ccda1d223940ba1dbf67c08.webp?v=1765417489","width":2000},{"alt":null,"id":26493336879203,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee3e784547c23adabe08277c030ca82aab574d64_138c6788-a873-442a-86e2-431237e8aea5.webp?v=1765418003"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee3e784547c23adabe08277c030ca82aab574d64_138c6788-a873-442a-86e2-431237e8aea5.webp?v=1765418003","width":2000},{"alt":null,"id":26493337108579,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b4a6978fc45315d29cd06aac11176eab24bd1d13_38c72a7e-7159-4778-965b-7d541f5d33ff.webp?v=1765418004"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b4a6978fc45315d29cd06aac11176eab24bd1d13_38c72a7e-7159-4778-965b-7d541f5d33ff.webp?v=1765418004","width":2000},{"alt":null,"id":26493337370723,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3f183e8ad6bc12e4850f07dc7a2dd7d147058a6_b989e379-50df-4aa1-808c-765d67f083c9.webp?v=1765418004"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3f183e8ad6bc12e4850f07dc7a2dd7d147058a6_b989e379-50df-4aa1-808c-765d67f083c9.webp?v=1765418004","width":2000},{"alt":null,"id":26493337632867,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a04bd068c3d29aaa19dc2804be07134e1284cd96_1127b161-6b77-4da9-9f9d-14f7dcaaaef7.webp?v=1765418005"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a04bd068c3d29aaa19dc2804be07134e1284cd96_1127b161-6b77-4da9-9f9d-14f7dcaaaef7.webp?v=1765418005","width":2000},{"alt":null,"id":26493337895011,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b_bf57d82a-16e7-4174-86a0-ee174da480a3.webp?v=1765418006"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b_bf57d82a-16e7-4174-86a0-ee174da480a3.webp?v=1765418006","width":2000},{"alt":null,"id":26493338091619,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846f3949c65f3048103a3ebd80b3b3b81b9feda2_95ceb3fa-1544-49e2-b0e6-5d3d7faf15a0.webp?v=1765418006"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/846f3949c65f3048103a3ebd80b3b3b81b9feda2_95ceb3fa-1544-49e2-b0e6-5d3d7faf15a0.webp?v=1765418006","width":2000},{"alt":null,"id":26493338320995,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b75538bfe3680dd493adca7d9e4874df5fd61c30_50a81931-d3e8-43e9-87cb-2a65d72fa443.webp?v=1765418006"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b75538bfe3680dd493adca7d9e4874df5fd61c30_50a81931-d3e8-43e9-87cb-2a65d72fa443.webp?v=1765418006","width":2000},{"alt":null,"id":26493338419299,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c25977634823e97fda6e3db7c94b8a45d9f06cd6_16c6e342-c774-4c06-b9ec-bc25059df64c.webp?v=1765418007"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c25977634823e97fda6e3db7c94b8a45d9f06cd6_16c6e342-c774-4c06-b9ec-bc25059df64c.webp?v=1765418007","width":2000},{"alt":null,"id":26493338517603,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addb732a4f782f398ccda1d223940ba1dbf67c08_78769a69-396c-4ec8-a8d4-d268f0ce6a2f.webp?v=1765418008"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/addb732a4f782f398ccda1d223940ba1dbf67c08_78769a69-396c-4ec8-a8d4-d268f0ce6a2f.webp?v=1765418008","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$bumper = null;
$variants = [{"id":43882962157667,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01232J5-CJY13","requires_shipping":true,"taxable":true,"featured_image":{"id":34930963546211,"product_id":7937555824739,"position":14,"created_at":"2025-12-11T09:53:24+08:00","updated_at":"2025-12-11T09:53:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b_bf57d82a-16e7-4174-86a0-ee174da480a3.webp?v=1765418006","variant_ids":[43882962157667]},"available":true,"name":"iPhone 13 Pro Max Mod NX Jin Young Choi 小心輕放 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01232J5-CJY13","featured_media":{"alt":null,"id":26493337895011,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b_bf57d82a-16e7-4174-86a0-ee174da480a3.webp?v=1765418006"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43882962190435,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0123224-CJY13","requires_shipping":true,"taxable":true,"featured_image":{"id":34930962759779,"product_id":7937555824739,"position":11,"created_at":"2025-12-11T09:53:22+08:00","updated_at":"2025-12-11T09:53:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b4a6978fc45315d29cd06aac11176eab24bd1d13_38c72a7e-7159-4778-965b-7d541f5d33ff.webp?v=1765418004","variant_ids":[43882962190435]},"available":true,"name":"iPhone 13 Pro Max Mod NX Jin Young Choi 小心輕放 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0123224-CJY13","featured_media":{"alt":null,"id":26493337108579,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b4a6978fc45315d29cd06aac11176eab24bd1d13_38c72a7e-7159-4778-965b-7d541f5d33ff.webp?v=1765418004"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43882962157667,"title":"Navy Blue","option1":"Navy Blue","option2":null,"option3":null,"sku":"NPB01232J5-CJY13","requires_shipping":true,"taxable":true,"featured_image":{"id":34930963546211,"product_id":7937555824739,"position":14,"created_at":"2025-12-11T09:53:24+08:00","updated_at":"2025-12-11T09:53:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b_bf57d82a-16e7-4174-86a0-ee174da480a3.webp?v=1765418006","variant_ids":[43882962157667]},"available":true,"name":"iPhone 13 Pro Max Mod NX Jin Young Choi 小心輕放 - Navy Blue","public_title":"Navy Blue","options":["Navy Blue"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB01232J5-CJY13","featured_media":{"alt":null,"id":26493337895011,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6804d1a6e3b1f00e9a34ece533c6a1d309788f9b_bf57d82a-16e7-4174-86a0-ee174da480a3.webp?v=1765418006"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}};
$device_handle = null
var sellingStatus
if ($bumper) {
$(document).ready(function() {
var productImg = $product.images[0]
var bumperVariants = $bumper.variants;
var bumperColors = new Object();
var currentVariant = '';
var productType = '';
bumperVariants.forEach(variant => {
bumperColors[`${variant.title.split(' (')[0].toLowerCase()}`] = variant.featured_image.src;
});
if (productType === 'mod-nx-backplate' || productType === 'mod-backplate') {
mergeImages(
[productImg, bumperColors[currentVariant]],
{ crossOrigin: 'anonymous' }
).then(mergedImg => {
$('.merged-img').attr('src', mergedImg);
});
} else {
mergeImages(
[bumperColors[currentVariant], productImg],
{ crossOrigin: 'anonymous' }
).then(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: "停產"
}