$product = {"id":7863049060451,"title":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light","handle":"iphone-air-jellytint-magsafe-with-capture-button-pm03","description":null,"published_at":"2025-09-10T19:41:21+08:00","created_at":"2025-08-22T18:20:57+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":148000,"price_min":148000,"price_max":148000,"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":43607841800291,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013510G-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152575000675,"product_id":7863049060451,"position":13,"created_at":"2026-07-02T12:27:27+08:00","updated_at":"2026-07-02T12:27:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_3e389215-1101-4877-b95b-58ad75fdc313.webp?v=1782966449","variant_ids":[43607841800291]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013510G-PM03","featured_media":{"alt":null,"id":27657448489059,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_3e389215-1101-4877-b95b-58ad75fdc313.webp?v=1782966449"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43607842848867,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"MJB013514M-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152574869603,"product_id":7863049060451,"position":12,"created_at":"2026-07-02T12:27:27+08:00","updated_at":"2026-07-02T12:27:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_a0c4c936-cee5-4161-82ff-b40475708733.webp?v=1782966449","variant_ids":[43607842848867]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Nocturne Blue","public_title":"Nocturne Blue","options":["Nocturne Blue"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013514M-PM03","featured_media":{"alt":null,"id":27657448325219,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_a0c4c936-cee5-4161-82ff-b40475708733.webp?v=1782966449"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43607842881635,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"MJB013514L-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152574738531,"product_id":7863049060451,"position":11,"created_at":"2026-07-02T12:27:26+08:00","updated_at":"2026-07-02T12:27:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_fa80d1bc-bf89-4bbb-855a-267e02376e47.webp?v=1782966448","variant_ids":[43607842881635]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Gleam Rosé","public_title":"Gleam Rosé","options":["Gleam Rosé"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013514L-PM03","featured_media":{"alt":null,"id":27657448226915,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_fa80d1bc-bf89-4bbb-855a-267e02376e47.webp?v=1782966448"}},"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-PM03_478e25cc-ed57-45a3-b208-185460e6e413.png?v=1755858061","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed.webp?v=1782215301","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3.webp?v=1782215302","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29.webp?v=1782215303","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_3410e4d9-293a-4498-85d6-62519b337463.webp?v=1782958868","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_b195a21b-65c0-4fb8-9f8f-eba56ac3a2cb.webp?v=1782958869","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_c0615074-7144-4a0f-9668-249de26962c3.webp?v=1782958870","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_0ee8b38d-b570-488c-99dc-7a638d09fa74.webp?v=1782962207","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_0347cb37-963d-44d9-8bae-0c42eba261a8.webp?v=1782962212","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_236a05a9-f03e-4f9a-b817-3e3ccb27144f.webp?v=1782962213","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_fa80d1bc-bf89-4bbb-855a-267e02376e47.webp?v=1782966448","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_a0c4c936-cee5-4161-82ff-b40475708733.webp?v=1782966449","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_3e389215-1101-4877-b95b-58ad75fdc313.webp?v=1782966449"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM03_478e25cc-ed57-45a3-b208-185460e6e413.png?v=1755858061","options":["color"],"media":[{"alt":null,"id":25940932395107,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM03_478e25cc-ed57-45a3-b208-185460e6e413.png?v=1755858061"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-351-PM03_478e25cc-ed57-45a3-b208-185460e6e413.png?v=1755858061","width":2000},{"alt":null,"id":27580161753187,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed.webp?v=1782215301"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed.webp?v=1782215301","width":2000},{"alt":null,"id":27580162474083,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3.webp?v=1782215302"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3.webp?v=1782215302","width":2000},{"alt":null,"id":27580162900067,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29.webp?v=1782215303"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29.webp?v=1782215303","width":2000},{"alt":null,"id":27656331264099,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_3410e4d9-293a-4498-85d6-62519b337463.webp?v=1782958868"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_3410e4d9-293a-4498-85d6-62519b337463.webp?v=1782958868","width":2000},{"alt":null,"id":27656332050531,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_b195a21b-65c0-4fb8-9f8f-eba56ac3a2cb.webp?v=1782958869"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_b195a21b-65c0-4fb8-9f8f-eba56ac3a2cb.webp?v=1782958869","width":2000},{"alt":null,"id":27656332869731,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_c0615074-7144-4a0f-9668-249de26962c3.webp?v=1782958870"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_c0615074-7144-4a0f-9668-249de26962c3.webp?v=1782958870","width":2000},{"alt":null,"id":27656946286691,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_0ee8b38d-b570-488c-99dc-7a638d09fa74.webp?v=1782962207"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_0ee8b38d-b570-488c-99dc-7a638d09fa74.webp?v=1782962207","width":2000},{"alt":null,"id":27656946876515,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_0347cb37-963d-44d9-8bae-0c42eba261a8.webp?v=1782962212"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_0347cb37-963d-44d9-8bae-0c42eba261a8.webp?v=1782962212","width":2000},{"alt":null,"id":27656947368035,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_236a05a9-f03e-4f9a-b817-3e3ccb27144f.webp?v=1782962213"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_236a05a9-f03e-4f9a-b817-3e3ccb27144f.webp?v=1782962213","width":2000},{"alt":null,"id":27657448226915,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_fa80d1bc-bf89-4bbb-855a-267e02376e47.webp?v=1782966448"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_fa80d1bc-bf89-4bbb-855a-267e02376e47.webp?v=1782966448","width":2000},{"alt":null,"id":27657448325219,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_a0c4c936-cee5-4161-82ff-b40475708733.webp?v=1782966449"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_a0c4c936-cee5-4161-82ff-b40475708733.webp?v=1782966449","width":2000},{"alt":null,"id":27657448489059,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_3e389215-1101-4877-b95b-58ad75fdc313.webp?v=1782966449"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_3e389215-1101-4877-b95b-58ad75fdc313.webp?v=1782966449","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43607841800291,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013510G-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152575000675,"product_id":7863049060451,"position":13,"created_at":"2026-07-02T12:27:27+08:00","updated_at":"2026-07-02T12:27:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_3e389215-1101-4877-b95b-58ad75fdc313.webp?v=1782966449","variant_ids":[43607841800291]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013510G-PM03","featured_media":{"alt":null,"id":27657448489059,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_3e389215-1101-4877-b95b-58ad75fdc313.webp?v=1782966449"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43607842848867,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"MJB013514M-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152574869603,"product_id":7863049060451,"position":12,"created_at":"2026-07-02T12:27:27+08:00","updated_at":"2026-07-02T12:27:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_a0c4c936-cee5-4161-82ff-b40475708733.webp?v=1782966449","variant_ids":[43607842848867]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Nocturne Blue","public_title":"Nocturne Blue","options":["Nocturne Blue"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013514M-PM03","featured_media":{"alt":null,"id":27657448325219,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/608adf6d71d568c5e5680515dc9e437fda64b7ed_a0c4c936-cee5-4161-82ff-b40475708733.webp?v=1782966449"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43607842881635,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"MJB013514L-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152574738531,"product_id":7863049060451,"position":11,"created_at":"2026-07-02T12:27:26+08:00","updated_at":"2026-07-02T12:27:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_fa80d1bc-bf89-4bbb-855a-267e02376e47.webp?v=1782966448","variant_ids":[43607842881635]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Gleam Rosé","public_title":"Gleam Rosé","options":["Gleam Rosé"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013514L-PM03","featured_media":{"alt":null,"id":27657448226915,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a1a1955a3353c2b6fa0c0db859d4f892cd38c6f3_fa80d1bc-bf89-4bbb-855a-267e02376e47.webp?v=1782966448"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43607841800291,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013510G-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152575000675,"product_id":7863049060451,"position":13,"created_at":"2026-07-02T12:27:27+08:00","updated_at":"2026-07-02T12:27:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_3e389215-1101-4877-b95b-58ad75fdc313.webp?v=1782966449","variant_ids":[43607841800291]},"available":true,"name":"iPhone Air Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MJB013510G-PM03","featured_media":{"alt":null,"id":27657448489059,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/011809962d4484c4e48d7e57964284a12acfda29_3e389215-1101-4877-b95b-58ad75fdc313.webp?v=1782966449"}},"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: "停產"
}