$product = {"id":7911164379235,"title":"iPhone 12 mini SolidSuit PosterLad 色彩之雨","handle":"iphone-12-mini-solidsuit-classic-pos02","description":null,"published_at":"2025-11-05T10:54:08+08:00","created_at":"2025-11-04T10:25:43+08:00","vendor":"RHINOSHIELD Taiwan B2B","type":"","tags":["10%","20%","30%","40%","50%","brand-Apple","designer","designer-posterlad","device-iPhone 12 Mini","merge","reseller-posterlad"],"price":83000,"price_min":83000,"price_max":83000,"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":43811828858979,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":36403561660515,"product_id":7911164379235,"position":10,"created_at":"2026-07-27T16:36:57+08:00","updated_at":"2026-07-27T16:37:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521_9f66f932-225b-426d-981f-29299a11bc26.webp?v=1785141420","variant_ids":[43811828858979]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad 色彩之雨 - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118452-POS02","featured_media":{"alt":null,"id":27907169386595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521_9f66f932-225b-426d-981f-29299a11bc26.webp?v=1785141420"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811828924515,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":36403567558755,"product_id":7911164379235,"position":15,"created_at":"2026-07-27T16:37:12+08:00","updated_at":"2026-07-27T16:37:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41957a2e093de2f14d7f086dd6324e5cea3edf3b_ef178c66-c4a3-484f-8777-1f592e6dc1bd.webp?v=1785141434","variant_ids":[43811828924515]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad 色彩之雨 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST011840B-POS02","featured_media":{"alt":null,"id":27907175579747,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41957a2e093de2f14d7f086dd6324e5cea3edf3b_ef178c66-c4a3-484f-8777-1f592e6dc1bd.webp?v=1785141434"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811829022819,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"SST01184O9-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":36403566084195,"product_id":7911164379235,"position":13,"created_at":"2026-07-27T16:37:06+08:00","updated_at":"2026-07-27T16:37:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6699f068e5653632ef65cb8499e633280c9c3b92_a748a9c4-8b0f-439a-ac36-b4e7dc40c333.webp?v=1785141428","variant_ids":[43811829022819]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad 色彩之雨 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01184O9-POS02","featured_media":{"alt":null,"id":27907174039651,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6699f068e5653632ef65cb8499e633280c9c3b92_a748a9c4-8b0f-439a-ac36-b4e7dc40c333.webp?v=1785141428"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}],"images":["\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d8528a6159a9d5fb36b647cde273a497a569c74.webp?v=1762223147","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41957a2e093de2f14d7f086dd6324e5cea3edf3b.webp?v=1762223148","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6699f068e5653632ef65cb8499e633280c9c3b92.webp?v=1762223149","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a005580097dfbc1052ed26f35d832543a3ae8c.webp?v=1762223149","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/26af79e6a3da72cafb666eaa5758091380c7d66e.webp?v=1762223150","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521.webp?v=1762223151","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/713ee01de24f963aa2f75289f49fd8525bac820f.webp?v=1762223152","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d6cfec0d752eb9a639aaa2819bacc63e7f1c3da.webp?v=1762223153","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fbcfc844b683b938c3ccd2d1ea907f442e636200.webp?v=1762223153","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521_9f66f932-225b-426d-981f-29299a11bc26.webp?v=1785141420","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/713ee01de24f963aa2f75289f49fd8525bac820f_1fc4fe5c-c667-4bd1-a373-37bbe5c8fdef.webp?v=1785141422","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fbcfc844b683b938c3ccd2d1ea907f442e636200_226a8ae1-ddcc-4eae-9f24-328405b36b03.webp?v=1785141426","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6699f068e5653632ef65cb8499e633280c9c3b92_a748a9c4-8b0f-439a-ac36-b4e7dc40c333.webp?v=1785141428","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d8528a6159a9d5fb36b647cde273a497a569c74_6b22b44b-d0f4-4871-a4f0-0304d0b95c27.webp?v=1785141431","\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41957a2e093de2f14d7f086dd6324e5cea3edf3b_ef178c66-c4a3-484f-8777-1f592e6dc1bd.webp?v=1785141434"],"featured_image":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d8528a6159a9d5fb36b647cde273a497a569c74.webp?v=1762223147","options":["color"],"media":[{"alt":null,"id":26296819449955,"position":1,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d8528a6159a9d5fb36b647cde273a497a569c74.webp?v=1762223147"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d8528a6159a9d5fb36b647cde273a497a569c74.webp?v=1762223147","width":2000},{"alt":null,"id":26296819613795,"position":2,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41957a2e093de2f14d7f086dd6324e5cea3edf3b.webp?v=1762223148"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41957a2e093de2f14d7f086dd6324e5cea3edf3b.webp?v=1762223148","width":2000},{"alt":null,"id":26296819810403,"position":3,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6699f068e5653632ef65cb8499e633280c9c3b92.webp?v=1762223149"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6699f068e5653632ef65cb8499e633280c9c3b92.webp?v=1762223149","width":2000},{"alt":null,"id":26296820007011,"position":4,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a005580097dfbc1052ed26f35d832543a3ae8c.webp?v=1762223149"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/90a005580097dfbc1052ed26f35d832543a3ae8c.webp?v=1762223149","width":2000},{"alt":null,"id":26296820203619,"position":5,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/26af79e6a3da72cafb666eaa5758091380c7d66e.webp?v=1762223150"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/26af79e6a3da72cafb666eaa5758091380c7d66e.webp?v=1762223150","width":2000},{"alt":null,"id":26296820400227,"position":6,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521.webp?v=1762223151"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521.webp?v=1762223151","width":2000},{"alt":null,"id":26296820727907,"position":7,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/713ee01de24f963aa2f75289f49fd8525bac820f.webp?v=1762223152"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/713ee01de24f963aa2f75289f49fd8525bac820f.webp?v=1762223152","width":2000},{"alt":null,"id":26296821022819,"position":8,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d6cfec0d752eb9a639aaa2819bacc63e7f1c3da.webp?v=1762223153"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/9d6cfec0d752eb9a639aaa2819bacc63e7f1c3da.webp?v=1762223153","width":2000},{"alt":null,"id":26296821317731,"position":9,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fbcfc844b683b938c3ccd2d1ea907f442e636200.webp?v=1762223153"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fbcfc844b683b938c3ccd2d1ea907f442e636200.webp?v=1762223153","width":2000},{"alt":null,"id":27907169386595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521_9f66f932-225b-426d-981f-29299a11bc26.webp?v=1785141420"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521_9f66f932-225b-426d-981f-29299a11bc26.webp?v=1785141420","width":2000},{"alt":null,"id":27907170664547,"position":11,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/713ee01de24f963aa2f75289f49fd8525bac820f_1fc4fe5c-c667-4bd1-a373-37bbe5c8fdef.webp?v=1785141422"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/713ee01de24f963aa2f75289f49fd8525bac820f_1fc4fe5c-c667-4bd1-a373-37bbe5c8fdef.webp?v=1785141422","width":2000},{"alt":null,"id":27907172368483,"position":12,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fbcfc844b683b938c3ccd2d1ea907f442e636200_226a8ae1-ddcc-4eae-9f24-328405b36b03.webp?v=1785141426"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/fbcfc844b683b938c3ccd2d1ea907f442e636200_226a8ae1-ddcc-4eae-9f24-328405b36b03.webp?v=1785141426","width":2000},{"alt":null,"id":27907174039651,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6699f068e5653632ef65cb8499e633280c9c3b92_a748a9c4-8b0f-439a-ac36-b4e7dc40c333.webp?v=1785141428"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6699f068e5653632ef65cb8499e633280c9c3b92_a748a9c4-8b0f-439a-ac36-b4e7dc40c333.webp?v=1785141428","width":2000},{"alt":null,"id":27907174989923,"position":14,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d8528a6159a9d5fb36b647cde273a497a569c74_6b22b44b-d0f4-4871-a4f0-0304d0b95c27.webp?v=1785141431"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/0d8528a6159a9d5fb36b647cde273a497a569c74_6b22b44b-d0f4-4871-a4f0-0304d0b95c27.webp?v=1785141431","width":2000},{"alt":null,"id":27907175579747,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41957a2e093de2f14d7f086dd6324e5cea3edf3b_ef178c66-c4a3-484f-8777-1f592e6dc1bd.webp?v=1785141434"},"aspect_ratio":1.0,"height":2000,"media_type":"image","src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41957a2e093de2f14d7f086dd6324e5cea3edf3b_ef178c66-c4a3-484f-8777-1f592e6dc1bd.webp?v=1785141434","width":2000}],"requires_selling_plan":false,"selling_plan_groups":[],"content":null}; $isMerge = null; $variants = [{"id":43811828858979,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":36403561660515,"product_id":7911164379235,"position":10,"created_at":"2026-07-27T16:36:57+08:00","updated_at":"2026-07-27T16:37:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521_9f66f932-225b-426d-981f-29299a11bc26.webp?v=1785141420","variant_ids":[43811828858979]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad 色彩之雨 - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118452-POS02","featured_media":{"alt":null,"id":27907169386595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521_9f66f932-225b-426d-981f-29299a11bc26.webp?v=1785141420"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811828924515,"title":"Shell Beige","option1":"Shell Beige","option2":null,"option3":null,"sku":"SST011840B-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":36403567558755,"product_id":7911164379235,"position":15,"created_at":"2026-07-27T16:37:12+08:00","updated_at":"2026-07-27T16:37:14+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41957a2e093de2f14d7f086dd6324e5cea3edf3b_ef178c66-c4a3-484f-8777-1f592e6dc1bd.webp?v=1785141434","variant_ids":[43811828924515]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad 色彩之雨 - Shell Beige","public_title":"Shell Beige","options":["Shell Beige"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST011840B-POS02","featured_media":{"alt":null,"id":27907175579747,"position":15,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/41957a2e093de2f14d7f086dd6324e5cea3edf3b_ef178c66-c4a3-484f-8777-1f592e6dc1bd.webp?v=1785141434"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}},{"id":43811829022819,"title":"Cobalt Blue","option1":"Cobalt Blue","option2":null,"option3":null,"sku":"SST01184O9-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":36403566084195,"product_id":7911164379235,"position":13,"created_at":"2026-07-27T16:37:06+08:00","updated_at":"2026-07-27T16:37:08+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6699f068e5653632ef65cb8499e633280c9c3b92_a748a9c4-8b0f-439a-ac36-b4e7dc40c333.webp?v=1785141428","variant_ids":[43811829022819]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad 色彩之雨 - Cobalt Blue","public_title":"Cobalt Blue","options":["Cobalt Blue"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST01184O9-POS02","featured_media":{"alt":null,"id":27907174039651,"position":13,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/6699f068e5653632ef65cb8499e633280c9c3b92_a748a9c4-8b0f-439a-ac36-b4e7dc40c333.webp?v=1785141428"}},"requires_selling_plan":false,"selling_plan_allocations":[],"quantity_rule":{"min":1,"max":null,"increment":1}}]; $defaultVariant = {"id":43811828858979,"title":"Black","option1":"Black","option2":null,"option3":null,"sku":"SST0118452-POS02","requires_shipping":true,"taxable":true,"featured_image":{"id":36403561660515,"product_id":7911164379235,"position":10,"created_at":"2026-07-27T16:36:57+08:00","updated_at":"2026-07-27T16:37:00+08:00","alt":null,"width":2000,"height":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521_9f66f932-225b-426d-981f-29299a11bc26.webp?v=1785141420","variant_ids":[43811828858979]},"available":true,"name":"iPhone 12 mini SolidSuit PosterLad 色彩之雨 - Black","public_title":"Black","options":["Black"],"price":83000,"weight":0,"compare_at_price":null,"inventory_quantity":0,"inventory_management":null,"inventory_policy":"deny","barcode":"SST0118452-POS02","featured_media":{"alt":null,"id":27907169386595,"position":10,"preview_image":{"aspect_ratio":1.0,"height":2000,"width":2000,"src":"\/\/b2b.rhinoshield.tw\/cdn\/shop\/files\/5d5ec22d27017d05d7f3899dbffe8792e7076521_9f66f932-225b-426d-981f-29299a11bc26.webp?v=1785141420"}},"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: "停產" }