$product = {"id":7921149182051,"title":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者","handle":"iphone-15-pro-max-solidx-hd73","description":null,"published_at":"2025-11-13T09:47:03+08:00","created_at":"2025-11-11T09:51:16+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-incrediville","device-iPhone 15 Pro Max","merge","reseller-incrediville"],"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":43830958194787,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786282799203,"product_id":7921149182051,"position":5,"created_at":"2025-11-11T09:51:24+08:00","updated_at":"2025-11-11T09:51:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c40d8a6516833b45233aba78e770c64b20a9e25.webp?v=1762825886","variant_ids":[43830958194787]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351739830371,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c40d8a6516833b45233aba78e770c64b20a9e25.webp?v=1762825886"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830958293091,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786282242147,"product_id":7921149182051,"position":2,"created_at":"2025-11-11T09:51:22+08:00","updated_at":"2025-11-11T09:51:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74c608b75082ed46fa0bcc142cc66d2d22a1c014.webp?v=1762825884","variant_ids":[43830958293091]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351739240547,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74c608b75082ed46fa0bcc142cc66d2d22a1c014.webp?v=1762825884"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830958358627,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786283028579,"product_id":7921149182051,"position":6,"created_at":"2025-11-11T09:51:24+08:00","updated_at":"2025-11-11T09:51:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0710912a094b283ab68365b2c7538c77d9b0058.webp?v=1762825887","variant_ids":[43830958358627]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351740059747,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0710912a094b283ab68365b2c7538c77d9b0058.webp?v=1762825887"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830958391395,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786284863587,"product_id":7921149182051,"position":9,"created_at":"2025-11-11T09:51:26+08:00","updated_at":"2025-11-11T09:51:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00b57770478c2b6cbe9b87f5316a0e95d11a9fe4.webp?v=1762825888","variant_ids":[43830958391395]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351741796451,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00b57770478c2b6cbe9b87f5316a0e95d11a9fe4.webp?v=1762825888"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830958456931,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786285158499,"product_id":7921149182051,"position":10,"created_at":"2025-11-11T09:51:27+08:00","updated_at":"2025-11-11T09:51:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ada84f28216d013f08c350cb509f5837b530ac86.webp?v=1762825889","variant_ids":[43830958456931]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351742091363,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ada84f28216d013f08c350cb509f5837b530ac86.webp?v=1762825889"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9b1b8f1622e13eba51b530e28d5b0379a27a649.webp?v=1762825883","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74c608b75082ed46fa0bcc142cc66d2d22a1c014.webp?v=1762825884","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf914070bbf57be113514864924b39f9f421c805.webp?v=1762825884","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0b7f7216df6b9ee14495e511512ed38d8f0212b.webp?v=1762825885","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c40d8a6516833b45233aba78e770c64b20a9e25.webp?v=1762825886","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0710912a094b283ab68365b2c7538c77d9b0058.webp?v=1762825887","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06a0d93365f04b35e4ad7554060093e2efa6aaf0.webp?v=1762825887","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71cde2383a30447d8b82e4b1cbcf20b585cf1e4d.webp?v=1762825888","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00b57770478c2b6cbe9b87f5316a0e95d11a9fe4.webp?v=1762825888","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ada84f28216d013f08c350cb509f5837b530ac86.webp?v=1762825889"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9b1b8f1622e13eba51b530e28d5b0379a27a649.webp?v=1762825883","options":["color"],"media":[{"alt":null,"id":26351738880099,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9b1b8f1622e13eba51b530e28d5b0379a27a649.webp?v=1762825883"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c9b1b8f1622e13eba51b530e28d5b0379a27a649.webp?v=1762825883","width":2000},{"alt":null,"id":26351739240547,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74c608b75082ed46fa0bcc142cc66d2d22a1c014.webp?v=1762825884"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74c608b75082ed46fa0bcc142cc66d2d22a1c014.webp?v=1762825884","width":2000},{"alt":null,"id":26351739437155,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf914070bbf57be113514864924b39f9f421c805.webp?v=1762825884"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/bf914070bbf57be113514864924b39f9f421c805.webp?v=1762825884","width":2000},{"alt":null,"id":26351739666531,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0b7f7216df6b9ee14495e511512ed38d8f0212b.webp?v=1762825885"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0b7f7216df6b9ee14495e511512ed38d8f0212b.webp?v=1762825885","width":2000},{"alt":null,"id":26351739830371,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c40d8a6516833b45233aba78e770c64b20a9e25.webp?v=1762825886"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c40d8a6516833b45233aba78e770c64b20a9e25.webp?v=1762825886","width":2000},{"alt":null,"id":26351740059747,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0710912a094b283ab68365b2c7538c77d9b0058.webp?v=1762825887"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0710912a094b283ab68365b2c7538c77d9b0058.webp?v=1762825887","width":2000},{"alt":null,"id":26351740944483,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06a0d93365f04b35e4ad7554060093e2efa6aaf0.webp?v=1762825887"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/06a0d93365f04b35e4ad7554060093e2efa6aaf0.webp?v=1762825887","width":2000},{"alt":null,"id":26351741501539,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71cde2383a30447d8b82e4b1cbcf20b585cf1e4d.webp?v=1762825888"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/71cde2383a30447d8b82e4b1cbcf20b585cf1e4d.webp?v=1762825888","width":2000},{"alt":null,"id":26351741796451,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00b57770478c2b6cbe9b87f5316a0e95d11a9fe4.webp?v=1762825888"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00b57770478c2b6cbe9b87f5316a0e95d11a9fe4.webp?v=1762825888","width":2000},{"alt":null,"id":26351742091363,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ada84f28216d013f08c350cb509f5837b530ac86.webp?v=1762825889"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ada84f28216d013f08c350cb509f5837b530ac86.webp?v=1762825889","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43830958194787,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786282799203,"product_id":7921149182051,"position":5,"created_at":"2025-11-11T09:51:24+08:00","updated_at":"2025-11-11T09:51:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c40d8a6516833b45233aba78e770c64b20a9e25.webp?v=1762825886","variant_ids":[43830958194787]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351739830371,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c40d8a6516833b45233aba78e770c64b20a9e25.webp?v=1762825886"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830958293091,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786282242147,"product_id":7921149182051,"position":2,"created_at":"2025-11-11T09:51:22+08:00","updated_at":"2025-11-11T09:51:24+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74c608b75082ed46fa0bcc142cc66d2d22a1c014.webp?v=1762825884","variant_ids":[43830958293091]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351739240547,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/74c608b75082ed46fa0bcc142cc66d2d22a1c014.webp?v=1762825884"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830958358627,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786283028579,"product_id":7921149182051,"position":6,"created_at":"2025-11-11T09:51:24+08:00","updated_at":"2025-11-11T09:51:27+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0710912a094b283ab68365b2c7538c77d9b0058.webp?v=1762825887","variant_ids":[43830958358627]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351740059747,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d0710912a094b283ab68365b2c7538c77d9b0058.webp?v=1762825887"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830958391395,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786284863587,"product_id":7921149182051,"position":9,"created_at":"2025-11-11T09:51:26+08:00","updated_at":"2025-11-11T09:51:28+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00b57770478c2b6cbe9b87f5316a0e95d11a9fe4.webp?v=1762825888","variant_ids":[43830958391395]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351741796451,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/00b57770478c2b6cbe9b87f5316a0e95d11a9fe4.webp?v=1762825888"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43830958456931,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786285158499,"product_id":7921149182051,"position":10,"created_at":"2025-11-11T09:51:27+08:00","updated_at":"2025-11-11T09:51:29+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ada84f28216d013f08c350cb509f5837b530ac86.webp?v=1762825889","variant_ids":[43830958456931]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351742091363,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ada84f28216d013f08c350cb509f5837b530ac86.webp?v=1762825889"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43830958194787,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-HD73","requires_shipping":true,"taxable":true,"featured_image":{"id":34786282799203,"product_id":7921149182051,"position":5,"created_at":"2025-11-11T09:51:24+08:00","updated_at":"2025-11-11T09:51:26+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c40d8a6516833b45233aba78e770c64b20a9e25.webp?v=1762825886","variant_ids":[43830958194787]},"available":true,"name":"iPhone 15 Pro Max SolidX Incrediville 怪奇事物所 台式夜遊者 - 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-HD73","featured_media":{"alt":null,"id":26351739830371,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/7c40d8a6516833b45233aba78e770c64b20a9e25.webp?v=1762825886"}},"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: "停產" }