$product = {"id":6995333578851,"title":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 涼丰 企鵝與小熊","handle":"iphone-13-pro-max-solidsuit-classic-magsafe-gd40","description":null,"published_at":"2023-08-11T11:08:59+08:00","created_at":"2023-08-10T14:57:12+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"設計師SolidSuit專區殼老爹","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-liang-feng","device-iPhone 13 Pro Max","merge","reseller-liang-feng"],"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":43102843895907,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0123252-GD40","requires_shipping":true,"taxable":true,"featured_image":{"id":30312651817059,"product_id":6995333578851,"position":1,"created_at":"2023-08-10T14:57:15+08:00","updated_at":"2023-08-10T14:57:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635","variant_ids":[43102843895907,43102844092515,43102844223587]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 涼丰 企鵝與小熊 - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0123252-GD40","featured_media":{"alt":null,"id":22671569420387,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102844092515,"title":"Shell Beige \/ Classic","option1":"Shell Beige","option2":"Classic","option3":null,"sku":"MST012320B-GD40","requires_shipping":true,"taxable":true,"featured_image":{"id":30312651817059,"product_id":6995333578851,"position":1,"created_at":"2023-08-10T14:57:15+08:00","updated_at":"2023-08-10T14:57:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635","variant_ids":[43102843895907,43102844092515,43102844223587]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 涼丰 企鵝與小熊 - Shell Beige \/ Classic","public_title":"Shell Beige \/ Classic","options":["Shell Beige","Classic"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320B-GD40","featured_media":{"alt":null,"id":22671569420387,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102844223587,"title":"Parakeet Green \/ Classic","option1":"Parakeet Green","option2":"Classic","option3":null,"sku":"MST012320E-GD40","requires_shipping":true,"taxable":true,"featured_image":{"id":30312651817059,"product_id":6995333578851,"position":1,"created_at":"2023-08-10T14:57:15+08:00","updated_at":"2023-08-10T14:57:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635","variant_ids":[43102843895907,43102844092515,43102844223587]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 涼丰 企鵝與小熊 - Parakeet Green \/ Classic","public_title":"Parakeet Green \/ Classic","options":["Parakeet Green","Classic"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320E-GD40","featured_media":{"alt":null,"id":22671569420387,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/109242479f480c9987b4deeddffe01953070974f.webp?v=1784014495","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e8eea3680815eb336af9f48001ffdd55ba62efc.webp?v=1784014497","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f7c5bc5bd5bbd3991db5d54cfe2e4369858c140e.webp?v=1784014498","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e9eee30cd49e4843d2c4a87a53f52cd4c5164c7.webp?v=1784014500","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/109242479f480c9987b4deeddffe01953070974f_3df7a87c-bde5-4923-a782-9c122553bbea.webp?v=1784018646","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e8eea3680815eb336af9f48001ffdd55ba62efc_344f3d1b-7676-4c87-9dc0-41d2db96f319.webp?v=1784018647","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f7c5bc5bd5bbd3991db5d54cfe2e4369858c140e_a569502d-1fb6-4d87-a010-42ee48c774a6.webp?v=1784018647","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e9eee30cd49e4843d2c4a87a53f52cd4c5164c7_224c3053-c228-4d6c-9640-46fc675aa579.webp?v=1784018648","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/109242479f480c9987b4deeddffe01953070974f_ab1552f7-15fb-43c9-a1c5-713f4223e1d3.webp?v=1784018734","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e8eea3680815eb336af9f48001ffdd55ba62efc_e0ff1c63-fb98-4603-a028-bd0b5a37d16c.webp?v=1784018735","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f7c5bc5bd5bbd3991db5d54cfe2e4369858c140e_88eae525-3a4b-49d1-b99b-32251f28c86e.webp?v=1784018736","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e9eee30cd49e4843d2c4a87a53f52cd4c5164c7_75482780-9ff0-4360-8545-225e67c8cacb.webp?v=1784018737"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635","options":["color","Types"],"media":[{"alt":null,"id":22671569420387,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635","width":2000},{"alt":null,"id":27761824661603,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/109242479f480c9987b4deeddffe01953070974f.webp?v=1784014495"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/109242479f480c9987b4deeddffe01953070974f.webp?v=1784014495","width":2000},{"alt":null,"id":27761826037859,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e8eea3680815eb336af9f48001ffdd55ba62efc.webp?v=1784014497"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e8eea3680815eb336af9f48001ffdd55ba62efc.webp?v=1784014497","width":2000},{"alt":null,"id":27761826889827,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f7c5bc5bd5bbd3991db5d54cfe2e4369858c140e.webp?v=1784014498"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f7c5bc5bd5bbd3991db5d54cfe2e4369858c140e.webp?v=1784014498","width":2000},{"alt":null,"id":27761827381347,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e9eee30cd49e4843d2c4a87a53f52cd4c5164c7.webp?v=1784014500"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e9eee30cd49e4843d2c4a87a53f52cd4c5164c7.webp?v=1784014500","width":2000},{"alt":null,"id":27762634817635,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/109242479f480c9987b4deeddffe01953070974f_3df7a87c-bde5-4923-a782-9c122553bbea.webp?v=1784018646"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/109242479f480c9987b4deeddffe01953070974f_3df7a87c-bde5-4923-a782-9c122553bbea.webp?v=1784018646","width":2000},{"alt":null,"id":27762635472995,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e8eea3680815eb336af9f48001ffdd55ba62efc_344f3d1b-7676-4c87-9dc0-41d2db96f319.webp?v=1784018647"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e8eea3680815eb336af9f48001ffdd55ba62efc_344f3d1b-7676-4c87-9dc0-41d2db96f319.webp?v=1784018647","width":2000},{"alt":null,"id":27762636292195,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f7c5bc5bd5bbd3991db5d54cfe2e4369858c140e_a569502d-1fb6-4d87-a010-42ee48c774a6.webp?v=1784018647"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f7c5bc5bd5bbd3991db5d54cfe2e4369858c140e_a569502d-1fb6-4d87-a010-42ee48c774a6.webp?v=1784018647","width":2000},{"alt":null,"id":27762637308003,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e9eee30cd49e4843d2c4a87a53f52cd4c5164c7_224c3053-c228-4d6c-9640-46fc675aa579.webp?v=1784018648"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e9eee30cd49e4843d2c4a87a53f52cd4c5164c7_224c3053-c228-4d6c-9640-46fc675aa579.webp?v=1784018648","width":2000},{"alt":null,"id":27762655592547,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/109242479f480c9987b4deeddffe01953070974f_ab1552f7-15fb-43c9-a1c5-713f4223e1d3.webp?v=1784018734"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/109242479f480c9987b4deeddffe01953070974f_ab1552f7-15fb-43c9-a1c5-713f4223e1d3.webp?v=1784018734","width":2000},{"alt":null,"id":27762655887459,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e8eea3680815eb336af9f48001ffdd55ba62efc_e0ff1c63-fb98-4603-a028-bd0b5a37d16c.webp?v=1784018735"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/3e8eea3680815eb336af9f48001ffdd55ba62efc_e0ff1c63-fb98-4603-a028-bd0b5a37d16c.webp?v=1784018735","width":2000},{"alt":null,"id":27762656116835,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f7c5bc5bd5bbd3991db5d54cfe2e4369858c140e_88eae525-3a4b-49d1-b99b-32251f28c86e.webp?v=1784018736"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/f7c5bc5bd5bbd3991db5d54cfe2e4369858c140e_88eae525-3a4b-49d1-b99b-32251f28c86e.webp?v=1784018736","width":2000},{"alt":null,"id":27762656804963,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e9eee30cd49e4843d2c4a87a53f52cd4c5164c7_75482780-9ff0-4360-8545-225e67c8cacb.webp?v=1784018737"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/8e9eee30cd49e4843d2c4a87a53f52cd4c5164c7_75482780-9ff0-4360-8545-225e67c8cacb.webp?v=1784018737","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43102843895907,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0123252-GD40","requires_shipping":true,"taxable":true,"featured_image":{"id":30312651817059,"product_id":6995333578851,"position":1,"created_at":"2023-08-10T14:57:15+08:00","updated_at":"2023-08-10T14:57:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635","variant_ids":[43102843895907,43102844092515,43102844223587]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 涼丰 企鵝與小熊 - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0123252-GD40","featured_media":{"alt":null,"id":22671569420387,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102844092515,"title":"Shell Beige \/ Classic","option1":"Shell Beige","option2":"Classic","option3":null,"sku":"MST012320B-GD40","requires_shipping":true,"taxable":true,"featured_image":{"id":30312651817059,"product_id":6995333578851,"position":1,"created_at":"2023-08-10T14:57:15+08:00","updated_at":"2023-08-10T14:57:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635","variant_ids":[43102843895907,43102844092515,43102844223587]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 涼丰 企鵝與小熊 - Shell Beige \/ Classic","public_title":"Shell Beige \/ Classic","options":["Shell Beige","Classic"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320B-GD40","featured_media":{"alt":null,"id":22671569420387,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43102844223587,"title":"Parakeet Green \/ Classic","option1":"Parakeet Green","option2":"Classic","option3":null,"sku":"MST012320E-GD40","requires_shipping":true,"taxable":true,"featured_image":{"id":30312651817059,"product_id":6995333578851,"position":1,"created_at":"2023-08-10T14:57:15+08:00","updated_at":"2023-08-10T14:57:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635","variant_ids":[43102843895907,43102844092515,43102844223587]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 涼丰 企鵝與小熊 - Parakeet Green \/ Classic","public_title":"Parakeet Green \/ Classic","options":["Parakeet Green","Classic"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST012320E-GD40","featured_media":{"alt":null,"id":22671569420387,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43102843895907,"title":"Black \/ Classic","option1":"Black","option2":"Classic","option3":null,"sku":"MST0123252-GD40","requires_shipping":true,"taxable":true,"featured_image":{"id":30312651817059,"product_id":6995333578851,"position":1,"created_at":"2023-08-10T14:57:15+08:00","updated_at":"2023-08-10T14:57:15+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635","variant_ids":[43102843895907,43102844092515,43102844223587]},"available":true,"name":"iPhone 13 Pro Max SolidSuit (MagSafe 兼容) 涼丰 企鵝與小熊 - Black \/ Classic","public_title":"Black \/ Classic","options":["Black","Classic"],"price":125000,"weight":1250,"compare_at_price":null,"inventory_quantity":2500,"inventory_management":null,"inventory_policy":"deny","barcode":"MST0123252-GD40","featured_media":{"alt":null,"id":22671569420387,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/SolidSuitTPE-53-232-GD40_2613eb75-b534-47e9-8144-c31dd5b2545c.png?v=1691650635"}},"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: "停產" }