$product = {"id":7863160733795,"title":"iPhone Air Clear (相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers","handle":"iphone-air-jellytint-with-capture-button-pm10","description":null,"published_at":"2025-09-10T19:19:10+08:00","created_at":"2025-08-22T18:32:11+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone Air","merge","reseller-nba"],"price":128000,"price_min":128000,"price_max":128000,"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":43608176885859,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013510G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152576901219,"product_id":7863160733795,"position":13,"created_at":"2026-07-02T12:27:34+08:00","updated_at":"2026-07-02T12:27:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_c74951b9-12fd-4e1d-9118-c6c189259fbc.webp?v=1782966455","variant_ids":[43608176885859]},"available":true,"name":"iPhone Air Clear (相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"JTB013510G-PM10","featured_media":{"alt":null,"id":27657450356835,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_c74951b9-12fd-4e1d-9118-c6c189259fbc.webp?v=1782966455"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608177836131,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"JTB013514M-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152576245859,"product_id":7863160733795,"position":11,"created_at":"2026-07-02T12:27:32+08:00","updated_at":"2026-07-02T12:27:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_5cd106bc-4d17-427d-a3c7-9e07472e4160.webp?v=1782966454","variant_ids":[43608177836131]},"available":true,"name":"iPhone Air Clear (相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Nocturne Blue","public_title":"Nocturne Blue","options":["Nocturne Blue"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"JTB013514M-PM10","featured_media":{"alt":null,"id":27657449734243,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_5cd106bc-4d17-427d-a3c7-9e07472e4160.webp?v=1782966454"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608177868899,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"JTB013514L-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152576737379,"product_id":7863160733795,"position":12,"created_at":"2026-07-02T12:27:33+08:00","updated_at":"2026-07-02T12:27:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_ca15e511-d1d9-4115-ae68-f21db476a9f6.webp?v=1782966455","variant_ids":[43608177868899]},"available":true,"name":"iPhone Air Clear (相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Gleam Rosé","public_title":"Gleam Rosé","options":["Gleam Rosé"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"JTB013514L-PM10","featured_media":{"alt":null,"id":27657450225763,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_ca15e511-d1d9-4115-ae68-f21db476a9f6.webp?v=1782966455"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM10_6ca992f4-01b4-40b6-98e4-49acc6ad95b3.png?v=1755858734","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39.webp?v=1782218618","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d.webp?v=1782218619","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e.webp?v=1782218620","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_5b5cfa95-dd9f-466b-9649-f7dc799b3a54.webp?v=1782958870","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_229d3f70-aea9-42c6-837c-eca39031a4f9.webp?v=1782958870","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_95afe323-0efd-4b11-9011-c1be0208d4a3.webp?v=1782958871","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_321588b7-db31-4539-bb0e-1a02339296b4.webp?v=1782962206","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_ea652218-4942-4593-901f-d5be893763ab.webp?v=1782962211","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_d7e515c2-c026-4f5b-9a63-52ab57d0bcf9.webp?v=1782962213","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_5cd106bc-4d17-427d-a3c7-9e07472e4160.webp?v=1782966454","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_ca15e511-d1d9-4115-ae68-f21db476a9f6.webp?v=1782966455","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_c74951b9-12fd-4e1d-9118-c6c189259fbc.webp?v=1782966455"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM10_6ca992f4-01b4-40b6-98e4-49acc6ad95b3.png?v=1755858734","options":["color"],"media":[{"alt":null,"id":25941102526563,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM10_6ca992f4-01b4-40b6-98e4-49acc6ad95b3.png?v=1755858734"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM10_6ca992f4-01b4-40b6-98e4-49acc6ad95b3.png?v=1755858734","width":2000},{"alt":null,"id":27581558685795,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39.webp?v=1782218618"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39.webp?v=1782218618","width":2000},{"alt":null,"id":27581558849635,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d.webp?v=1782218619"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d.webp?v=1782218619","width":2000},{"alt":null,"id":27581559079011,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e.webp?v=1782218620"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e.webp?v=1782218620","width":2000},{"alt":null,"id":27656332935267,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_5b5cfa95-dd9f-466b-9649-f7dc799b3a54.webp?v=1782958870"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_5b5cfa95-dd9f-466b-9649-f7dc799b3a54.webp?v=1782958870","width":2000},{"alt":null,"id":27656333983843,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_229d3f70-aea9-42c6-837c-eca39031a4f9.webp?v=1782958870"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_229d3f70-aea9-42c6-837c-eca39031a4f9.webp?v=1782958870","width":2000},{"alt":null,"id":27656334868579,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_95afe323-0efd-4b11-9011-c1be0208d4a3.webp?v=1782958871"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_95afe323-0efd-4b11-9011-c1be0208d4a3.webp?v=1782958871","width":2000},{"alt":null,"id":27656946155619,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_321588b7-db31-4539-bb0e-1a02339296b4.webp?v=1782962206"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_321588b7-db31-4539-bb0e-1a02339296b4.webp?v=1782962206","width":2000},{"alt":null,"id":27656946614371,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_ea652218-4942-4593-901f-d5be893763ab.webp?v=1782962211"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_ea652218-4942-4593-901f-d5be893763ab.webp?v=1782962211","width":2000},{"alt":null,"id":27656947236963,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_d7e515c2-c026-4f5b-9a63-52ab57d0bcf9.webp?v=1782962213"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_d7e515c2-c026-4f5b-9a63-52ab57d0bcf9.webp?v=1782962213","width":2000},{"alt":null,"id":27657449734243,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_5cd106bc-4d17-427d-a3c7-9e07472e4160.webp?v=1782966454"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_5cd106bc-4d17-427d-a3c7-9e07472e4160.webp?v=1782966454","width":2000},{"alt":null,"id":27657450225763,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_ca15e511-d1d9-4115-ae68-f21db476a9f6.webp?v=1782966455"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_ca15e511-d1d9-4115-ae68-f21db476a9f6.webp?v=1782966455","width":2000},{"alt":null,"id":27657450356835,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_c74951b9-12fd-4e1d-9118-c6c189259fbc.webp?v=1782966455"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_c74951b9-12fd-4e1d-9118-c6c189259fbc.webp?v=1782966455","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43608176885859,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013510G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152576901219,"product_id":7863160733795,"position":13,"created_at":"2026-07-02T12:27:34+08:00","updated_at":"2026-07-02T12:27:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_c74951b9-12fd-4e1d-9118-c6c189259fbc.webp?v=1782966455","variant_ids":[43608176885859]},"available":true,"name":"iPhone Air Clear (相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"JTB013510G-PM10","featured_media":{"alt":null,"id":27657450356835,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_c74951b9-12fd-4e1d-9118-c6c189259fbc.webp?v=1782966455"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608177836131,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"JTB013514M-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152576245859,"product_id":7863160733795,"position":11,"created_at":"2026-07-02T12:27:32+08:00","updated_at":"2026-07-02T12:27:34+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_5cd106bc-4d17-427d-a3c7-9e07472e4160.webp?v=1782966454","variant_ids":[43608177836131]},"available":true,"name":"iPhone Air Clear (相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Nocturne Blue","public_title":"Nocturne Blue","options":["Nocturne Blue"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"JTB013514M-PM10","featured_media":{"alt":null,"id":27657449734243,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3d08956a479f6d836522c52f08d8fa48b6d4e04d_5cd106bc-4d17-427d-a3c7-9e07472e4160.webp?v=1782966454"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608177868899,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"JTB013514L-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152576737379,"product_id":7863160733795,"position":12,"created_at":"2026-07-02T12:27:33+08:00","updated_at":"2026-07-02T12:27:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_ca15e511-d1d9-4115-ae68-f21db476a9f6.webp?v=1782966455","variant_ids":[43608177868899]},"available":true,"name":"iPhone Air Clear (相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Gleam Rosé","public_title":"Gleam Rosé","options":["Gleam Rosé"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"JTB013514L-PM10","featured_media":{"alt":null,"id":27657450225763,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cd1297cb08bd57b1f2c0ea759c05e366f8521f39_ca15e511-d1d9-4115-ae68-f21db476a9f6.webp?v=1782966455"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43608176885859,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013510G-PM10","requires_shipping":true,"taxable":true,"featured_image":{"id":36152576901219,"product_id":7863160733795,"position":13,"created_at":"2026-07-02T12:27:34+08:00","updated_at":"2026-07-02T12:27:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_c74951b9-12fd-4e1d-9118-c6c189259fbc.webp?v=1782966455","variant_ids":[43608176885859]},"available":true,"name":"iPhone Air Clear (相機按鈕) NBA Logo-洛杉磯湖人 L.A. Lakers - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":128000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"JTB013510G-PM10","featured_media":{"alt":null,"id":27657450356835,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/03fe53e8f9f3f262d5df24f06d5b4d8ba17d626e_c74951b9-12fd-4e1d-9118-c6c189259fbc.webp?v=1782966455"}},"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: "停產"
}