$product = {"id":7888522444899,"title":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊","handle":"iphone-15-pro-max-solidx-es03","description":null,"published_at":"2025-09-22T17:14:07+08:00","created_at":"2025-09-22T16:02:16+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-annnbrownie","device-iPhone 15 Pro Max","merge","reseller-annnbrownie"],"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":43743449153635,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514760564835,"product_id":7888522444899,"position":2,"created_at":"2025-09-22T16:02:20+08:00","updated_at":"2025-09-22T16:02:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc8ae364ebd6376771a5db17db8a560eb364f9be.webp?v=1758528142","variant_ids":[43743449153635]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085202395235,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc8ae364ebd6376771a5db17db8a560eb364f9be.webp?v=1758528142"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743449186403,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514761777251,"product_id":7888522444899,"position":7,"created_at":"2025-09-22T16:02:22+08:00","updated_at":"2025-09-22T16:02:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c104f27b6f1c4894efe131e3453b84f294f1c946.webp?v=1758528144","variant_ids":[43743449186403]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085203607651,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c104f27b6f1c4894efe131e3453b84f294f1c946.webp?v=1758528144"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743449251939,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514761515107,"product_id":7888522444899,"position":6,"created_at":"2025-09-22T16:02:22+08:00","updated_at":"2025-09-22T16:02:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c49b9e98f2ad0861a1f4ad4c4ea4077fefad8d11.webp?v=1758528144","variant_ids":[43743449251939]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085203378275,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c49b9e98f2ad0861a1f4ad4c4ea4077fefad8d11.webp?v=1758528144"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743449284707,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514761023587,"product_id":7888522444899,"position":4,"created_at":"2025-09-22T16:02:21+08:00","updated_at":"2025-09-22T16:02:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b61f9c9e8d034ab5b51710e76425b3948bc33de0.webp?v=1758528142","variant_ids":[43743449284707]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085202853987,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b61f9c9e8d034ab5b51710e76425b3948bc33de0.webp?v=1758528142"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743449415779,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514760433763,"product_id":7888522444899,"position":1,"created_at":"2025-09-22T16:02:19+08:00","updated_at":"2025-09-22T16:02:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43d81b66cf7cc29d57da54f5bd50be0b66ed9157.webp?v=1758528141","variant_ids":[43743449415779]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085202264163,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43d81b66cf7cc29d57da54f5bd50be0b66ed9157.webp?v=1758528141"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43d81b66cf7cc29d57da54f5bd50be0b66ed9157.webp?v=1758528141","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc8ae364ebd6376771a5db17db8a560eb364f9be.webp?v=1758528142","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d95616762cd620fddffc184e3aac228488282223.webp?v=1758528142","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b61f9c9e8d034ab5b51710e76425b3948bc33de0.webp?v=1758528142","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b15ead1433ef20847ccd60ebd072e2bb6463dbea.webp?v=1758528143","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c49b9e98f2ad0861a1f4ad4c4ea4077fefad8d11.webp?v=1758528144","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c104f27b6f1c4894efe131e3453b84f294f1c946.webp?v=1758528144","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/436dd8be73943fbaac87315a797473213730f949.webp?v=1758528145","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c5d69811cefe96059ac9e803ca0d39d6950e7ef.webp?v=1758528145","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a0ae4859e935f818c0492fac3ff8df90e8a29cc8.webp?v=1758528146"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43d81b66cf7cc29d57da54f5bd50be0b66ed9157.webp?v=1758528141","options":["color"],"media":[{"alt":null,"id":26085202264163,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43d81b66cf7cc29d57da54f5bd50be0b66ed9157.webp?v=1758528141"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43d81b66cf7cc29d57da54f5bd50be0b66ed9157.webp?v=1758528141","width":2000},{"alt":null,"id":26085202395235,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc8ae364ebd6376771a5db17db8a560eb364f9be.webp?v=1758528142"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc8ae364ebd6376771a5db17db8a560eb364f9be.webp?v=1758528142","width":2000},{"alt":null,"id":26085202657379,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d95616762cd620fddffc184e3aac228488282223.webp?v=1758528142"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d95616762cd620fddffc184e3aac228488282223.webp?v=1758528142","width":2000},{"alt":null,"id":26085202853987,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b61f9c9e8d034ab5b51710e76425b3948bc33de0.webp?v=1758528142"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b61f9c9e8d034ab5b51710e76425b3948bc33de0.webp?v=1758528142","width":2000},{"alt":null,"id":26085203083363,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b15ead1433ef20847ccd60ebd072e2bb6463dbea.webp?v=1758528143"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b15ead1433ef20847ccd60ebd072e2bb6463dbea.webp?v=1758528143","width":2000},{"alt":null,"id":26085203378275,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c49b9e98f2ad0861a1f4ad4c4ea4077fefad8d11.webp?v=1758528144"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c49b9e98f2ad0861a1f4ad4c4ea4077fefad8d11.webp?v=1758528144","width":2000},{"alt":null,"id":26085203607651,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c104f27b6f1c4894efe131e3453b84f294f1c946.webp?v=1758528144"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c104f27b6f1c4894efe131e3453b84f294f1c946.webp?v=1758528144","width":2000},{"alt":null,"id":26085203935331,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/436dd8be73943fbaac87315a797473213730f949.webp?v=1758528145"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/436dd8be73943fbaac87315a797473213730f949.webp?v=1758528145","width":2000},{"alt":null,"id":26085204263011,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c5d69811cefe96059ac9e803ca0d39d6950e7ef.webp?v=1758528145"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c5d69811cefe96059ac9e803ca0d39d6950e7ef.webp?v=1758528145","width":2000},{"alt":null,"id":26085204557923,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a0ae4859e935f818c0492fac3ff8df90e8a29cc8.webp?v=1758528146"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a0ae4859e935f818c0492fac3ff8df90e8a29cc8.webp?v=1758528146","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43743449153635,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514760564835,"product_id":7888522444899,"position":2,"created_at":"2025-09-22T16:02:20+08:00","updated_at":"2025-09-22T16:02:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc8ae364ebd6376771a5db17db8a560eb364f9be.webp?v=1758528142","variant_ids":[43743449153635]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085202395235,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc8ae364ebd6376771a5db17db8a560eb364f9be.webp?v=1758528142"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743449186403,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514761777251,"product_id":7888522444899,"position":7,"created_at":"2025-09-22T16:02:22+08:00","updated_at":"2025-09-22T16:02:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c104f27b6f1c4894efe131e3453b84f294f1c946.webp?v=1758528144","variant_ids":[43743449186403]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085203607651,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c104f27b6f1c4894efe131e3453b84f294f1c946.webp?v=1758528144"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743449251939,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514761515107,"product_id":7888522444899,"position":6,"created_at":"2025-09-22T16:02:22+08:00","updated_at":"2025-09-22T16:02:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c49b9e98f2ad0861a1f4ad4c4ea4077fefad8d11.webp?v=1758528144","variant_ids":[43743449251939]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085203378275,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c49b9e98f2ad0861a1f4ad4c4ea4077fefad8d11.webp?v=1758528144"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743449284707,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514761023587,"product_id":7888522444899,"position":4,"created_at":"2025-09-22T16:02:21+08:00","updated_at":"2025-09-22T16:02:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b61f9c9e8d034ab5b51710e76425b3948bc33de0.webp?v=1758528142","variant_ids":[43743449284707]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085202853987,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/b61f9c9e8d034ab5b51710e76425b3948bc33de0.webp?v=1758528142"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743449415779,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514760433763,"product_id":7888522444899,"position":1,"created_at":"2025-09-22T16:02:19+08:00","updated_at":"2025-09-22T16:02:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43d81b66cf7cc29d57da54f5bd50be0b66ed9157.webp?v=1758528141","variant_ids":[43743449415779]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085202264163,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/43d81b66cf7cc29d57da54f5bd50be0b66ed9157.webp?v=1758528141"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43743449153635,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES03","requires_shipping":true,"taxable":true,"featured_image":{"id":34514760564835,"product_id":7888522444899,"position":2,"created_at":"2025-09-22T16:02:20+08:00","updated_at":"2025-09-22T16:02:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc8ae364ebd6376771a5db17db8a560eb364f9be.webp?v=1758528142","variant_ids":[43743449153635]},"available":true,"name":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 油畫熊熊 - 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-ES03","featured_media":{"alt":null,"id":26085202395235,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fc8ae364ebd6376771a5db17db8a560eb364f9be.webp?v=1758528142"}},"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: "停產" }