From 4fa17fcd2d4aea52d467a3c16ccd30db392ca877 Mon Sep 17 00:00:00 2001 From: amansinghbais Date: Wed, 25 Oct 2023 09:49:18 +0530 Subject: [PATCH] Improved: code to avoid duplication of feature option (#620) --- src/views/catalog-product-details.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/views/catalog-product-details.vue b/src/views/catalog-product-details.vue index a9e83e9c..c8cb3f79 100644 --- a/src/views/catalog-product-details.vue +++ b/src/views/catalog-product-details.vue @@ -509,7 +509,9 @@ export default defineComponent({ const nextFeatureAvailableValues = [] as any availableVariants.map((variant: any) => { - nextFeatureAvailableValues.push(getFeature(variant.featureHierarchy , `1/${nextFeatureType}`)) + if(!nextFeatureAvailableValues.includes(getFeature(variant.featureHierarchy , `1/${nextFeatureType}`))){ + nextFeatureAvailableValues.push(getFeature(variant.featureHierarchy , `1/${nextFeatureType}`)) + } }) this.features[nextFeatureType] = nextFeatureType === 'SIZE' ? sortSizes(nextFeatureAvailableValues) : nextFeatureAvailableValues }