$product = {"id":7888502358115,"title":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 線條熊熊","handle":"iphone-15-pro-max-solidx-es08","description":null,"published_at":"2025-09-22T17:18:30+08:00","created_at":"2025-09-22T15:58:01+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":43743369232483,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514676809827,"product_id":7888502358115,"position":2,"created_at":"2025-09-22T15:58:05+08:00","updated_at":"2025-09-22T15:58:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e28b4ddfe9ae595a523e86457528d4ca8416c47f.webp?v=1758527887","variant_ids":[43743369232483]},"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-ES08","featured_media":{"alt":null,"id":26085119295587,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e28b4ddfe9ae595a523e86457528d4ca8416c47f.webp?v=1758527887"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743369265251,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514676613219,"product_id":7888502358115,"position":1,"created_at":"2025-09-22T15:58:04+08:00","updated_at":"2025-09-22T15:58:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d81280468d679a5b17155929f397965c81f5ad0c.webp?v=1758527886","variant_ids":[43743369265251]},"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-ES08","featured_media":{"alt":null,"id":26085119098979,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d81280468d679a5b17155929f397965c81f5ad0c.webp?v=1758527886"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743369330787,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514677923939,"product_id":7888502358115,"position":7,"created_at":"2025-09-22T15:58:07+08:00","updated_at":"2025-09-22T15:58:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c255566ae32b0826742c4a297a376c3d4ab18c1d.webp?v=1758527889","variant_ids":[43743369330787]},"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-ES08","featured_media":{"alt":null,"id":26085120409699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c255566ae32b0826742c4a297a376c3d4ab18c1d.webp?v=1758527889"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743369363555,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514678480995,"product_id":7888502358115,"position":9,"created_at":"2025-09-22T15:58:08+08:00","updated_at":"2025-09-22T15:58:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64e8e48d04211225b22ee8d4c78f0f47d4db471e.webp?v=1758527890","variant_ids":[43743369363555]},"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-ES08","featured_media":{"alt":null,"id":26085120966755,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64e8e48d04211225b22ee8d4c78f0f47d4db471e.webp?v=1758527890"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743369494627,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514677497955,"product_id":7888502358115,"position":5,"created_at":"2025-09-22T15:58:06+08:00","updated_at":"2025-09-22T15:58:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3c97bb6afa20d21bf92515ee01aca92b285815f.webp?v=1758527888","variant_ids":[43743369494627]},"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-ES08","featured_media":{"alt":null,"id":26085119983715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3c97bb6afa20d21bf92515ee01aca92b285815f.webp?v=1758527888"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d81280468d679a5b17155929f397965c81f5ad0c.webp?v=1758527886","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e28b4ddfe9ae595a523e86457528d4ca8416c47f.webp?v=1758527887","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc27234494fd1f0e3596e6c75f197d58c87f5ed7.webp?v=1758527887","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6131a0513c690a19aa05b0a076257a329542c7f9.webp?v=1758527888","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3c97bb6afa20d21bf92515ee01aca92b285815f.webp?v=1758527888","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97adf8b35af62a8121abd7dc4a16be4588b072c5.webp?v=1758527888","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c255566ae32b0826742c4a297a376c3d4ab18c1d.webp?v=1758527889","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/09ea71ab1ec25f8e538abf1344fc59be8544823a.webp?v=1758527889","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64e8e48d04211225b22ee8d4c78f0f47d4db471e.webp?v=1758527890","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88ded22bc87a2009a30aa51e736e6bfaaa6e26aa.webp?v=1758527891"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d81280468d679a5b17155929f397965c81f5ad0c.webp?v=1758527886","options":["color"],"media":[{"alt":null,"id":26085119098979,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d81280468d679a5b17155929f397965c81f5ad0c.webp?v=1758527886"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d81280468d679a5b17155929f397965c81f5ad0c.webp?v=1758527886","width":2000},{"alt":null,"id":26085119295587,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e28b4ddfe9ae595a523e86457528d4ca8416c47f.webp?v=1758527887"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e28b4ddfe9ae595a523e86457528d4ca8416c47f.webp?v=1758527887","width":2000},{"alt":null,"id":26085119524963,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc27234494fd1f0e3596e6c75f197d58c87f5ed7.webp?v=1758527887"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/dc27234494fd1f0e3596e6c75f197d58c87f5ed7.webp?v=1758527887","width":2000},{"alt":null,"id":26085119754339,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6131a0513c690a19aa05b0a076257a329542c7f9.webp?v=1758527888"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6131a0513c690a19aa05b0a076257a329542c7f9.webp?v=1758527888","width":2000},{"alt":null,"id":26085119983715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3c97bb6afa20d21bf92515ee01aca92b285815f.webp?v=1758527888"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3c97bb6afa20d21bf92515ee01aca92b285815f.webp?v=1758527888","width":2000},{"alt":null,"id":26085120180323,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97adf8b35af62a8121abd7dc4a16be4588b072c5.webp?v=1758527888"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/97adf8b35af62a8121abd7dc4a16be4588b072c5.webp?v=1758527888","width":2000},{"alt":null,"id":26085120409699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c255566ae32b0826742c4a297a376c3d4ab18c1d.webp?v=1758527889"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c255566ae32b0826742c4a297a376c3d4ab18c1d.webp?v=1758527889","width":2000},{"alt":null,"id":26085120704611,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/09ea71ab1ec25f8e538abf1344fc59be8544823a.webp?v=1758527889"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/09ea71ab1ec25f8e538abf1344fc59be8544823a.webp?v=1758527889","width":2000},{"alt":null,"id":26085120966755,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64e8e48d04211225b22ee8d4c78f0f47d4db471e.webp?v=1758527890"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64e8e48d04211225b22ee8d4c78f0f47d4db471e.webp?v=1758527890","width":2000},{"alt":null,"id":26085121196131,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88ded22bc87a2009a30aa51e736e6bfaaa6e26aa.webp?v=1758527891"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/88ded22bc87a2009a30aa51e736e6bfaaa6e26aa.webp?v=1758527891","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43743369232483,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514676809827,"product_id":7888502358115,"position":2,"created_at":"2025-09-22T15:58:05+08:00","updated_at":"2025-09-22T15:58:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e28b4ddfe9ae595a523e86457528d4ca8416c47f.webp?v=1758527887","variant_ids":[43743369232483]},"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-ES08","featured_media":{"alt":null,"id":26085119295587,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e28b4ddfe9ae595a523e86457528d4ca8416c47f.webp?v=1758527887"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743369265251,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514676613219,"product_id":7888502358115,"position":1,"created_at":"2025-09-22T15:58:04+08:00","updated_at":"2025-09-22T15:58:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d81280468d679a5b17155929f397965c81f5ad0c.webp?v=1758527886","variant_ids":[43743369265251]},"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-ES08","featured_media":{"alt":null,"id":26085119098979,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d81280468d679a5b17155929f397965c81f5ad0c.webp?v=1758527886"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743369330787,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514677923939,"product_id":7888502358115,"position":7,"created_at":"2025-09-22T15:58:07+08:00","updated_at":"2025-09-22T15:58:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c255566ae32b0826742c4a297a376c3d4ab18c1d.webp?v=1758527889","variant_ids":[43743369330787]},"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-ES08","featured_media":{"alt":null,"id":26085120409699,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c255566ae32b0826742c4a297a376c3d4ab18c1d.webp?v=1758527889"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743369363555,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514678480995,"product_id":7888502358115,"position":9,"created_at":"2025-09-22T15:58:08+08:00","updated_at":"2025-09-22T15:58:10+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64e8e48d04211225b22ee8d4c78f0f47d4db471e.webp?v=1758527890","variant_ids":[43743369363555]},"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-ES08","featured_media":{"alt":null,"id":26085120966755,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/64e8e48d04211225b22ee8d4c78f0f47d4db471e.webp?v=1758527890"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743369494627,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514677497955,"product_id":7888502358115,"position":5,"created_at":"2025-09-22T15:58:06+08:00","updated_at":"2025-09-22T15:58:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3c97bb6afa20d21bf92515ee01aca92b285815f.webp?v=1758527888","variant_ids":[43743369494627]},"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-ES08","featured_media":{"alt":null,"id":26085119983715,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e3c97bb6afa20d21bf92515ee01aca92b285815f.webp?v=1758527888"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43743369232483,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES08","requires_shipping":true,"taxable":true,"featured_image":{"id":34514676809827,"product_id":7888502358115,"position":2,"created_at":"2025-09-22T15:58:05+08:00","updated_at":"2025-09-22T15:58:07+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e28b4ddfe9ae595a523e86457528d4ca8416c47f.webp?v=1758527887","variant_ids":[43743369232483]},"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-ES08","featured_media":{"alt":null,"id":26085119295587,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e28b4ddfe9ae595a523e86457528d4ca8416c47f.webp?v=1758527887"}},"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: "停產" }