$product = {"id":7922511020131,"title":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款","handle":"iphone-17-pro-airx-magsafe-sb10","description":null,"published_at":"2025-11-19T09:49:23+08:00","created_at":"2025-11-13T17:56:44+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-batman","device-iPhone 17 Pro","merge","reseller-batman"],"price":195000,"price_min":195000,"price_max":195000,"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":43836228436067,"title":"Vero Black","option1":"Vero Black","option2":null,"option3":null,"sku":"MAR013524E-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36319928352867,"product_id":7922511020131,"position":3,"created_at":"2026-07-20T13:38:09+08:00","updated_at":"2026-07-20T13:38:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c56dc514610f0dfb3aa9d74099374f287ae0dab.webp?v=1784525891","variant_ids":[43836228436067]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Vero Black","public_title":"Vero Black","options":["Vero Black"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013524E-SB10","featured_media":{"alt":null,"id":27823880601699,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c56dc514610f0dfb3aa9d74099374f287ae0dab.webp?v=1784525891"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43836228960355,"title":"Flux Gray","option1":"Flux Gray","option2":null,"option3":null,"sku":"MAR013524F-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36319928025187,"product_id":7922511020131,"position":2,"created_at":"2026-07-20T13:38:07+08:00","updated_at":"2026-07-20T13:38:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf3c5fcd9817dcb8119ce7ba4391500bc77f6aac.webp?v=1784525889","variant_ids":[43836228960355]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Flux Gray","public_title":"Flux Gray","options":["Flux Gray"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013524F-SB10","featured_media":{"alt":null,"id":27823880306787,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf3c5fcd9817dcb8119ce7ba4391500bc77f6aac.webp?v=1784525889"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44440843255907,"title":"Ashen Violet","option1":"Ashen Violet","option2":null,"option3":null,"sku":"MAR013526C-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36485722996835,"product_id":7922511020131,"position":4,"created_at":"2026-08-05T10:47:07+08:00","updated_at":"2026-08-05T10:47:09+08:00","alt":null,"width":550,"height":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddf28c186bf169ea1a47154f271c221e82a679c7.webp?v=1785898029","variant_ids":[44440843255907]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Ashen Violet","public_title":"Ashen Violet","options":["Ashen Violet"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013526C-SB10","featured_media":{"alt":null,"id":27989035876451,"position":4,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddf28c186bf169ea1a47154f271c221e82a679c7.webp?v=1785898029"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44448982073443,"title":"Ridgeline Gray","option1":"Ridgeline Gray","option2":null,"option3":null,"sku":"MAR013526D-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36494961803363,"product_id":7922511020131,"position":8,"created_at":"2026-08-06T11:22:01+08:00","updated_at":"2026-08-06T11:22:03+08:00","alt":null,"width":550,"height":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00498c0e74b55d10d08c2cc2b6915ed6b1f73bde_8e32404b-f346-4824-bb8e-6c9a94906f7d.webp?v=1785986523","variant_ids":[44448982073443]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Ridgeline Gray","public_title":"Ridgeline Gray","options":["Ridgeline Gray"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013526D-SB10","featured_media":{"alt":null,"id":27998257709155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00498c0e74b55d10d08c2cc2b6915ed6b1f73bde_8e32404b-f346-4824-bb8e-6c9a94906f7d.webp?v=1785986523"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44448983089251,"title":"Trailhead Green","option1":"Trailhead Green","option2":null,"option3":null,"sku":"MAR013526E-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36494961148003,"product_id":7922511020131,"position":7,"created_at":"2026-08-06T11:21:59+08:00","updated_at":"2026-08-06T11:22:01+08:00","alt":null,"width":550,"height":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7268999cb34143a090263bc599a40efd970f625_d2c62371-02de-45c9-95e6-aabcae7698ad.webp?v=1785986521","variant_ids":[44448983089251]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Trailhead Green","public_title":"Trailhead Green","options":["Trailhead Green"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013526E-SB10","featured_media":{"alt":null,"id":27998257021027,"position":7,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7268999cb34143a090263bc599a40efd970f625_d2c62371-02de-45c9-95e6-aabcae7698ad.webp?v=1785986521"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/AirX-4E-352-SB10_bda87bd0-60ef-4ed5-b4be-e3f418504a67.png?v=1763027807","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf3c5fcd9817dcb8119ce7ba4391500bc77f6aac.webp?v=1784525889","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c56dc514610f0dfb3aa9d74099374f287ae0dab.webp?v=1784525891","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddf28c186bf169ea1a47154f271c221e82a679c7.webp?v=1785898029","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00498c0e74b55d10d08c2cc2b6915ed6b1f73bde.webp?v=1785898030","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7268999cb34143a090263bc599a40efd970f625.webp?v=1785898038","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7268999cb34143a090263bc599a40efd970f625_d2c62371-02de-45c9-95e6-aabcae7698ad.webp?v=1785986521","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00498c0e74b55d10d08c2cc2b6915ed6b1f73bde_8e32404b-f346-4824-bb8e-6c9a94906f7d.webp?v=1785986523"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/AirX-4E-352-SB10_bda87bd0-60ef-4ed5-b4be-e3f418504a67.png?v=1763027807","options":["color"],"media":[{"alt":null,"id":26361153388643,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/AirX-4E-352-SB10_bda87bd0-60ef-4ed5-b4be-e3f418504a67.png?v=1763027807"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/AirX-4E-352-SB10_bda87bd0-60ef-4ed5-b4be-e3f418504a67.png?v=1763027807","width":2000},{"alt":null,"id":27823880306787,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf3c5fcd9817dcb8119ce7ba4391500bc77f6aac.webp?v=1784525889"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf3c5fcd9817dcb8119ce7ba4391500bc77f6aac.webp?v=1784525889","width":2000},{"alt":null,"id":27823880601699,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c56dc514610f0dfb3aa9d74099374f287ae0dab.webp?v=1784525891"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c56dc514610f0dfb3aa9d74099374f287ae0dab.webp?v=1784525891","width":2000},{"alt":null,"id":27989035876451,"position":4,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddf28c186bf169ea1a47154f271c221e82a679c7.webp?v=1785898029"},"aspect_ratio":1.0,"height":550,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddf28c186bf169ea1a47154f271c221e82a679c7.webp?v=1785898029","width":550},{"alt":null,"id":27989036695651,"position":5,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00498c0e74b55d10d08c2cc2b6915ed6b1f73bde.webp?v=1785898030"},"aspect_ratio":1.0,"height":550,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00498c0e74b55d10d08c2cc2b6915ed6b1f73bde.webp?v=1785898030","width":550},{"alt":null,"id":27989037547619,"position":6,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7268999cb34143a090263bc599a40efd970f625.webp?v=1785898038"},"aspect_ratio":1.0,"height":550,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7268999cb34143a090263bc599a40efd970f625.webp?v=1785898038","width":550},{"alt":null,"id":27998257021027,"position":7,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7268999cb34143a090263bc599a40efd970f625_d2c62371-02de-45c9-95e6-aabcae7698ad.webp?v=1785986521"},"aspect_ratio":1.0,"height":550,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7268999cb34143a090263bc599a40efd970f625_d2c62371-02de-45c9-95e6-aabcae7698ad.webp?v=1785986521","width":550},{"alt":null,"id":27998257709155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00498c0e74b55d10d08c2cc2b6915ed6b1f73bde_8e32404b-f346-4824-bb8e-6c9a94906f7d.webp?v=1785986523"},"aspect_ratio":1.0,"height":550,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00498c0e74b55d10d08c2cc2b6915ed6b1f73bde_8e32404b-f346-4824-bb8e-6c9a94906f7d.webp?v=1785986523","width":550}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null};
$isMerge = null;
$variants = [{"id":43836228436067,"title":"Vero Black","option1":"Vero Black","option2":null,"option3":null,"sku":"MAR013524E-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36319928352867,"product_id":7922511020131,"position":3,"created_at":"2026-07-20T13:38:09+08:00","updated_at":"2026-07-20T13:38:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c56dc514610f0dfb3aa9d74099374f287ae0dab.webp?v=1784525891","variant_ids":[43836228436067]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Vero Black","public_title":"Vero Black","options":["Vero Black"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013524E-SB10","featured_media":{"alt":null,"id":27823880601699,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c56dc514610f0dfb3aa9d74099374f287ae0dab.webp?v=1784525891"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43836228960355,"title":"Flux Gray","option1":"Flux Gray","option2":null,"option3":null,"sku":"MAR013524F-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36319928025187,"product_id":7922511020131,"position":2,"created_at":"2026-07-20T13:38:07+08:00","updated_at":"2026-07-20T13:38:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf3c5fcd9817dcb8119ce7ba4391500bc77f6aac.webp?v=1784525889","variant_ids":[43836228960355]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Flux Gray","public_title":"Flux Gray","options":["Flux Gray"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013524F-SB10","featured_media":{"alt":null,"id":27823880306787,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cf3c5fcd9817dcb8119ce7ba4391500bc77f6aac.webp?v=1784525889"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44440843255907,"title":"Ashen Violet","option1":"Ashen Violet","option2":null,"option3":null,"sku":"MAR013526C-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36485722996835,"product_id":7922511020131,"position":4,"created_at":"2026-08-05T10:47:07+08:00","updated_at":"2026-08-05T10:47:09+08:00","alt":null,"width":550,"height":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddf28c186bf169ea1a47154f271c221e82a679c7.webp?v=1785898029","variant_ids":[44440843255907]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Ashen Violet","public_title":"Ashen Violet","options":["Ashen Violet"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013526C-SB10","featured_media":{"alt":null,"id":27989035876451,"position":4,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ddf28c186bf169ea1a47154f271c221e82a679c7.webp?v=1785898029"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44448982073443,"title":"Ridgeline Gray","option1":"Ridgeline Gray","option2":null,"option3":null,"sku":"MAR013526D-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36494961803363,"product_id":7922511020131,"position":8,"created_at":"2026-08-06T11:22:01+08:00","updated_at":"2026-08-06T11:22:03+08:00","alt":null,"width":550,"height":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00498c0e74b55d10d08c2cc2b6915ed6b1f73bde_8e32404b-f346-4824-bb8e-6c9a94906f7d.webp?v=1785986523","variant_ids":[44448982073443]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Ridgeline Gray","public_title":"Ridgeline Gray","options":["Ridgeline Gray"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013526D-SB10","featured_media":{"alt":null,"id":27998257709155,"position":8,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00498c0e74b55d10d08c2cc2b6915ed6b1f73bde_8e32404b-f346-4824-bb8e-6c9a94906f7d.webp?v=1785986523"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":44448983089251,"title":"Trailhead Green","option1":"Trailhead Green","option2":null,"option3":null,"sku":"MAR013526E-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36494961148003,"product_id":7922511020131,"position":7,"created_at":"2026-08-06T11:21:59+08:00","updated_at":"2026-08-06T11:22:01+08:00","alt":null,"width":550,"height":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7268999cb34143a090263bc599a40efd970f625_d2c62371-02de-45c9-95e6-aabcae7698ad.webp?v=1785986521","variant_ids":[44448983089251]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Trailhead Green","public_title":"Trailhead Green","options":["Trailhead Green"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013526E-SB10","featured_media":{"alt":null,"id":27998257021027,"position":7,"preview_image":{"aspect_ratio":1.0,"height":550,"width":550,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c7268999cb34143a090263bc599a40efd970f625_d2c62371-02de-45c9-95e6-aabcae7698ad.webp?v=1785986521"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}];
$defaultVariant = {"id":43836228436067,"title":"Vero Black","option1":"Vero Black","option2":null,"option3":null,"sku":"MAR013524E-SB10","requires_shipping":true,"taxable":true,"featured_image":{"id":36319928352867,"product_id":7922511020131,"position":3,"created_at":"2026-07-20T13:38:09+08:00","updated_at":"2026-07-20T13:38:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c56dc514610f0dfb3aa9d74099374f287ae0dab.webp?v=1784525891","variant_ids":[43836228436067]},"available":true,"name":"iPhone 17 Pro AirX Batman 蝙蝠俠 超級惡棍和蝙蝠俠Logo貼紙款 - Vero Black","public_title":"Vero Black","options":["Vero Black"],"price":195000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MAR013524E-SB10","featured_media":{"alt":null,"id":27823880601699,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9c56dc514610f0dfb3aa9d74099374f287ae0dab.webp?v=1784525891"}},"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: "停產"
}