$product = {"id":7863461609571,"title":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-波士頓塞爾提克 Boston Celtics","handle":"iphone-17-pro-jellytint-with-capture-button-pm19","description":null,"published_at":"2025-09-10T18:21:12+08:00","created_at":"2025-08-22T19:06:21+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone 17 Pro","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":43609069125731,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013520G-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152523784291,"product_id":7863461609571,"position":13,"created_at":"2026-07-02T12:24:44+08:00","updated_at":"2026-07-02T12:24:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_2cf40a0b-08fe-457a-b52c-3aecbd0d275e.webp?v=1782966286","variant_ids":[43609069125731]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"JTB013520G-PM19","featured_media":{"alt":null,"id":27657397272675,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_2cf40a0b-08fe-457a-b52c-3aecbd0d275e.webp?v=1782966286"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609070207075,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"JTB013524M-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152523620451,"product_id":7863461609571,"position":12,"created_at":"2026-07-02T12:24:43+08:00","updated_at":"2026-07-02T12:24:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_2a595ae2-94d2-4dcb-8a1c-02b05f824f7c.webp?v=1782966285","variant_ids":[43609070207075]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"JTB013524M-PM19","featured_media":{"alt":null,"id":27657397108835,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_2a595ae2-94d2-4dcb-8a1c-02b05f824f7c.webp?v=1782966285"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609070239843,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"JTB013524L-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152523161699,"product_id":7863461609571,"position":11,"created_at":"2026-07-02T12:24:43+08:00","updated_at":"2026-07-02T12:24:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_63c83b85-4a62-4237-89b0-d1f5d66782d4.webp?v=1782966284","variant_ids":[43609070239843]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"JTB013524L-PM19","featured_media":{"alt":null,"id":27657396650083,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_63c83b85-4a62-4237-89b0-d1f5d66782d4.webp?v=1782966284"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM19_3f09f139-086a-4de2-8def-4fe4aac4cea2.png?v=1755860784","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b.webp?v=1782213352","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588.webp?v=1782213353","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb.webp?v=1782213353","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_68d63524-e4eb-4e72-a4d0-89e3bfb5b776.webp?v=1782958620","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_34c00834-32a5-4885-b692-0d4d933a4ff4.webp?v=1782958621","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_6fccf3c7-8ebb-496e-8e12-f1d17b5ed2dd.webp?v=1782958621","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_14264246-c1e7-47dd-8304-3970d19b276c.webp?v=1782961974","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_d7231990-675e-452c-8dbd-097cf02895fa.webp?v=1782961976","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_59fa33b8-641f-4825-8336-f92d328bc455.webp?v=1782961977","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_63c83b85-4a62-4237-89b0-d1f5d66782d4.webp?v=1782966284","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_2a595ae2-94d2-4dcb-8a1c-02b05f824f7c.webp?v=1782966285","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_2cf40a0b-08fe-457a-b52c-3aecbd0d275e.webp?v=1782966286"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM19_3f09f139-086a-4de2-8def-4fe4aac4cea2.png?v=1755860784","options":["color"],"media":[{"alt":null,"id":25941552496739,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM19_3f09f139-086a-4de2-8def-4fe4aac4cea2.png?v=1755860784"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM19_3f09f139-086a-4de2-8def-4fe4aac4cea2.png?v=1755860784","width":2000},{"alt":null,"id":27578469875811,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b.webp?v=1782213352"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b.webp?v=1782213352","width":2000},{"alt":null,"id":27578470105187,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588.webp?v=1782213353"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588.webp?v=1782213353","width":2000},{"alt":null,"id":27578470367331,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb.webp?v=1782213353"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb.webp?v=1782213353","width":2000},{"alt":null,"id":27656235483235,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_68d63524-e4eb-4e72-a4d0-89e3bfb5b776.webp?v=1782958620"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_68d63524-e4eb-4e72-a4d0-89e3bfb5b776.webp?v=1782958620","width":2000},{"alt":null,"id":27656236040291,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_34c00834-32a5-4885-b692-0d4d933a4ff4.webp?v=1782958621"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_34c00834-32a5-4885-b692-0d4d933a4ff4.webp?v=1782958621","width":2000},{"alt":null,"id":27656236564579,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_6fccf3c7-8ebb-496e-8e12-f1d17b5ed2dd.webp?v=1782958621"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_6fccf3c7-8ebb-496e-8e12-f1d17b5ed2dd.webp?v=1782958621","width":2000},{"alt":null,"id":27656896807011,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_14264246-c1e7-47dd-8304-3970d19b276c.webp?v=1782961974"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_14264246-c1e7-47dd-8304-3970d19b276c.webp?v=1782961974","width":2000},{"alt":null,"id":27656897429603,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_d7231990-675e-452c-8dbd-097cf02895fa.webp?v=1782961976"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_d7231990-675e-452c-8dbd-097cf02895fa.webp?v=1782961976","width":2000},{"alt":null,"id":27656897986659,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_59fa33b8-641f-4825-8336-f92d328bc455.webp?v=1782961977"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_59fa33b8-641f-4825-8336-f92d328bc455.webp?v=1782961977","width":2000},{"alt":null,"id":27657396650083,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_63c83b85-4a62-4237-89b0-d1f5d66782d4.webp?v=1782966284"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_63c83b85-4a62-4237-89b0-d1f5d66782d4.webp?v=1782966284","width":2000},{"alt":null,"id":27657397108835,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_2a595ae2-94d2-4dcb-8a1c-02b05f824f7c.webp?v=1782966285"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_2a595ae2-94d2-4dcb-8a1c-02b05f824f7c.webp?v=1782966285","width":2000},{"alt":null,"id":27657397272675,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_2cf40a0b-08fe-457a-b52c-3aecbd0d275e.webp?v=1782966286"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_2cf40a0b-08fe-457a-b52c-3aecbd0d275e.webp?v=1782966286","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43609069125731,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013520G-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152523784291,"product_id":7863461609571,"position":13,"created_at":"2026-07-02T12:24:44+08:00","updated_at":"2026-07-02T12:24:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_2cf40a0b-08fe-457a-b52c-3aecbd0d275e.webp?v=1782966286","variant_ids":[43609069125731]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"JTB013520G-PM19","featured_media":{"alt":null,"id":27657397272675,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_2cf40a0b-08fe-457a-b52c-3aecbd0d275e.webp?v=1782966286"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609070207075,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"JTB013524M-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152523620451,"product_id":7863461609571,"position":12,"created_at":"2026-07-02T12:24:43+08:00","updated_at":"2026-07-02T12:24:45+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_2a595ae2-94d2-4dcb-8a1c-02b05f824f7c.webp?v=1782966285","variant_ids":[43609070207075]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"JTB013524M-PM19","featured_media":{"alt":null,"id":27657397108835,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/38513ccb89b9737be2eebcd08cced19dcdc2f82b_2a595ae2-94d2-4dcb-8a1c-02b05f824f7c.webp?v=1782966285"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609070239843,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"JTB013524L-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152523161699,"product_id":7863461609571,"position":11,"created_at":"2026-07-02T12:24:43+08:00","updated_at":"2026-07-02T12:24:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_63c83b85-4a62-4237-89b0-d1f5d66782d4.webp?v=1782966284","variant_ids":[43609070239843]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"JTB013524L-PM19","featured_media":{"alt":null,"id":27657396650083,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b6892a8747fc3a9c79a6b0a1604fff0bc1973588_63c83b85-4a62-4237-89b0-d1f5d66782d4.webp?v=1782966284"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43609069125731,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013520G-PM19","requires_shipping":true,"taxable":true,"featured_image":{"id":36152523784291,"product_id":7863461609571,"position":13,"created_at":"2026-07-02T12:24:44+08:00","updated_at":"2026-07-02T12:24:46+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_2cf40a0b-08fe-457a-b52c-3aecbd0d275e.webp?v=1782966286","variant_ids":[43609069125731]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-波士頓塞爾提克 Boston Celtics - 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":"JTB013520G-PM19","featured_media":{"alt":null,"id":27657397272675,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/eb4014a357f2dd14ad0727d7fe88234fe5a410cb_2cf40a0b-08fe-457a-b52c-3aecbd0d275e.webp?v=1782966286"}},"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: "停產"
}