$product = {"id":6981298094179,"title":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中","handle":"iphone-12-pro-max-solidsuit-classic-magsafe-ei09","description":null,"published_at":"2023-08-01T19:10:02+08:00","created_at":"2023-07-26T20:20:16+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師SolidSuit MagSafe專區-齊柏林《看見台灣》十週年原創設計系列","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-darylhochi","device-iPhone 12 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":40584848277603,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582280761443,"product_id":6981298094179,"position":8,"created_at":"2026-04-02T16:17:20+08:00","updated_at":"2026-04-02T16:17:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e07914b2f8ab8a75059bcb4c342c7017adc05c17.webp?v=1775117842","variant_ids":[40584848277603]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118752-EI09","featured_media":{"alt":null,"id":27114900488291,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e07914b2f8ab8a75059bcb4c342c7017adc05c17.webp?v=1775117842"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40584848441443,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01187O9-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582280892515,"product_id":6981298094179,"position":9,"created_at":"2026-04-02T16:17:21+08:00","updated_at":"2026-04-02T16:17:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47931db37ab026259b094ad817de863d2a4588b9.webp?v=1775117843","variant_ids":[40584848441443]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01187O9-EI09","featured_media":{"alt":null,"id":27114900619363,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47931db37ab026259b094ad817de863d2a4588b9.webp?v=1775117843"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40584848801891,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST011870B-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582280204387,"product_id":6981298094179,"position":5,"created_at":"2026-04-02T16:17:19+08:00","updated_at":"2026-04-02T16:17:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/424be9630f4403dd15ec9f973f2144a1b31cf3d0.webp?v=1775117841","variant_ids":[40584848801891]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870B-EI09","featured_media":{"alt":null,"id":27114899931235,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/424be9630f4403dd15ec9f973f2144a1b31cf3d0.webp?v=1775117841"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40584848998499,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST011870C-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582280433763,"product_id":6981298094179,"position":6,"created_at":"2026-04-02T16:17:19+08:00","updated_at":"2026-04-02T16:17:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a94e23e2a22c7b24754a238cd2412db63a32714f.webp?v=1775117841","variant_ids":[40584848998499]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870C-EI09","featured_media":{"alt":null,"id":27114900160611,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a94e23e2a22c7b24754a238cd2412db63a32714f.webp?v=1775117841"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40584849064035,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011870E-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582279843939,"product_id":6981298094179,"position":3,"created_at":"2026-04-02T16:17:17+08:00","updated_at":"2026-04-02T16:17:19+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8c7ee48eba95984fbaab01ecf6803eb5f9665a0.webp?v=1775117839","variant_ids":[40584849064035]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870E-EI09","featured_media":{"alt":null,"id":27114899570787,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8c7ee48eba95984fbaab01ecf6803eb5f9665a0.webp?v=1775117839"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-187-EI09.png?v=1690374018","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c4fc848b7d7cb01d381a8ef444fdc8249a74b79.webp?v=1775117839","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8c7ee48eba95984fbaab01ecf6803eb5f9665a0.webp?v=1775117839","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5113f1b2cd56aeec97ddfa5e9271c07f92a1f96d.webp?v=1775117840","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/424be9630f4403dd15ec9f973f2144a1b31cf3d0.webp?v=1775117841","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a94e23e2a22c7b24754a238cd2412db63a32714f.webp?v=1775117841","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/079cd3e4577271808ed46f856a5da0fc7c6922a2.webp?v=1775117842","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e07914b2f8ab8a75059bcb4c342c7017adc05c17.webp?v=1775117842","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47931db37ab026259b094ad817de863d2a4588b9.webp?v=1775117843"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-187-EI09.png?v=1690374018","options":["color"],"media":[{"alt":null,"id":22630735446115,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-187-EI09.png?v=1690374018"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-187-EI09.png?v=1690374018","width":2000},{"alt":null,"id":27114899439715,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c4fc848b7d7cb01d381a8ef444fdc8249a74b79.webp?v=1775117839"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/2c4fc848b7d7cb01d381a8ef444fdc8249a74b79.webp?v=1775117839","width":2000},{"alt":null,"id":27114899570787,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8c7ee48eba95984fbaab01ecf6803eb5f9665a0.webp?v=1775117839"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8c7ee48eba95984fbaab01ecf6803eb5f9665a0.webp?v=1775117839","width":2000},{"alt":null,"id":27114899734627,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5113f1b2cd56aeec97ddfa5e9271c07f92a1f96d.webp?v=1775117840"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5113f1b2cd56aeec97ddfa5e9271c07f92a1f96d.webp?v=1775117840","width":2000},{"alt":null,"id":27114899931235,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/424be9630f4403dd15ec9f973f2144a1b31cf3d0.webp?v=1775117841"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/424be9630f4403dd15ec9f973f2144a1b31cf3d0.webp?v=1775117841","width":2000},{"alt":null,"id":27114900160611,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a94e23e2a22c7b24754a238cd2412db63a32714f.webp?v=1775117841"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a94e23e2a22c7b24754a238cd2412db63a32714f.webp?v=1775117841","width":2000},{"alt":null,"id":27114900324451,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/079cd3e4577271808ed46f856a5da0fc7c6922a2.webp?v=1775117842"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/079cd3e4577271808ed46f856a5da0fc7c6922a2.webp?v=1775117842","width":2000},{"alt":null,"id":27114900488291,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e07914b2f8ab8a75059bcb4c342c7017adc05c17.webp?v=1775117842"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e07914b2f8ab8a75059bcb4c342c7017adc05c17.webp?v=1775117842","width":2000},{"alt":null,"id":27114900619363,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47931db37ab026259b094ad817de863d2a4588b9.webp?v=1775117843"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47931db37ab026259b094ad817de863d2a4588b9.webp?v=1775117843","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":40584848277603,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582280761443,"product_id":6981298094179,"position":8,"created_at":"2026-04-02T16:17:20+08:00","updated_at":"2026-04-02T16:17:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e07914b2f8ab8a75059bcb4c342c7017adc05c17.webp?v=1775117842","variant_ids":[40584848277603]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118752-EI09","featured_media":{"alt":null,"id":27114900488291,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e07914b2f8ab8a75059bcb4c342c7017adc05c17.webp?v=1775117842"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40584848441443,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"MST01187O9-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582280892515,"product_id":6981298094179,"position":9,"created_at":"2026-04-02T16:17:21+08:00","updated_at":"2026-04-02T16:17:23+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47931db37ab026259b094ad817de863d2a4588b9.webp?v=1775117843","variant_ids":[40584848441443]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST01187O9-EI09","featured_media":{"alt":null,"id":27114900619363,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/47931db37ab026259b094ad817de863d2a4588b9.webp?v=1775117843"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40584848801891,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"MST011870B-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582280204387,"product_id":6981298094179,"position":5,"created_at":"2026-04-02T16:17:19+08:00","updated_at":"2026-04-02T16:17:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/424be9630f4403dd15ec9f973f2144a1b31cf3d0.webp?v=1775117841","variant_ids":[40584848801891]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870B-EI09","featured_media":{"alt":null,"id":27114899931235,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/424be9630f4403dd15ec9f973f2144a1b31cf3d0.webp?v=1775117841"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40584848998499,"title":"Classic Blue","option1":"Classic Blue","option2":null,"option3":null,"sku":"MST011870C-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582280433763,"product_id":6981298094179,"position":6,"created_at":"2026-04-02T16:17:19+08:00","updated_at":"2026-04-02T16:17:21+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a94e23e2a22c7b24754a238cd2412db63a32714f.webp?v=1775117841","variant_ids":[40584848998499]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Classic Blue","public_title":"Classic Blue","options":["Classic Blue"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870C-EI09","featured_media":{"alt":null,"id":27114900160611,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/a94e23e2a22c7b24754a238cd2412db63a32714f.webp?v=1775117841"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":40584849064035,"title":"Parakeet Green","option1":"Parakeet Green","option2":null,"option3":null,"sku":"MST011870E-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582279843939,"product_id":6981298094179,"position":3,"created_at":"2026-04-02T16:17:17+08:00","updated_at":"2026-04-02T16:17:19+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8c7ee48eba95984fbaab01ecf6803eb5f9665a0.webp?v=1775117839","variant_ids":[40584849064035]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Parakeet Green","public_title":"Parakeet Green","options":["Parakeet Green"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST011870E-EI09","featured_media":{"alt":null,"id":27114899570787,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f8c7ee48eba95984fbaab01ecf6803eb5f9665a0.webp?v=1775117839"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":40584848277603,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"MST0118752-EI09","requires_shipping":true,"taxable":true,"featured_image":{"id":35582280761443,"product_id":6981298094179,"position":8,"created_at":"2026-04-02T16:17:20+08:00","updated_at":"2026-04-02T16:17:22+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e07914b2f8ab8a75059bcb4c342c7017adc05c17.webp?v=1775117842","variant_ids":[40584848277603]},"available":true,"name":"iPhone 12 Pro Max SolidSuit (MagSafe 兼容) 白白日記 By Darylhochi 沐浴於星空中 - Black","public_title":"Black","options":["Black"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0118752-EI09","featured_media":{"alt":null,"id":27114900488291,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/e07914b2f8ab8a75059bcb4c342c7017adc05c17.webp?v=1775117842"}},"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: "停產" }