$product = {"id":7921145151587,"title":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 公園裡的格爾尼卡","handle":"iphone-15-plus-mod-nx-hd72","description":null,"published_at":"2025-11-13T09:47:40+08:00","created_at":"2025-11-11T09:49:29+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 15 Plus","merge","reseller-incrediville"],"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":43830943055971,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0129624-HD72","requires_shipping":true,"taxable":true,"featured_image":{"id":34793922691171,"product_id":7921145151587,"position":15,"created_at":"2025-11-13T09:27:52+08:00","updated_at":"2025-11-13T09:27:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e_a628c1b6-2a90-4fad-883f-df0a4e03d2c9.webp?v=1762997274","variant_ids":[43830943055971]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 公園裡的格爾尼卡 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129624-HD72","featured_media":{"alt":null,"id":26359342989411,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e_a628c1b6-2a90-4fad-883f-df0a4e03d2c9.webp?v=1762997274"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830943252579,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0129657-HD72","requires_shipping":true,"taxable":true,"featured_image":{"id":34793923051619,"product_id":7921145151587,"position":17,"created_at":"2025-11-13T09:27:53+08:00","updated_at":"2025-11-13T09:27:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/554cea1f5a41f37bda63be571a0ad1d80045796e_7860f9c9-49b3-4558-897c-fd37d88d1510.webp?v=1762997275","variant_ids":[43830943252579]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 公園裡的格爾尼卡 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129657-HD72","featured_media":{"alt":null,"id":26359343382627,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/554cea1f5a41f37bda63be571a0ad1d80045796e_7860f9c9-49b3-4558-897c-fd37d88d1510.webp?v=1762997275"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3964ff8f6a4a7cbb1a60579e407da335c007914.webp?v=1762825776","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e.webp?v=1762825777","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e5d776db9f006a3d3552232672cd6d9533f7414.webp?v=1762825778","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/160746a92c62ac4ac118bbc3f4e113c1fbab0ae6.webp?v=1762825778","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/495f83d34c6e162ff9098bb76fe5f267e6783676.webp?v=1762825779","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/554cea1f5a41f37bda63be571a0ad1d80045796e.webp?v=1762825780","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1d52b724dbc0ba3bc1ac0db438075598a284e0e4.webp?v=1762825781","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b437849abdf0e5656e28f924c5879be954e29c32.webp?v=1762825781","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6cacbcdcdc04763b97a10d1bc2b512cb185dd19c.webp?v=1762825783","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/495f83d34c6e162ff9098bb76fe5f267e6783676_1e07bfa8-0142-4245-9776-2a78e2bbc966.webp?v=1762997270","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1d52b724dbc0ba3bc1ac0db438075598a284e0e4_bde7cfea-2384-4b9f-90db-439033601fec.webp?v=1762997271","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6cacbcdcdc04763b97a10d1bc2b512cb185dd19c_951d8a01-3b74-4286-a3cd-6b5687a048ba.webp?v=1762997272","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/160746a92c62ac4ac118bbc3f4e113c1fbab0ae6_ee969a62-a07d-4e37-b1fe-c44fb146f62d.webp?v=1762997272","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3964ff8f6a4a7cbb1a60579e407da335c007914_eaa5a0a9-7e8f-4ad1-b383-470334c4eef6.webp?v=1762997273","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e_a628c1b6-2a90-4fad-883f-df0a4e03d2c9.webp?v=1762997274","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e5d776db9f006a3d3552232672cd6d9533f7414_294e05b1-1e4b-44d4-bcb1-ddd4b2661766.webp?v=1762997275","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/554cea1f5a41f37bda63be571a0ad1d80045796e_7860f9c9-49b3-4558-897c-fd37d88d1510.webp?v=1762997275","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b437849abdf0e5656e28f924c5879be954e29c32_4e8b4ded-d970-4991-826e-f613bae76818.webp?v=1762997276"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3964ff8f6a4a7cbb1a60579e407da335c007914.webp?v=1762825776","options":["color"],"media":[{"alt":null,"id":26351704572003,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3964ff8f6a4a7cbb1a60579e407da335c007914.webp?v=1762825776"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3964ff8f6a4a7cbb1a60579e407da335c007914.webp?v=1762825776","width":2000},{"alt":null,"id":26351705063523,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e.webp?v=1762825777"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e.webp?v=1762825777","width":2000},{"alt":null,"id":26351705292899,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e5d776db9f006a3d3552232672cd6d9533f7414.webp?v=1762825778"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e5d776db9f006a3d3552232672cd6d9533f7414.webp?v=1762825778","width":2000},{"alt":null,"id":26351705489507,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/160746a92c62ac4ac118bbc3f4e113c1fbab0ae6.webp?v=1762825778"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/160746a92c62ac4ac118bbc3f4e113c1fbab0ae6.webp?v=1762825778","width":2000},{"alt":null,"id":26351705718883,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/495f83d34c6e162ff9098bb76fe5f267e6783676.webp?v=1762825779"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/495f83d34c6e162ff9098bb76fe5f267e6783676.webp?v=1762825779","width":2000},{"alt":null,"id":26351705981027,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/554cea1f5a41f37bda63be571a0ad1d80045796e.webp?v=1762825780"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/554cea1f5a41f37bda63be571a0ad1d80045796e.webp?v=1762825780","width":2000},{"alt":null,"id":26351706275939,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1d52b724dbc0ba3bc1ac0db438075598a284e0e4.webp?v=1762825781"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1d52b724dbc0ba3bc1ac0db438075598a284e0e4.webp?v=1762825781","width":2000},{"alt":null,"id":26351706570851,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b437849abdf0e5656e28f924c5879be954e29c32.webp?v=1762825781"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b437849abdf0e5656e28f924c5879be954e29c32.webp?v=1762825781","width":2000},{"alt":null,"id":26351706898531,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6cacbcdcdc04763b97a10d1bc2b512cb185dd19c.webp?v=1762825783"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6cacbcdcdc04763b97a10d1bc2b512cb185dd19c.webp?v=1762825783","width":2000},{"alt":null,"id":26359341547619,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/495f83d34c6e162ff9098bb76fe5f267e6783676_1e07bfa8-0142-4245-9776-2a78e2bbc966.webp?v=1762997270"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/495f83d34c6e162ff9098bb76fe5f267e6783676_1e07bfa8-0142-4245-9776-2a78e2bbc966.webp?v=1762997270","width":2000},{"alt":null,"id":26359341678691,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1d52b724dbc0ba3bc1ac0db438075598a284e0e4_bde7cfea-2384-4b9f-90db-439033601fec.webp?v=1762997271"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1d52b724dbc0ba3bc1ac0db438075598a284e0e4_bde7cfea-2384-4b9f-90db-439033601fec.webp?v=1762997271","width":2000},{"alt":null,"id":26359341973603,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6cacbcdcdc04763b97a10d1bc2b512cb185dd19c_951d8a01-3b74-4286-a3cd-6b5687a048ba.webp?v=1762997272"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6cacbcdcdc04763b97a10d1bc2b512cb185dd19c_951d8a01-3b74-4286-a3cd-6b5687a048ba.webp?v=1762997272","width":2000},{"alt":null,"id":26359342399587,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/160746a92c62ac4ac118bbc3f4e113c1fbab0ae6_ee969a62-a07d-4e37-b1fe-c44fb146f62d.webp?v=1762997272"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/160746a92c62ac4ac118bbc3f4e113c1fbab0ae6_ee969a62-a07d-4e37-b1fe-c44fb146f62d.webp?v=1762997272","width":2000},{"alt":null,"id":26359342694499,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3964ff8f6a4a7cbb1a60579e407da335c007914_eaa5a0a9-7e8f-4ad1-b383-470334c4eef6.webp?v=1762997273"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f3964ff8f6a4a7cbb1a60579e407da335c007914_eaa5a0a9-7e8f-4ad1-b383-470334c4eef6.webp?v=1762997273","width":2000},{"alt":null,"id":26359342989411,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e_a628c1b6-2a90-4fad-883f-df0a4e03d2c9.webp?v=1762997274"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e_a628c1b6-2a90-4fad-883f-df0a4e03d2c9.webp?v=1762997274","width":2000},{"alt":null,"id":26359343186019,"position":16,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e5d776db9f006a3d3552232672cd6d9533f7414_294e05b1-1e4b-44d4-bcb1-ddd4b2661766.webp?v=1762997275"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0e5d776db9f006a3d3552232672cd6d9533f7414_294e05b1-1e4b-44d4-bcb1-ddd4b2661766.webp?v=1762997275","width":2000},{"alt":null,"id":26359343382627,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/554cea1f5a41f37bda63be571a0ad1d80045796e_7860f9c9-49b3-4558-897c-fd37d88d1510.webp?v=1762997275"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/554cea1f5a41f37bda63be571a0ad1d80045796e_7860f9c9-49b3-4558-897c-fd37d88d1510.webp?v=1762997275","width":2000},{"alt":null,"id":26359343612003,"position":18,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b437849abdf0e5656e28f924c5879be954e29c32_4e8b4ded-d970-4991-826e-f613bae76818.webp?v=1762997276"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b437849abdf0e5656e28f924c5879be954e29c32_4e8b4ded-d970-4991-826e-f613bae76818.webp?v=1762997276","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43830943055971,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0129624-HD72","requires_shipping":true,"taxable":true,"featured_image":{"id":34793922691171,"product_id":7921145151587,"position":15,"created_at":"2025-11-13T09:27:52+08:00","updated_at":"2025-11-13T09:27:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e_a628c1b6-2a90-4fad-883f-df0a4e03d2c9.webp?v=1762997274","variant_ids":[43830943055971]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 公園裡的格爾尼卡 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129624-HD72","featured_media":{"alt":null,"id":26359342989411,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e_a628c1b6-2a90-4fad-883f-df0a4e03d2c9.webp?v=1762997274"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830943252579,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NPB0129657-HD72","requires_shipping":true,"taxable":true,"featured_image":{"id":34793923051619,"product_id":7921145151587,"position":17,"created_at":"2025-11-13T09:27:53+08:00","updated_at":"2025-11-13T09:27:55+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/554cea1f5a41f37bda63be571a0ad1d80045796e_7860f9c9-49b3-4558-897c-fd37d88d1510.webp?v=1762997275","variant_ids":[43830943252579]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 公園裡的格爾尼卡 - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129657-HD72","featured_media":{"alt":null,"id":26359343382627,"position":17,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/554cea1f5a41f37bda63be571a0ad1d80045796e_7860f9c9-49b3-4558-897c-fd37d88d1510.webp?v=1762997275"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43830943055971,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NPB0129624-HD72","requires_shipping":true,"taxable":true,"featured_image":{"id":34793922691171,"product_id":7921145151587,"position":15,"created_at":"2025-11-13T09:27:52+08:00","updated_at":"2025-11-13T09:27:54+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e_a628c1b6-2a90-4fad-883f-df0a4e03d2c9.webp?v=1762997274","variant_ids":[43830943055971]},"available":true,"name":"iPhone 15 Plus Mod NX Incrediville 怪奇事物所 公園裡的格爾尼卡 - Black","public_title":"Black","options":["Black"],"price":90000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NPB0129624-HD72","featured_media":{"alt":null,"id":26359342989411,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/44b3c51914311bf41b2f8c2132b11818ad13370e_a628c1b6-2a90-4fad-883f-df0a4e03d2c9.webp?v=1762997274"}},"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: "停產"
}