$product = {"id":7888529129571,"title":"iPhone 15 Pro Max SolidX 布朗尼 annnbrownie 麵包派對(巧克熊款)","handle":"iphone-15-pro-max-solidx-es09","description":null,"published_at":"2025-09-22T17:12:29+08:00","created_at":"2025-09-22T16:03:41+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":43743477071971,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514790940771,"product_id":7888529129571,"position":4,"created_at":"2025-09-22T16:03:47+08:00","updated_at":"2025-09-22T16:03:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/995af07a9c78a9b309988d5ec96f4f3663441435.webp?v=1758528229","variant_ids":[43743477071971]},"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-ES09","featured_media":{"alt":null,"id":26085233393763,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/995af07a9c78a9b309988d5ec96f4f3663441435.webp?v=1758528229"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743477104739,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514790711395,"product_id":7888529129571,"position":3,"created_at":"2025-09-22T16:03:46+08:00","updated_at":"2025-09-22T16:03:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/339678b86d20ee303c6ee6bb0ef6128bb97ff22b.webp?v=1758528228","variant_ids":[43743477104739]},"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-ES09","featured_media":{"alt":null,"id":26085233164387,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/339678b86d20ee303c6ee6bb0ef6128bb97ff22b.webp?v=1758528228"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743477170275,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514790187107,"product_id":7888529129571,"position":1,"created_at":"2025-09-22T16:03:45+08:00","updated_at":"2025-09-22T16:03:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12b8685e6f68013049ffa3f041db708aeddd53ff.webp?v=1758528228","variant_ids":[43743477170275]},"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-ES09","featured_media":{"alt":null,"id":26085232640099,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12b8685e6f68013049ffa3f041db708aeddd53ff.webp?v=1758528228"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743477203043,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514791694435,"product_id":7888529129571,"position":7,"created_at":"2025-09-22T16:03:48+08:00","updated_at":"2025-09-22T16:03:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/878da0f1c0ecd62b82733733ccb03bfec1d7e0a8.webp?v=1758528230","variant_ids":[43743477203043]},"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-ES09","featured_media":{"alt":null,"id":26085234147427,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/878da0f1c0ecd62b82733733ccb03bfec1d7e0a8.webp?v=1758528230"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743477334115,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514792120419,"product_id":7888529129571,"position":10,"created_at":"2025-09-22T16:03:50+08:00","updated_at":"2025-09-22T16:03:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cabadd4698d695cb8766db4a35cfd5b3f589090a.webp?v=1758528231","variant_ids":[43743477334115]},"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-ES09","featured_media":{"alt":null,"id":26085234573411,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cabadd4698d695cb8766db4a35cfd5b3f589090a.webp?v=1758528231"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12b8685e6f68013049ffa3f041db708aeddd53ff.webp?v=1758528228","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c090677ce17aba0bf62b46f78472d7e34c9df279.webp?v=1758528227","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/339678b86d20ee303c6ee6bb0ef6128bb97ff22b.webp?v=1758528228","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/995af07a9c78a9b309988d5ec96f4f3663441435.webp?v=1758528229","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c95c35559cae1cd573d1d2291e52c743aa505971.webp?v=1758528229","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7357cd06c424a985cab3b413e72fef56a7c43b1.webp?v=1758528230","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/878da0f1c0ecd62b82733733ccb03bfec1d7e0a8.webp?v=1758528230","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2f520ca3136cc08ae4397dbe28f18a0c6be343d.webp?v=1758528231","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/01b6dd8f7653784f6f3cb4a32f77dbcc508f78e7.webp?v=1758528231","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cabadd4698d695cb8766db4a35cfd5b3f589090a.webp?v=1758528231"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12b8685e6f68013049ffa3f041db708aeddd53ff.webp?v=1758528228","options":["color"],"media":[{"alt":null,"id":26085232640099,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12b8685e6f68013049ffa3f041db708aeddd53ff.webp?v=1758528228"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12b8685e6f68013049ffa3f041db708aeddd53ff.webp?v=1758528228","width":2000},{"alt":null,"id":26085233033315,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c090677ce17aba0bf62b46f78472d7e34c9df279.webp?v=1758528227"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c090677ce17aba0bf62b46f78472d7e34c9df279.webp?v=1758528227","width":2000},{"alt":null,"id":26085233164387,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/339678b86d20ee303c6ee6bb0ef6128bb97ff22b.webp?v=1758528228"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/339678b86d20ee303c6ee6bb0ef6128bb97ff22b.webp?v=1758528228","width":2000},{"alt":null,"id":26085233393763,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/995af07a9c78a9b309988d5ec96f4f3663441435.webp?v=1758528229"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/995af07a9c78a9b309988d5ec96f4f3663441435.webp?v=1758528229","width":2000},{"alt":null,"id":26085233688675,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c95c35559cae1cd573d1d2291e52c743aa505971.webp?v=1758528229"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c95c35559cae1cd573d1d2291e52c743aa505971.webp?v=1758528229","width":2000},{"alt":null,"id":26085233918051,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7357cd06c424a985cab3b413e72fef56a7c43b1.webp?v=1758528230"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a7357cd06c424a985cab3b413e72fef56a7c43b1.webp?v=1758528230","width":2000},{"alt":null,"id":26085234147427,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/878da0f1c0ecd62b82733733ccb03bfec1d7e0a8.webp?v=1758528230"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/878da0f1c0ecd62b82733733ccb03bfec1d7e0a8.webp?v=1758528230","width":2000},{"alt":null,"id":26085234245731,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2f520ca3136cc08ae4397dbe28f18a0c6be343d.webp?v=1758528231"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e2f520ca3136cc08ae4397dbe28f18a0c6be343d.webp?v=1758528231","width":2000},{"alt":null,"id":26085234409571,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/01b6dd8f7653784f6f3cb4a32f77dbcc508f78e7.webp?v=1758528231"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/01b6dd8f7653784f6f3cb4a32f77dbcc508f78e7.webp?v=1758528231","width":2000},{"alt":null,"id":26085234573411,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cabadd4698d695cb8766db4a35cfd5b3f589090a.webp?v=1758528231"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cabadd4698d695cb8766db4a35cfd5b3f589090a.webp?v=1758528231","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43743477071971,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514790940771,"product_id":7888529129571,"position":4,"created_at":"2025-09-22T16:03:47+08:00","updated_at":"2025-09-22T16:03:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/995af07a9c78a9b309988d5ec96f4f3663441435.webp?v=1758528229","variant_ids":[43743477071971]},"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-ES09","featured_media":{"alt":null,"id":26085233393763,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/995af07a9c78a9b309988d5ec96f4f3663441435.webp?v=1758528229"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743477104739,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514790711395,"product_id":7888529129571,"position":3,"created_at":"2025-09-22T16:03:46+08:00","updated_at":"2025-09-22T16:03:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/339678b86d20ee303c6ee6bb0ef6128bb97ff22b.webp?v=1758528228","variant_ids":[43743477104739]},"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-ES09","featured_media":{"alt":null,"id":26085233164387,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/339678b86d20ee303c6ee6bb0ef6128bb97ff22b.webp?v=1758528228"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743477170275,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514790187107,"product_id":7888529129571,"position":1,"created_at":"2025-09-22T16:03:45+08:00","updated_at":"2025-09-22T16:03:48+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12b8685e6f68013049ffa3f041db708aeddd53ff.webp?v=1758528228","variant_ids":[43743477170275]},"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-ES09","featured_media":{"alt":null,"id":26085232640099,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/12b8685e6f68013049ffa3f041db708aeddd53ff.webp?v=1758528228"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743477203043,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514791694435,"product_id":7888529129571,"position":7,"created_at":"2025-09-22T16:03:48+08:00","updated_at":"2025-09-22T16:03:50+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/878da0f1c0ecd62b82733733ccb03bfec1d7e0a8.webp?v=1758528230","variant_ids":[43743477203043]},"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-ES09","featured_media":{"alt":null,"id":26085234147427,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/878da0f1c0ecd62b82733733ccb03bfec1d7e0a8.webp?v=1758528230"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43743477334115,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514792120419,"product_id":7888529129571,"position":10,"created_at":"2025-09-22T16:03:50+08:00","updated_at":"2025-09-22T16:03:51+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cabadd4698d695cb8766db4a35cfd5b3f589090a.webp?v=1758528231","variant_ids":[43743477334115]},"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-ES09","featured_media":{"alt":null,"id":26085234573411,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/cabadd4698d695cb8766db4a35cfd5b3f589090a.webp?v=1758528231"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43743477071971,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-ES09","requires_shipping":true,"taxable":true,"featured_image":{"id":34514790940771,"product_id":7888529129571,"position":4,"created_at":"2025-09-22T16:03:47+08:00","updated_at":"2025-09-22T16:03:49+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/995af07a9c78a9b309988d5ec96f4f3663441435.webp?v=1758528229","variant_ids":[43743477071971]},"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-ES09","featured_media":{"alt":null,"id":26085233393763,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/995af07a9c78a9b309988d5ec96f4f3663441435.webp?v=1758528229"}},"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: "停產" }