$product = {"id":7863522066531,"title":"iPhone 17 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-金州勇士 Golden State Warriors - Light","handle":"iphone-17-pro-jellytint-magsafe-with-capture-button-pm01","description":null,"published_at":"2025-09-10T18:09:36+08:00","created_at":"2025-08-22T19:12:37+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":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":43609250791523,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013520G-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152517230691,"product_id":7863522066531,"position":11,"created_at":"2026-07-02T12:24:33+08:00","updated_at":"2026-07-02T12:24:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_f75d0062-73fa-4564-beb7-bfef7fd96828.webp?v=1782966275","variant_ids":[43609250791523]},"available":true,"name":"iPhone 17 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"MJB013520G-PM01","featured_media":{"alt":null,"id":27657390719075,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_f75d0062-73fa-4564-beb7-bfef7fd96828.webp?v=1782966275"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609251709027,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"MJB013524M-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152517787747,"product_id":7863522066531,"position":13,"created_at":"2026-07-02T12:24:34+08:00","updated_at":"2026-07-02T12:24:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_a04c5fb5-fb03-4b43-91bd-817953720f07.webp?v=1782966276","variant_ids":[43609251709027]},"available":true,"name":"iPhone 17 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"MJB013524M-PM01","featured_media":{"alt":null,"id":27657391276131,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_a04c5fb5-fb03-4b43-91bd-817953720f07.webp?v=1782966276"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609251741795,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"MJB013524L-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152517591139,"product_id":7863522066531,"position":12,"created_at":"2026-07-02T12:24:33+08:00","updated_at":"2026-07-02T12:24:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_922bebe7-99ea-4bdb-aa88-b920708fcea8.webp?v=1782966275","variant_ids":[43609251741795]},"available":true,"name":"iPhone 17 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"MJB013524L-PM01","featured_media":{"alt":null,"id":27657391079523,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_922bebe7-99ea-4bdb-aa88-b920708fcea8.webp?v=1782966275"}},"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-PM01_1d7354a5-dfe9-4e74-9405-fb597caa27a6.png?v=1755861160","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a.webp?v=1782213307","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f.webp?v=1782213307","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c.webp?v=1782213308","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_3922db82-ec16-40dd-b825-9dde23277930.webp?v=1782958608","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_55e84c63-00ba-443b-8b86-5d8c51015a54.webp?v=1782958608","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_9654652c-a841-4168-87a2-41b32957e408.webp?v=1782958609","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_a6bef457-2271-4b40-88a2-f5ec003fbd63.webp?v=1782961962","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_6e8912cc-bf0b-4169-b10b-19d220af4129.webp?v=1782961967","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_4522fe66-ccbb-4df7-878b-cadc51c4673f.webp?v=1782961970","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_f75d0062-73fa-4564-beb7-bfef7fd96828.webp?v=1782966275","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_922bebe7-99ea-4bdb-aa88-b920708fcea8.webp?v=1782966275","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_a04c5fb5-fb03-4b43-91bd-817953720f07.webp?v=1782966276"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM01_1d7354a5-dfe9-4e74-9405-fb597caa27a6.png?v=1755861160","options":["color"],"media":[{"alt":null,"id":25941636644963,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM01_1d7354a5-dfe9-4e74-9405-fb597caa27a6.png?v=1755861160"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-352-PM01_1d7354a5-dfe9-4e74-9405-fb597caa27a6.png?v=1755861160","width":2000},{"alt":null,"id":27578447560803,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a.webp?v=1782213307"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a.webp?v=1782213307","width":2000},{"alt":null,"id":27578448117859,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f.webp?v=1782213307"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f.webp?v=1782213307","width":2000},{"alt":null,"id":27578448740451,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c.webp?v=1782213308"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c.webp?v=1782213308","width":2000},{"alt":null,"id":27656227717219,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_3922db82-ec16-40dd-b825-9dde23277930.webp?v=1782958608"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_3922db82-ec16-40dd-b825-9dde23277930.webp?v=1782958608","width":2000},{"alt":null,"id":27656228503651,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_55e84c63-00ba-443b-8b86-5d8c51015a54.webp?v=1782958608"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_55e84c63-00ba-443b-8b86-5d8c51015a54.webp?v=1782958608","width":2000},{"alt":null,"id":27656229126243,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_9654652c-a841-4168-87a2-41b32957e408.webp?v=1782958609"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_9654652c-a841-4168-87a2-41b32957e408.webp?v=1782958609","width":2000},{"alt":null,"id":27656892579939,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_a6bef457-2271-4b40-88a2-f5ec003fbd63.webp?v=1782961962"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_a6bef457-2271-4b40-88a2-f5ec003fbd63.webp?v=1782961962","width":2000},{"alt":null,"id":27656893923427,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_6e8912cc-bf0b-4169-b10b-19d220af4129.webp?v=1782961967"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_6e8912cc-bf0b-4169-b10b-19d220af4129.webp?v=1782961967","width":2000},{"alt":null,"id":27656895070307,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_4522fe66-ccbb-4df7-878b-cadc51c4673f.webp?v=1782961970"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_4522fe66-ccbb-4df7-878b-cadc51c4673f.webp?v=1782961970","width":2000},{"alt":null,"id":27657390719075,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_f75d0062-73fa-4564-beb7-bfef7fd96828.webp?v=1782966275"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_f75d0062-73fa-4564-beb7-bfef7fd96828.webp?v=1782966275","width":2000},{"alt":null,"id":27657391079523,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_922bebe7-99ea-4bdb-aa88-b920708fcea8.webp?v=1782966275"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_922bebe7-99ea-4bdb-aa88-b920708fcea8.webp?v=1782966275","width":2000},{"alt":null,"id":27657391276131,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_a04c5fb5-fb03-4b43-91bd-817953720f07.webp?v=1782966276"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_a04c5fb5-fb03-4b43-91bd-817953720f07.webp?v=1782966276","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43609250791523,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013520G-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152517230691,"product_id":7863522066531,"position":11,"created_at":"2026-07-02T12:24:33+08:00","updated_at":"2026-07-02T12:24:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_f75d0062-73fa-4564-beb7-bfef7fd96828.webp?v=1782966275","variant_ids":[43609250791523]},"available":true,"name":"iPhone 17 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"MJB013520G-PM01","featured_media":{"alt":null,"id":27657390719075,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_f75d0062-73fa-4564-beb7-bfef7fd96828.webp?v=1782966275"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609251709027,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"MJB013524M-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152517787747,"product_id":7863522066531,"position":13,"created_at":"2026-07-02T12:24:34+08:00","updated_at":"2026-07-02T12:24:36+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_a04c5fb5-fb03-4b43-91bd-817953720f07.webp?v=1782966276","variant_ids":[43609251709027]},"available":true,"name":"iPhone 17 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"MJB013524M-PM01","featured_media":{"alt":null,"id":27657391276131,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a4c5d58b9dd2ec379e00a90b5b065016faf29d9c_a04c5fb5-fb03-4b43-91bd-817953720f07.webp?v=1782966276"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43609251741795,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"MJB013524L-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152517591139,"product_id":7863522066531,"position":12,"created_at":"2026-07-02T12:24:33+08:00","updated_at":"2026-07-02T12:24:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_922bebe7-99ea-4bdb-aa88-b920708fcea8.webp?v=1782966275","variant_ids":[43609251741795]},"available":true,"name":"iPhone 17 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"MJB013524L-PM01","featured_media":{"alt":null,"id":27657391079523,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5aa60329a889a53d5a9bbc298073d12cb866863f_922bebe7-99ea-4bdb-aa88-b920708fcea8.webp?v=1782966275"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43609250791523,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MJB013520G-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152517230691,"product_id":7863522066531,"position":11,"created_at":"2026-07-02T12:24:33+08:00","updated_at":"2026-07-02T12:24:35+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_f75d0062-73fa-4564-beb7-bfef7fd96828.webp?v=1782966275","variant_ids":[43609250791523]},"available":true,"name":"iPhone 17 Pro Clear (MagSafe 兼容 \u0026 相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"MJB013520G-PM01","featured_media":{"alt":null,"id":27657390719075,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00feff648e0ca3b12e996ff40b6d24603f3ce70a_f75d0062-73fa-4564-beb7-bfef7fd96828.webp?v=1782966275"}},"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: "停產"
}