$product = {"id":7848027750499,"title":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo","handle":"iphone-15-pro-max-solidx-bumper-back-crossover-design-fv61","description":null,"published_at":"2025-08-07T09:21:34+08:00","created_at":"2025-08-05T09:37:01+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-hijohnnn","device-iPhone 15 Pro Max","merge","reseller-hijohnnn"],"price":125000,"price_min":125000,"price_max":125000,"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":43562807230563,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287679864931,"product_id":7848027750499,"position":8,"created_at":"2025-08-05T09:37:10+08:00","updated_at":"2025-08-05T09:37:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ea51ea5d1083e655ae57d030a3417650c4df02.webp?v=1754357832","variant_ids":[43562807230563]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-FV61","featured_media":{"alt":null,"id":25888788938851,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ea51ea5d1083e655ae57d030a3417650c4df02.webp?v=1754357832"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562807263331,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287677079651,"product_id":7848027750499,"position":2,"created_at":"2025-08-05T09:37:06+08:00","updated_at":"2025-08-05T09:37:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c920af1151f721b955f5b32fe72662a7e8d770ee.webp?v=1754357828","variant_ids":[43562807263331]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-FV61","featured_media":{"alt":null,"id":25888787562595,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c920af1151f721b955f5b32fe72662a7e8d770ee.webp?v=1754357828"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562807328867,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287680159843,"product_id":7848027750499,"position":9,"created_at":"2025-08-05T09:37:10+08:00","updated_at":"2025-08-05T09:37:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a13922622baa3626b5d9214c48ddaa4d1e61882.webp?v=1754357833","variant_ids":[43562807328867]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-FV61","featured_media":{"alt":null,"id":25888789168227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a13922622baa3626b5d9214c48ddaa4d1e61882.webp?v=1754357833"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562807361635,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287680553059,"product_id":7848027750499,"position":10,"created_at":"2025-08-05T09:37:11+08:00","updated_at":"2025-08-05T09:37:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa87fa8a587e993c021cef2a0b5a03b588ab13cf.webp?v=1754357833","variant_ids":[43562807361635]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-FV61","featured_media":{"alt":null,"id":25888789364835,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa87fa8a587e993c021cef2a0b5a03b588ab13cf.webp?v=1754357833"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562807492707,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287678095459,"product_id":7848027750499,"position":4,"created_at":"2025-08-05T09:37:07+08:00","updated_at":"2025-08-05T09:37:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86e3116e0fe10f2f9547b449726d2741813fcda.webp?v=1754357829","variant_ids":[43562807492707]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-FV61","featured_media":{"alt":null,"id":25888787890275,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86e3116e0fe10f2f9547b449726d2741813fcda.webp?v=1754357829"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64a739f4c950ef099cb0a9aa5581d4a886839017.webp?v=1754357827","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c920af1151f721b955f5b32fe72662a7e8d770ee.webp?v=1754357828","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7738706198c3d0da1e97fa57de164ddc1abb3f10.webp?v=1754357829","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86e3116e0fe10f2f9547b449726d2741813fcda.webp?v=1754357829","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/05f2d935b661263fbddc99f5a5aae869adeb3b97.webp?v=1754357830","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f6fe12c56c71be300e1987f8cb8b2c926ff77c8.webp?v=1754357831","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/699c276e1bdbf8eee98facbcd226093a5a41ad10.webp?v=1754357831","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ea51ea5d1083e655ae57d030a3417650c4df02.webp?v=1754357832","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a13922622baa3626b5d9214c48ddaa4d1e61882.webp?v=1754357833","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa87fa8a587e993c021cef2a0b5a03b588ab13cf.webp?v=1754357833"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64a739f4c950ef099cb0a9aa5581d4a886839017.webp?v=1754357827","options":["color"],"media":[{"alt":null,"id":25888787398755,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64a739f4c950ef099cb0a9aa5581d4a886839017.webp?v=1754357827"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64a739f4c950ef099cb0a9aa5581d4a886839017.webp?v=1754357827","width":2000},{"alt":null,"id":25888787562595,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c920af1151f721b955f5b32fe72662a7e8d770ee.webp?v=1754357828"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c920af1151f721b955f5b32fe72662a7e8d770ee.webp?v=1754357828","width":2000},{"alt":null,"id":25888787693667,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7738706198c3d0da1e97fa57de164ddc1abb3f10.webp?v=1754357829"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7738706198c3d0da1e97fa57de164ddc1abb3f10.webp?v=1754357829","width":2000},{"alt":null,"id":25888787890275,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86e3116e0fe10f2f9547b449726d2741813fcda.webp?v=1754357829"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86e3116e0fe10f2f9547b449726d2741813fcda.webp?v=1754357829","width":2000},{"alt":null,"id":25888788054115,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/05f2d935b661263fbddc99f5a5aae869adeb3b97.webp?v=1754357830"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/05f2d935b661263fbddc99f5a5aae869adeb3b97.webp?v=1754357830","width":2000},{"alt":null,"id":25888788316259,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f6fe12c56c71be300e1987f8cb8b2c926ff77c8.webp?v=1754357831"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6f6fe12c56c71be300e1987f8cb8b2c926ff77c8.webp?v=1754357831","width":2000},{"alt":null,"id":25888788676707,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/699c276e1bdbf8eee98facbcd226093a5a41ad10.webp?v=1754357831"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/699c276e1bdbf8eee98facbcd226093a5a41ad10.webp?v=1754357831","width":2000},{"alt":null,"id":25888788938851,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ea51ea5d1083e655ae57d030a3417650c4df02.webp?v=1754357832"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ea51ea5d1083e655ae57d030a3417650c4df02.webp?v=1754357832","width":2000},{"alt":null,"id":25888789168227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a13922622baa3626b5d9214c48ddaa4d1e61882.webp?v=1754357833"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a13922622baa3626b5d9214c48ddaa4d1e61882.webp?v=1754357833","width":2000},{"alt":null,"id":25888789364835,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa87fa8a587e993c021cef2a0b5a03b588ab13cf.webp?v=1754357833"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa87fa8a587e993c021cef2a0b5a03b588ab13cf.webp?v=1754357833","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43562807230563,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287679864931,"product_id":7848027750499,"position":8,"created_at":"2025-08-05T09:37:10+08:00","updated_at":"2025-08-05T09:37:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ea51ea5d1083e655ae57d030a3417650c4df02.webp?v=1754357832","variant_ids":[43562807230563]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-FV61","featured_media":{"alt":null,"id":25888788938851,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ea51ea5d1083e655ae57d030a3417650c4df02.webp?v=1754357832"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562807263331,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287677079651,"product_id":7848027750499,"position":2,"created_at":"2025-08-05T09:37:06+08:00","updated_at":"2025-08-05T09:37:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c920af1151f721b955f5b32fe72662a7e8d770ee.webp?v=1754357828","variant_ids":[43562807263331]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - Glacier Blue","public_title":"Glacier Blue","options":["Glacier Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298Z7-FV61","featured_media":{"alt":null,"id":25888787562595,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c920af1151f721b955f5b32fe72662a7e8d770ee.webp?v=1754357828"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562807328867,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287680159843,"product_id":7848027750499,"position":9,"created_at":"2025-08-05T09:37:10+08:00","updated_at":"2025-08-05T09:37:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a13922622baa3626b5d9214c48ddaa4d1e61882.webp?v=1754357833","variant_ids":[43562807328867]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - Ash Grey","public_title":"Ash Grey","options":["Ash Grey"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST01298O8-FV61","featured_media":{"alt":null,"id":25888789168227,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1a13922622baa3626b5d9214c48ddaa4d1e61882.webp?v=1754357833"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562807361635,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287680553059,"product_id":7848027750499,"position":10,"created_at":"2025-08-05T09:37:11+08:00","updated_at":"2025-08-05T09:37:13+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa87fa8a587e993c021cef2a0b5a03b588ab13cf.webp?v=1754357833","variant_ids":[43562807361635]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129853-FV61","featured_media":{"alt":null,"id":25888789364835,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fa87fa8a587e993c021cef2a0b5a03b588ab13cf.webp?v=1754357833"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43562807492707,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287678095459,"product_id":7848027750499,"position":4,"created_at":"2025-08-05T09:37:07+08:00","updated_at":"2025-08-05T09:37:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86e3116e0fe10f2f9547b449726d2741813fcda.webp?v=1754357829","variant_ids":[43562807492707]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129852-FV61","featured_media":{"alt":null,"id":25888787890275,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a86e3116e0fe10f2f9547b449726d2741813fcda.webp?v=1754357829"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43562807230563,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-FV61","requires_shipping":true,"taxable":true,"featured_image":{"id":34287679864931,"product_id":7848027750499,"position":8,"created_at":"2025-08-05T09:37:10+08:00","updated_at":"2025-08-05T09:37:12+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ea51ea5d1083e655ae57d030a3417650c4df02.webp?v=1754357832","variant_ids":[43562807230563]},"available":true,"name":"iPhone 15 Pro Max SolidX 嗨小強 Peekaboo - Blush Pink","public_title":"Blush Pink","options":["Blush Pink"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"NST0129857-FV61","featured_media":{"alt":null,"id":25888788938851,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/32ea51ea5d1083e655ae57d030a3417650c4df02.webp?v=1754357832"}},"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: "停產" }