$product = {"id":7158925197411,"title":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-密爾瓦基公鹿 Milwaukee Bucks","handle":"iphone-15-jellytint-magsafe-pm14","description":null,"published_at":"2024-02-01T17:54:41+08:00","created_at":"2024-01-26T17:09:12+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-nba","device-iPhone 15","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":41212335816803,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MCN012950G-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378392675,"product_id":7158925197411,"position":11,"created_at":"2026-07-02T12:18:08+08:00","updated_at":"2026-07-02T12:18:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_081ab7fe-4691-47b1-9f29-b8127ec7e24a.webp?v=1782965890","variant_ids":[41212335816803]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950G-PM14","featured_media":{"alt":null,"id":27657251881059,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_081ab7fe-4691-47b1-9f29-b8127ec7e24a.webp?v=1782965890"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41212335849571,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"MCN012950H-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378687587,"product_id":7158925197411,"position":12,"created_at":"2026-07-02T12:18:09+08:00","updated_at":"2026-07-02T12:18:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_3d50012c-c748-4360-8c8e-d41f4dcb4197.webp?v=1782965891","variant_ids":[41212335849571]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950H-PM14","featured_media":{"alt":null,"id":27657252175971,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_3d50012c-c748-4360-8c8e-d41f4dcb4197.webp?v=1782965891"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41212335947875,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"MCN012950J-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378949731,"product_id":7158925197411,"position":13,"created_at":"2026-07-02T12:18:09+08:00","updated_at":"2026-07-02T12:18:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_3fb12488-bca9-48b4-9ebc-73263305fe29.webp?v=1782965892","variant_ids":[41212335947875]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950J-PM14","featured_media":{"alt":null,"id":27657252438115,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_3fb12488-bca9-48b4-9ebc-73263305fe29.webp?v=1782965892"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-295-PM14_e3ad1440-8329-4738-9a78-2a6fb5e69e58.png?v=1706260155","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909.webp?v=1782208389","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38.webp?v=1782208389","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2.webp?v=1782208390","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_0bbb61ff-b698-4ed5-92a6-5d5029241fb5.webp?v=1782957983","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_4806bc03-bbf2-4450-bf3f-175c3ca8b05e.webp?v=1782957983","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_80815279-ee12-4903-ad60-1892a2c03c49.webp?v=1782957984","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_37584935-2443-4562-add4-54e482d2d75c.webp?v=1782961461","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_58ede417-02ee-4be4-bc0e-19adb065f2c4.webp?v=1782961463","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_094de9d2-4856-4a7f-931d-e4d869b18fda.webp?v=1782961465","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_081ab7fe-4691-47b1-9f29-b8127ec7e24a.webp?v=1782965890","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_3d50012c-c748-4360-8c8e-d41f4dcb4197.webp?v=1782965891","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_3fb12488-bca9-48b4-9ebc-73263305fe29.webp?v=1782965892"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-295-PM14_e3ad1440-8329-4738-9a78-2a6fb5e69e58.png?v=1706260155","options":["color"],"media":[{"alt":null,"id":23219034226787,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-295-PM14_e3ad1440-8329-4738-9a78-2a6fb5e69e58.png?v=1706260155"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/Clear-F5-295-PM14_e3ad1440-8329-4738-9a78-2a6fb5e69e58.png?v=1706260155","width":2000},{"alt":null,"id":27576301420643,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909.webp?v=1782208389"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909.webp?v=1782208389","width":2000},{"alt":null,"id":27576301781091,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38.webp?v=1782208389"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38.webp?v=1782208389","width":2000},{"alt":null,"id":27576302403683,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2.webp?v=1782208390"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2.webp?v=1782208390","width":2000},{"alt":null,"id":27655997751395,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_0bbb61ff-b698-4ed5-92a6-5d5029241fb5.webp?v=1782957983"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_0bbb61ff-b698-4ed5-92a6-5d5029241fb5.webp?v=1782957983","width":2000},{"alt":null,"id":27655998210147,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_4806bc03-bbf2-4450-bf3f-175c3ca8b05e.webp?v=1782957983"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_4806bc03-bbf2-4450-bf3f-175c3ca8b05e.webp?v=1782957983","width":2000},{"alt":null,"id":27655998537827,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_80815279-ee12-4903-ad60-1892a2c03c49.webp?v=1782957984"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_80815279-ee12-4903-ad60-1892a2c03c49.webp?v=1782957984","width":2000},{"alt":null,"id":27656770191459,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_37584935-2443-4562-add4-54e482d2d75c.webp?v=1782961461"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_37584935-2443-4562-add4-54e482d2d75c.webp?v=1782961461","width":2000},{"alt":null,"id":27656770781283,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_58ede417-02ee-4be4-bc0e-19adb065f2c4.webp?v=1782961463"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_58ede417-02ee-4be4-bc0e-19adb065f2c4.webp?v=1782961463","width":2000},{"alt":null,"id":27656771108963,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_094de9d2-4856-4a7f-931d-e4d869b18fda.webp?v=1782961465"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_094de9d2-4856-4a7f-931d-e4d869b18fda.webp?v=1782961465","width":2000},{"alt":null,"id":27657251881059,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_081ab7fe-4691-47b1-9f29-b8127ec7e24a.webp?v=1782965890"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_081ab7fe-4691-47b1-9f29-b8127ec7e24a.webp?v=1782965890","width":2000},{"alt":null,"id":27657252175971,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_3d50012c-c748-4360-8c8e-d41f4dcb4197.webp?v=1782965891"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_3d50012c-c748-4360-8c8e-d41f4dcb4197.webp?v=1782965891","width":2000},{"alt":null,"id":27657252438115,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_3fb12488-bca9-48b4-9ebc-73263305fe29.webp?v=1782965892"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_3fb12488-bca9-48b4-9ebc-73263305fe29.webp?v=1782965892","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":41212335816803,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MCN012950G-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378392675,"product_id":7158925197411,"position":11,"created_at":"2026-07-02T12:18:08+08:00","updated_at":"2026-07-02T12:18:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_081ab7fe-4691-47b1-9f29-b8127ec7e24a.webp?v=1782965890","variant_ids":[41212335816803]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950G-PM14","featured_media":{"alt":null,"id":27657251881059,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_081ab7fe-4691-47b1-9f29-b8127ec7e24a.webp?v=1782965890"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41212335849571,"title":"Moody Green","option1":"Moody Green","option2":null,"option3":null,"sku":"MCN012950H-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378687587,"product_id":7158925197411,"position":12,"created_at":"2026-07-02T12:18:09+08:00","updated_at":"2026-07-02T12:18:11+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_3d50012c-c748-4360-8c8e-d41f4dcb4197.webp?v=1782965891","variant_ids":[41212335849571]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Moody Green","public_title":"Moody Green","options":["Moody Green"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950H-PM14","featured_media":{"alt":null,"id":27657252175971,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/4bb3f32895c0ccded468f6051f0e3665e9ae73e2_3d50012c-c748-4360-8c8e-d41f4dcb4197.webp?v=1782965891"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":41212335947875,"title":"Fancy Pink","option1":"Fancy Pink","option2":null,"option3":null,"sku":"MCN012950J-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378949731,"product_id":7158925197411,"position":13,"created_at":"2026-07-02T12:18:09+08:00","updated_at":"2026-07-02T12:18:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_3fb12488-bca9-48b4-9ebc-73263305fe29.webp?v=1782965892","variant_ids":[41212335947875]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Fancy Pink","public_title":"Fancy Pink","options":["Fancy Pink"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950J-PM14","featured_media":{"alt":null,"id":27657252438115,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/605775b440eb0d82ec3014bfec27dfba4a6a1909_3fb12488-bca9-48b4-9ebc-73263305fe29.webp?v=1782965892"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":41212335816803,"title":"Ash Black","option1":"Ash Black","option2":null,"option3":null,"sku":"MCN012950G-PM14","requires_shipping":true,"taxable":true,"featured_image":{"id":36152378392675,"product_id":7158925197411,"position":11,"created_at":"2026-07-02T12:18:08+08:00","updated_at":"2026-07-02T12:18:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_081ab7fe-4691-47b1-9f29-b8127ec7e24a.webp?v=1782965890","variant_ids":[41212335816803]},"available":true,"name":"iPhone 15 Clear (MagSafe 兼容) NBA Logo-密爾瓦基公鹿 Milwaukee Bucks - Ash Black","public_title":"Ash Black","options":["Ash Black"],"price":148000,"weight":1680,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MCN012950G-PM14","featured_media":{"alt":null,"id":27657251881059,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f9984c3b91c5b603ecd2186085916a8d06c13e38_081ab7fe-4691-47b1-9f29-b8127ec7e24a.webp?v=1782965890"}},"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: "停產" }