$product = {"id":7863407312995,"title":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light","handle":"iphone-17-pro-jellytint-with-capture-button-pm03","description":null,"published_at":"2025-09-10T18:31:52+08:00","created_at":"2025-08-22T19:00:43+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":43608905810019,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013520G-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152522637411,"product_id":7863407312995,"position":13,"created_at":"2026-07-02T12:24:42+08:00","updated_at":"2026-07-02T12:24:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_325c2f38-c403-4d19-9928-c63dc9530678.webp?v=1782966284","variant_ids":[43608905810019]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - 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-PM03","featured_media":{"alt":null,"id":27657396125795,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_325c2f38-c403-4d19-9928-c63dc9530678.webp?v=1782966284"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608906793059,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"JTB013524M-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152521621603,"product_id":7863407312995,"position":11,"created_at":"2026-07-02T12:24:41+08:00","updated_at":"2026-07-02T12:24:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_f2c7161a-6a0b-4a30-b218-b6613e34189a.webp?v=1782966282","variant_ids":[43608906793059]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - 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-PM03","featured_media":{"alt":null,"id":27657395109987,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_f2c7161a-6a0b-4a30-b218-b6613e34189a.webp?v=1782966282"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608906825827,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"JTB013524L-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152522080355,"product_id":7863407312995,"position":12,"created_at":"2026-07-02T12:24:41+08:00","updated_at":"2026-07-02T12:24:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_d68420c4-8088-4335-bcdf-8e4c7af7d848.webp?v=1782966283","variant_ids":[43608906825827]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - 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-PM03","featured_media":{"alt":null,"id":27657395568739,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_d68420c4-8088-4335-bcdf-8e4c7af7d848.webp?v=1782966283"}},"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-PM03_80070541-ff07-4d65-9e8c-8c541f11f19c.png?v=1755860467","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b.webp?v=1782213342","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1.webp?v=1782213342","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3.webp?v=1782213343","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_c0a2ec05-c23e-4b9a-84bf-cb3f6c77a757.webp?v=1782958620","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_7a76dd91-bbd9-49bd-9c77-ab94b5277ff3.webp?v=1782958620","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_80f44e99-7f10-4377-b559-6bfaba9bf70c.webp?v=1782958621","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_c5979d4b-0f19-414e-90bc-900155fe3538.webp?v=1782961975","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_6926056a-dca3-4cc3-989d-6d12c891005c.webp?v=1782961977","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_ac231f85-6dde-45b8-bc62-267a77a3fe5a.webp?v=1782961980","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_f2c7161a-6a0b-4a30-b218-b6613e34189a.webp?v=1782966282","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_d68420c4-8088-4335-bcdf-8e4c7af7d848.webp?v=1782966283","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_325c2f38-c403-4d19-9928-c63dc9530678.webp?v=1782966284"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM03_80070541-ff07-4d65-9e8c-8c541f11f19c.png?v=1755860467","options":["color"],"media":[{"alt":null,"id":25941475557475,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM03_80070541-ff07-4d65-9e8c-8c541f11f19c.png?v=1755860467"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM03_80070541-ff07-4d65-9e8c-8c541f11f19c.png?v=1755860467","width":2000},{"alt":null,"id":27578464600163,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b.webp?v=1782213342"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b.webp?v=1782213342","width":2000},{"alt":null,"id":27578464796771,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1.webp?v=1782213342"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1.webp?v=1782213342","width":2000},{"alt":null,"id":27578465091683,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3.webp?v=1782213343"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3.webp?v=1782213343","width":2000},{"alt":null,"id":27656234991715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_c0a2ec05-c23e-4b9a-84bf-cb3f6c77a757.webp?v=1782958620"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_c0a2ec05-c23e-4b9a-84bf-cb3f6c77a757.webp?v=1782958620","width":2000},{"alt":null,"id":27656235581539,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_7a76dd91-bbd9-49bd-9c77-ab94b5277ff3.webp?v=1782958620"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_7a76dd91-bbd9-49bd-9c77-ab94b5277ff3.webp?v=1782958620","width":2000},{"alt":null,"id":27656236138595,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_80f44e99-7f10-4377-b559-6bfaba9bf70c.webp?v=1782958621"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_80f44e99-7f10-4377-b559-6bfaba9bf70c.webp?v=1782958621","width":2000},{"alt":null,"id":27656896839779,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_c5979d4b-0f19-414e-90bc-900155fe3538.webp?v=1782961975"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_c5979d4b-0f19-414e-90bc-900155fe3538.webp?v=1782961975","width":2000},{"alt":null,"id":27656897855587,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_6926056a-dca3-4cc3-989d-6d12c891005c.webp?v=1782961977"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_6926056a-dca3-4cc3-989d-6d12c891005c.webp?v=1782961977","width":2000},{"alt":null,"id":27656898248803,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_ac231f85-6dde-45b8-bc62-267a77a3fe5a.webp?v=1782961980"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_ac231f85-6dde-45b8-bc62-267a77a3fe5a.webp?v=1782961980","width":2000},{"alt":null,"id":27657395109987,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_f2c7161a-6a0b-4a30-b218-b6613e34189a.webp?v=1782966282"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_f2c7161a-6a0b-4a30-b218-b6613e34189a.webp?v=1782966282","width":2000},{"alt":null,"id":27657395568739,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_d68420c4-8088-4335-bcdf-8e4c7af7d848.webp?v=1782966283"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_d68420c4-8088-4335-bcdf-8e4c7af7d848.webp?v=1782966283","width":2000},{"alt":null,"id":27657396125795,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_325c2f38-c403-4d19-9928-c63dc9530678.webp?v=1782966284"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_325c2f38-c403-4d19-9928-c63dc9530678.webp?v=1782966284","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43608905810019,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013520G-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152522637411,"product_id":7863407312995,"position":13,"created_at":"2026-07-02T12:24:42+08:00","updated_at":"2026-07-02T12:24:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_325c2f38-c403-4d19-9928-c63dc9530678.webp?v=1782966284","variant_ids":[43608905810019]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - 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-PM03","featured_media":{"alt":null,"id":27657396125795,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_325c2f38-c403-4d19-9928-c63dc9530678.webp?v=1782966284"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608906793059,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"JTB013524M-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152521621603,"product_id":7863407312995,"position":11,"created_at":"2026-07-02T12:24:41+08:00","updated_at":"2026-07-02T12:24:42+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_f2c7161a-6a0b-4a30-b218-b6613e34189a.webp?v=1782966282","variant_ids":[43608906793059]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - 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-PM03","featured_media":{"alt":null,"id":27657395109987,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4860bc3e1ca50c778c3b5e07694d271a559e47b_f2c7161a-6a0b-4a30-b218-b6613e34189a.webp?v=1782966282"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43608906825827,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"JTB013524L-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152522080355,"product_id":7863407312995,"position":12,"created_at":"2026-07-02T12:24:41+08:00","updated_at":"2026-07-02T12:24:43+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_d68420c4-8088-4335-bcdf-8e4c7af7d848.webp?v=1782966283","variant_ids":[43608906825827]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - 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-PM03","featured_media":{"alt":null,"id":27657395568739,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8735a7a2c64eefd3c4ff1a2cf61570f1a479edb3_d68420c4-8088-4335-bcdf-8e4c7af7d848.webp?v=1782966283"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43608905810019,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013520G-PM03","requires_shipping":true,"taxable":true,"featured_image":{"id":36152522637411,"product_id":7863407312995,"position":13,"created_at":"2026-07-02T12:24:42+08:00","updated_at":"2026-07-02T12:24:44+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_325c2f38-c403-4d19-9928-c63dc9530678.webp?v=1782966284","variant_ids":[43608905810019]},"available":true,"name":"iPhone 17 Pro Clear (相機按鈕) NBA Logo-芝加哥公牛 Chicago Bulls - Light - 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-PM03","featured_media":{"alt":null,"id":27657396125795,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/30dfa0ac7fb442cbe2c19cd5f68e5584f4d462e1_325c2f38-c403-4d19-9928-c63dc9530678.webp?v=1782966284"}},"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: "停產"
}