$product = {"id":7863811702883,"title":"iPhone 17 Pro Max Clear (相機按鈕) NBA Logo-金州勇士 Golden State Warriors - Light","handle":"iphone-17-pro-max-jellytint-with-capture-button-pm01","description":null,"published_at":"2025-09-10T17:15:48+08:00","created_at":"2025-08-22T20:23:41+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone 17 Pro Max","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":43610107838563,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013530G-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152526372963,"product_id":7863811702883,"position":12,"created_at":"2026-07-02T12:24:57+08:00","updated_at":"2026-07-02T12:24:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_12d92eb7-6f2f-44fb-b027-c80e1dd7fe30.webp?v=1782966299","variant_ids":[43610107838563]},"available":true,"name":"iPhone 17 Pro Max Clear (相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"JTB013530G-PM01","featured_media":{"alt":null,"id":27657399861347,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_12d92eb7-6f2f-44fb-b027-c80e1dd7fe30.webp?v=1782966299"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43610108788835,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"JTB013534M-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152525946979,"product_id":7863811702883,"position":11,"created_at":"2026-07-02T12:24:56+08:00","updated_at":"2026-07-02T12:24:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_bad01cd5-e41b-4f11-9087-88d790767a96.webp?v=1782966298","variant_ids":[43610108788835]},"available":true,"name":"iPhone 17 Pro Max Clear (相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"JTB013534M-PM01","featured_media":{"alt":null,"id":27657399435363,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_bad01cd5-e41b-4f11-9087-88d790767a96.webp?v=1782966298"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43610108821603,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"JTB013534L-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152526733411,"product_id":7863811702883,"position":13,"created_at":"2026-07-02T12:24:57+08:00","updated_at":"2026-07-02T12:24:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_763d26eb-0e44-4893-bcc5-8a53a27d450a.webp?v=1782966299","variant_ids":[43610108821603]},"available":true,"name":"iPhone 17 Pro Max Clear (相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"JTB013534L-PM01","featured_media":{"alt":null,"id":27657400221795,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_763d26eb-0e44-4893-bcc5-8a53a27d450a.webp?v=1782966299"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-353-PM01_45fe2dd0-45d1-4f4d-b65e-68b0a1a8bf56.png?v=1755865424","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46.webp?v=1782213600","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239.webp?v=1782213601","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4.webp?v=1782213601","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_076648cb-bcd1-4417-bd50-5a51b6b41967.webp?v=1782958654","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_7025f5ef-5106-4a86-9531-f5f209b9551d.webp?v=1782958655","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_218f13da-a14d-44d0-a1f3-691dd72bc4a5.webp?v=1782958656","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_d091aabc-974d-46df-bcd3-43958025b809.webp?v=1782961994","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_964f7d01-d2cb-44be-a678-ab0ae3c2e63b.webp?v=1782961995","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_220c8a29-25a4-4e6f-83a7-bb4d91d3cda7.webp?v=1782961995","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_bad01cd5-e41b-4f11-9087-88d790767a96.webp?v=1782966298","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_12d92eb7-6f2f-44fb-b027-c80e1dd7fe30.webp?v=1782966299","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_763d26eb-0e44-4893-bcc5-8a53a27d450a.webp?v=1782966299"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-353-PM01_45fe2dd0-45d1-4f4d-b65e-68b0a1a8bf56.png?v=1755865424","options":["color"],"media":[{"alt":null,"id":25942200057955,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-353-PM01_45fe2dd0-45d1-4f4d-b65e-68b0a1a8bf56.png?v=1755865424"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-353-PM01_45fe2dd0-45d1-4f4d-b65e-68b0a1a8bf56.png?v=1755865424","width":2000},{"alt":null,"id":27578582925411,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46.webp?v=1782213600"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46.webp?v=1782213600","width":2000},{"alt":null,"id":27578583515235,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239.webp?v=1782213601"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239.webp?v=1782213601","width":2000},{"alt":null,"id":27578583810147,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4.webp?v=1782213601"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4.webp?v=1782213601","width":2000},{"alt":null,"id":27656249081955,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_076648cb-bcd1-4417-bd50-5a51b6b41967.webp?v=1782958654"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_076648cb-bcd1-4417-bd50-5a51b6b41967.webp?v=1782958654","width":2000},{"alt":null,"id":27656249376867,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_7025f5ef-5106-4a86-9531-f5f209b9551d.webp?v=1782958655"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_7025f5ef-5106-4a86-9531-f5f209b9551d.webp?v=1782958655","width":2000},{"alt":null,"id":27656249573475,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_218f13da-a14d-44d0-a1f3-691dd72bc4a5.webp?v=1782958656"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_218f13da-a14d-44d0-a1f3-691dd72bc4a5.webp?v=1782958656","width":2000},{"alt":null,"id":27656901492835,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_d091aabc-974d-46df-bcd3-43958025b809.webp?v=1782961994"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_d091aabc-974d-46df-bcd3-43958025b809.webp?v=1782961994","width":2000},{"alt":null,"id":27656901722211,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_964f7d01-d2cb-44be-a678-ab0ae3c2e63b.webp?v=1782961995"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_964f7d01-d2cb-44be-a678-ab0ae3c2e63b.webp?v=1782961995","width":2000},{"alt":null,"id":27656901886051,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_220c8a29-25a4-4e6f-83a7-bb4d91d3cda7.webp?v=1782961995"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_220c8a29-25a4-4e6f-83a7-bb4d91d3cda7.webp?v=1782961995","width":2000},{"alt":null,"id":27657399435363,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_bad01cd5-e41b-4f11-9087-88d790767a96.webp?v=1782966298"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_bad01cd5-e41b-4f11-9087-88d790767a96.webp?v=1782966298","width":2000},{"alt":null,"id":27657399861347,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_12d92eb7-6f2f-44fb-b027-c80e1dd7fe30.webp?v=1782966299"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_12d92eb7-6f2f-44fb-b027-c80e1dd7fe30.webp?v=1782966299","width":2000},{"alt":null,"id":27657400221795,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_763d26eb-0e44-4893-bcc5-8a53a27d450a.webp?v=1782966299"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_763d26eb-0e44-4893-bcc5-8a53a27d450a.webp?v=1782966299","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43610107838563,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013530G-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152526372963,"product_id":7863811702883,"position":12,"created_at":"2026-07-02T12:24:57+08:00","updated_at":"2026-07-02T12:24:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_12d92eb7-6f2f-44fb-b027-c80e1dd7fe30.webp?v=1782966299","variant_ids":[43610107838563]},"available":true,"name":"iPhone 17 Pro Max Clear (相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"JTB013530G-PM01","featured_media":{"alt":null,"id":27657399861347,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_12d92eb7-6f2f-44fb-b027-c80e1dd7fe30.webp?v=1782966299"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43610108788835,"title":"Nocturne Blue","option1":"Nocturne Blue","option2":null,"option3":null,"sku":"JTB013534M-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152525946979,"product_id":7863811702883,"position":11,"created_at":"2026-07-02T12:24:56+08:00","updated_at":"2026-07-02T12:24:58+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_bad01cd5-e41b-4f11-9087-88d790767a96.webp?v=1782966298","variant_ids":[43610108788835]},"available":true,"name":"iPhone 17 Pro Max Clear (相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"JTB013534M-PM01","featured_media":{"alt":null,"id":27657399435363,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e48db41165750db11fd848f01d23e996e3f6df46_bad01cd5-e41b-4f11-9087-88d790767a96.webp?v=1782966298"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43610108821603,"title":"Gleam Rosé","option1":"Gleam Rosé","option2":null,"option3":null,"sku":"JTB013534L-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152526733411,"product_id":7863811702883,"position":13,"created_at":"2026-07-02T12:24:57+08:00","updated_at":"2026-07-02T12:24:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_763d26eb-0e44-4893-bcc5-8a53a27d450a.webp?v=1782966299","variant_ids":[43610108821603]},"available":true,"name":"iPhone 17 Pro Max Clear (相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"JTB013534L-PM01","featured_media":{"alt":null,"id":27657400221795,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c43ea5e0d20f6a2c40d880f4f8cb2f92b98628a4_763d26eb-0e44-4893-bcc5-8a53a27d450a.webp?v=1782966299"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43610107838563,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"JTB013530G-PM01","requires_shipping":true,"taxable":true,"featured_image":{"id":36152526372963,"product_id":7863811702883,"position":12,"created_at":"2026-07-02T12:24:57+08:00","updated_at":"2026-07-02T12:24:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_12d92eb7-6f2f-44fb-b027-c80e1dd7fe30.webp?v=1782966299","variant_ids":[43610107838563]},"available":true,"name":"iPhone 17 Pro Max Clear (相機按鈕) NBA Logo-金州勇士 Golden State Warriors - 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":"JTB013530G-PM01","featured_media":{"alt":null,"id":27657399861347,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/45b7fe7e9d13fef24e44b356de9a46b34ae2b239_12d92eb7-6f2f-44fb-b027-c80e1dd7fe30.webp?v=1782966299"}},"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: "停產"
}