$product = {"id":7931297202275,"title":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um...","handle":"iphone-15-pro-max-solidx-ei82","description":null,"published_at":"2025-11-28T10:59:51+08:00","created_at":"2025-11-28T10:17:46+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-darylhochi","device-iPhone 15 Pro Max","merge","reseller-darylhochi"],"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":43860916306019,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861691535459,"product_id":7931297202275,"position":7,"created_at":"2025-11-28T10:19:12+08:00","updated_at":"2025-11-28T10:19:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8081b7ba4a6ce1f1a5042884420605bb0106dd.webp?v=1764296354","variant_ids":[43860916306019]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426111000675,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8081b7ba4a6ce1f1a5042884420605bb0106dd.webp?v=1764296354"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860916371555,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861692026979,"product_id":7931297202275,"position":9,"created_at":"2025-11-28T10:19:14+08:00","updated_at":"2025-11-28T10:19:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/85f943e4cef7c9746e6b9abefda28eb6b8398ee1.webp?v=1764296356","variant_ids":[43860916371555]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426111524963,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/85f943e4cef7c9746e6b9abefda28eb6b8398ee1.webp?v=1764296356"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860916404323,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861690650723,"product_id":7931297202275,"position":1,"created_at":"2025-11-28T10:19:06+08:00","updated_at":"2025-11-28T10:19:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9deedb3f5973c113f5e4447058d73f764aad98ee.webp?v=1764296348","variant_ids":[43860916404323]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426110115939,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9deedb3f5973c113f5e4447058d73f764aad98ee.webp?v=1764296348"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860916437091,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861690978403,"product_id":7931297202275,"position":3,"created_at":"2025-11-28T10:19:07+08:00","updated_at":"2025-11-28T10:19:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bf77af1a09ec0b24afc891c3678e0a21ec0afb4.webp?v=1764296349","variant_ids":[43860916437091]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426110378083,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bf77af1a09ec0b24afc891c3678e0a21ec0afb4.webp?v=1764296349"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860916502627,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861692158051,"product_id":7931297202275,"position":10,"created_at":"2025-11-28T10:19:14+08:00","updated_at":"2025-11-28T10:19:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1076d7ef51b4af65d853c09b1068e7db2d82723e.webp?v=1764296356","variant_ids":[43860916502627]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426111656035,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1076d7ef51b4af65d853c09b1068e7db2d82723e.webp?v=1764296356"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9deedb3f5973c113f5e4447058d73f764aad98ee.webp?v=1764296348","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80c7155302dff0a21e8125754db2f247c95e591d.webp?v=1764296348","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bf77af1a09ec0b24afc891c3678e0a21ec0afb4.webp?v=1764296349","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f68afcd466ba69a17bbe70f3d79d690cb1a2a786.webp?v=1764296350","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e5cdad95d95b5efe5eaea1f30bd82133cb55002.webp?v=1764296352","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be42f47a00dcef70090bdd21c3ad76d6051c9d33.webp?v=1764296354","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8081b7ba4a6ce1f1a5042884420605bb0106dd.webp?v=1764296354","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/92c447dfbb7fc4da9c254ba2858831cdbe7191ac.webp?v=1764296355","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/85f943e4cef7c9746e6b9abefda28eb6b8398ee1.webp?v=1764296356","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1076d7ef51b4af65d853c09b1068e7db2d82723e.webp?v=1764296356"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9deedb3f5973c113f5e4447058d73f764aad98ee.webp?v=1764296348","options":["color"],"media":[{"alt":null,"id":26426110115939,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9deedb3f5973c113f5e4447058d73f764aad98ee.webp?v=1764296348"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9deedb3f5973c113f5e4447058d73f764aad98ee.webp?v=1764296348","width":2000},{"alt":null,"id":26426110247011,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80c7155302dff0a21e8125754db2f247c95e591d.webp?v=1764296348"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/80c7155302dff0a21e8125754db2f247c95e591d.webp?v=1764296348","width":2000},{"alt":null,"id":26426110378083,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bf77af1a09ec0b24afc891c3678e0a21ec0afb4.webp?v=1764296349"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bf77af1a09ec0b24afc891c3678e0a21ec0afb4.webp?v=1764296349","width":2000},{"alt":null,"id":26426110410851,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f68afcd466ba69a17bbe70f3d79d690cb1a2a786.webp?v=1764296350"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f68afcd466ba69a17bbe70f3d79d690cb1a2a786.webp?v=1764296350","width":2000},{"alt":null,"id":26426110541923,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e5cdad95d95b5efe5eaea1f30bd82133cb55002.webp?v=1764296352"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2e5cdad95d95b5efe5eaea1f30bd82133cb55002.webp?v=1764296352","width":2000},{"alt":null,"id":26426110869603,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be42f47a00dcef70090bdd21c3ad76d6051c9d33.webp?v=1764296354"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/be42f47a00dcef70090bdd21c3ad76d6051c9d33.webp?v=1764296354","width":2000},{"alt":null,"id":26426111000675,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8081b7ba4a6ce1f1a5042884420605bb0106dd.webp?v=1764296354"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8081b7ba4a6ce1f1a5042884420605bb0106dd.webp?v=1764296354","width":2000},{"alt":null,"id":26426111197283,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/92c447dfbb7fc4da9c254ba2858831cdbe7191ac.webp?v=1764296355"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/92c447dfbb7fc4da9c254ba2858831cdbe7191ac.webp?v=1764296355","width":2000},{"alt":null,"id":26426111524963,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/85f943e4cef7c9746e6b9abefda28eb6b8398ee1.webp?v=1764296356"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/85f943e4cef7c9746e6b9abefda28eb6b8398ee1.webp?v=1764296356","width":2000},{"alt":null,"id":26426111656035,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1076d7ef51b4af65d853c09b1068e7db2d82723e.webp?v=1764296356"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1076d7ef51b4af65d853c09b1068e7db2d82723e.webp?v=1764296356","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43860916306019,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861691535459,"product_id":7931297202275,"position":7,"created_at":"2025-11-28T10:19:12+08:00","updated_at":"2025-11-28T10:19:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8081b7ba4a6ce1f1a5042884420605bb0106dd.webp?v=1764296354","variant_ids":[43860916306019]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426111000675,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8081b7ba4a6ce1f1a5042884420605bb0106dd.webp?v=1764296354"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860916371555,"title":"Ash Grey","option1":"Ash Grey","option2":null,"option3":null,"sku":"NST01298O8-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861692026979,"product_id":7931297202275,"position":9,"created_at":"2025-11-28T10:19:14+08:00","updated_at":"2025-11-28T10:19:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/85f943e4cef7c9746e6b9abefda28eb6b8398ee1.webp?v=1764296356","variant_ids":[43860916371555]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426111524963,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/85f943e4cef7c9746e6b9abefda28eb6b8398ee1.webp?v=1764296356"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860916404323,"title":"White","option1":"White","option2":null,"option3":null,"sku":"NST0129853-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861690650723,"product_id":7931297202275,"position":1,"created_at":"2025-11-28T10:19:06+08:00","updated_at":"2025-11-28T10:19:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9deedb3f5973c113f5e4447058d73f764aad98ee.webp?v=1764296348","variant_ids":[43860916404323]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426110115939,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9deedb3f5973c113f5e4447058d73f764aad98ee.webp?v=1764296348"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860916437091,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"NST0129852-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861690978403,"product_id":7931297202275,"position":3,"created_at":"2025-11-28T10:19:07+08:00","updated_at":"2025-11-28T10:19:09+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bf77af1a09ec0b24afc891c3678e0a21ec0afb4.webp?v=1764296349","variant_ids":[43860916437091]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426110378083,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5bf77af1a09ec0b24afc891c3678e0a21ec0afb4.webp?v=1764296349"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43860916502627,"title":"Glacier Blue","option1":"Glacier Blue","option2":null,"option3":null,"sku":"NST01298Z7-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861692158051,"product_id":7931297202275,"position":10,"created_at":"2025-11-28T10:19:14+08:00","updated_at":"2025-11-28T10:19:16+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1076d7ef51b4af65d853c09b1068e7db2d82723e.webp?v=1764296356","variant_ids":[43860916502627]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426111656035,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/1076d7ef51b4af65d853c09b1068e7db2d82723e.webp?v=1764296356"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43860916306019,"title":"Blush Pink","option1":"Blush Pink","option2":null,"option3":null,"sku":"NST0129857-EI82","requires_shipping":true,"taxable":true,"featured_image":{"id":34861691535459,"product_id":7931297202275,"position":7,"created_at":"2025-11-28T10:19:12+08:00","updated_at":"2025-11-28T10:19:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8081b7ba4a6ce1f1a5042884420605bb0106dd.webp?v=1764296354","variant_ids":[43860916306019]},"available":true,"name":"iPhone 15 Pro Max SolidX 白白日記 By Darylhochi Um... - 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-EI82","featured_media":{"alt":null,"id":26426111000675,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/ee8081b7ba4a6ce1f1a5042884420605bb0106dd.webp?v=1764296354"}},"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: "停產" }