$product = {"id":7814652756067,"title":"iPhone 13 mini SolidSuit (MagSafe 兼容) 迪士尼公主系列 公主與花","handle":"iphone-13-mini-solidsuit-classic-magsafe-sf44","description":null,"published_at":"2025-06-11T09:48:13+08:00","created_at":"2025-06-10T10:06:59+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師SolidSuit MagSafe專區-迪士尼-公主系列 Disney Princess","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-disney-princess","device-iPhone 13 Mini","merge","reseller-disney-princess"],"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":43440082550883,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0122852-SF44","requires_shipping":true,"taxable":true,"featured_image":{"id":36080230072419,"product_id":7814652756067,"position":10,"created_at":"2026-06-24T11:19:57+08:00","updated_at":"2026-06-24T11:19:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d_2e65c6fd-802b-4864-abab-9ab15f8c8b3a.webp?v=1782271199","variant_ids":[43440082550883]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 迪士尼公主系列 公主與花 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-SF44","featured_media":{"alt":null,"id":27589366906979,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d_2e65c6fd-802b-4864-abab-9ab15f8c8b3a.webp?v=1782271199"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43440086843491,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012280C-SF44","requires_shipping":true,"taxable":true,"featured_image":{"id":34000794550371,"product_id":7814652756067,"position":1,"created_at":"2025-06-10T10:07:04+08:00","updated_at":"2025-06-10T10:07:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226","variant_ids":[43440086843491,43440086909027]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 迪士尼公主系列 公主與花 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012280C-SF44","featured_media":{"alt":null,"id":25685088338019,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43440086909027,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MST0122853-SF44","requires_shipping":true,"taxable":true,"featured_image":{"id":34000794550371,"product_id":7814652756067,"position":1,"created_at":"2025-06-10T10:07:04+08:00","updated_at":"2025-06-10T10:07:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226","variant_ids":[43440086843491,43440086909027]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 迪士尼公主系列 公主與花 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122853-SF44","featured_media":{"alt":null,"id":25685088338019,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43440087040099,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"MST01228Z8-SF44","requires_shipping":true,"taxable":true,"featured_image":{"id":36080231219299,"product_id":7814652756067,"position":12,"created_at":"2026-06-24T11:20:06+08:00","updated_at":"2026-06-24T11:20:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9852b465e7ddf8f736379695bfaea882395609a5_e93de290-6291-4798-9ce9-1fd7aa62c82b.webp?v=1782271208","variant_ids":[43440087040099]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 迪士尼公主系列 公主與花 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01228Z8-SF44","featured_media":{"alt":null,"id":27589368053859,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9852b465e7ddf8f736379695bfaea882395609a5_e93de290-6291-4798-9ce9-1fd7aa62c82b.webp?v=1782271208"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/374e4fe2bdfb41a64c4ab0339ca6ed2d0263bab0.webp?v=1768793585","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9852b465e7ddf8f736379695bfaea882395609a5.webp?v=1768793585","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/681e94e2cf674bc8c530ae5953f7b70bb06bd5d4.webp?v=1768793586","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d.webp?v=1768793586","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c24301d219b472a77238a80db01a94daead4e55a.webp?v=1768793587","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2e388e5d91c824067b73a8017c34d293e5f93a9.webp?v=1768793588","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b72bf5493a5e7382f432dd9e1048b9e6bf72683.webp?v=1768793588","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d97717ddcc8d1ca6e81148c0f77d7bec64386b28.webp?v=1768793589","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d_2e65c6fd-802b-4864-abab-9ab15f8c8b3a.webp?v=1782271199","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d97717ddcc8d1ca6e81148c0f77d7bec64386b28_52f79e19-d180-4bfc-b512-2022e72c926b.webp?v=1782271204","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9852b465e7ddf8f736379695bfaea882395609a5_e93de290-6291-4798-9ce9-1fd7aa62c82b.webp?v=1782271208"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226","options":["color"],"media":[{"alt":null,"id":25685088338019,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226","width":2000},{"alt":null,"id":26675066110051,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/374e4fe2bdfb41a64c4ab0339ca6ed2d0263bab0.webp?v=1768793585"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/374e4fe2bdfb41a64c4ab0339ca6ed2d0263bab0.webp?v=1768793585","width":2000},{"alt":null,"id":26675066404963,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9852b465e7ddf8f736379695bfaea882395609a5.webp?v=1768793585"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9852b465e7ddf8f736379695bfaea882395609a5.webp?v=1768793585","width":2000},{"alt":null,"id":26675066634339,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/681e94e2cf674bc8c530ae5953f7b70bb06bd5d4.webp?v=1768793586"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/681e94e2cf674bc8c530ae5953f7b70bb06bd5d4.webp?v=1768793586","width":2000},{"alt":null,"id":26675066929251,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d.webp?v=1768793586"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d.webp?v=1768793586","width":2000},{"alt":null,"id":26675067388003,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c24301d219b472a77238a80db01a94daead4e55a.webp?v=1768793587"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/c24301d219b472a77238a80db01a94daead4e55a.webp?v=1768793587","width":2000},{"alt":null,"id":26675067846755,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2e388e5d91c824067b73a8017c34d293e5f93a9.webp?v=1768793588"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f2e388e5d91c824067b73a8017c34d293e5f93a9.webp?v=1768793588","width":2000},{"alt":null,"id":26675068534883,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b72bf5493a5e7382f432dd9e1048b9e6bf72683.webp?v=1768793588"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5b72bf5493a5e7382f432dd9e1048b9e6bf72683.webp?v=1768793588","width":2000},{"alt":null,"id":26675069124707,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d97717ddcc8d1ca6e81148c0f77d7bec64386b28.webp?v=1768793589"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d97717ddcc8d1ca6e81148c0f77d7bec64386b28.webp?v=1768793589","width":2000},{"alt":null,"id":27589366906979,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d_2e65c6fd-802b-4864-abab-9ab15f8c8b3a.webp?v=1782271199"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d_2e65c6fd-802b-4864-abab-9ab15f8c8b3a.webp?v=1782271199","width":2000},{"alt":null,"id":27589367464035,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d97717ddcc8d1ca6e81148c0f77d7bec64386b28_52f79e19-d180-4bfc-b512-2022e72c926b.webp?v=1782271204"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/d97717ddcc8d1ca6e81148c0f77d7bec64386b28_52f79e19-d180-4bfc-b512-2022e72c926b.webp?v=1782271204","width":2000},{"alt":null,"id":27589368053859,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9852b465e7ddf8f736379695bfaea882395609a5_e93de290-6291-4798-9ce9-1fd7aa62c82b.webp?v=1782271208"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9852b465e7ddf8f736379695bfaea882395609a5_e93de290-6291-4798-9ce9-1fd7aa62c82b.webp?v=1782271208","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43440082550883,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0122852-SF44","requires_shipping":true,"taxable":true,"featured_image":{"id":36080230072419,"product_id":7814652756067,"position":10,"created_at":"2026-06-24T11:19:57+08:00","updated_at":"2026-06-24T11:19:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d_2e65c6fd-802b-4864-abab-9ab15f8c8b3a.webp?v=1782271199","variant_ids":[43440082550883]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 迪士尼公主系列 公主與花 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-SF44","featured_media":{"alt":null,"id":27589366906979,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d_2e65c6fd-802b-4864-abab-9ab15f8c8b3a.webp?v=1782271199"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43440086843491,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST012280C-SF44","requires_shipping":true,"taxable":true,"featured_image":{"id":34000794550371,"product_id":7814652756067,"position":1,"created_at":"2025-06-10T10:07:04+08:00","updated_at":"2025-06-10T10:07:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226","variant_ids":[43440086843491,43440086909027]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 迪士尼公主系列 公主與花 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012280C-SF44","featured_media":{"alt":null,"id":25685088338019,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43440086909027,"title":"White","option1":"White","option2":null,"option3":null,"sku":"MST0122853-SF44","requires_shipping":true,"taxable":true,"featured_image":{"id":34000794550371,"product_id":7814652756067,"position":1,"created_at":"2025-06-10T10:07:04+08:00","updated_at":"2025-06-10T10:07:06+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226","variant_ids":[43440086843491,43440086909027]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 迪士尼公主系列 公主與花 - White","public_title":"White","options":["White"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122853-SF44","featured_media":{"alt":null,"id":25685088338019,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3ad51e670d21bb472cc74cc8117b272e2f03bf37.webp?v=1749521226"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43440087040099,"title":"Seaweed Green","option1":"Seaweed Green","option2":null,"option3":null,"sku":"MST01228Z8-SF44","requires_shipping":true,"taxable":true,"featured_image":{"id":36080231219299,"product_id":7814652756067,"position":12,"created_at":"2026-06-24T11:20:06+08:00","updated_at":"2026-06-24T11:20:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9852b465e7ddf8f736379695bfaea882395609a5_e93de290-6291-4798-9ce9-1fd7aa62c82b.webp?v=1782271208","variant_ids":[43440087040099]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 迪士尼公主系列 公主與花 - Seaweed Green","public_title":"Seaweed Green","options":["Seaweed Green"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01228Z8-SF44","featured_media":{"alt":null,"id":27589368053859,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9852b465e7ddf8f736379695bfaea882395609a5_e93de290-6291-4798-9ce9-1fd7aa62c82b.webp?v=1782271208"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43440082550883,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0122852-SF44","requires_shipping":true,"taxable":true,"featured_image":{"id":36080230072419,"product_id":7814652756067,"position":10,"created_at":"2026-06-24T11:19:57+08:00","updated_at":"2026-06-24T11:19:59+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d_2e65c6fd-802b-4864-abab-9ab15f8c8b3a.webp?v=1782271199","variant_ids":[43440082550883]},"available":true,"name":"iPhone 13 mini SolidSuit (MagSafe 兼容) 迪士尼公主系列 公主與花 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0122852-SF44","featured_media":{"alt":null,"id":27589366906979,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/afa0fea66ed28f276f2674e4760b1dfd95d54b1d_2e65c6fd-802b-4864-abab-9ab15f8c8b3a.webp?v=1782271199"}},"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: "停產" }