@@ -55,8 +55,8 @@ export const calculatePrice = ({
5555 Math . max ( amount - amountFree , 0 )
5656
5757 const finalValue =
58- valueBeforeDiscount * ( 1 - ( discount < 1 ? discount : 0 ) ) -
59- ( discount >= 1 ? Math . abs ( discount ) : 0 )
58+ valueBeforeDiscount * ( 1 - ( discount <= 1 ? discount : 0 ) ) -
59+ ( discount > 1 ? Math . abs ( discount ) : 0 )
6060
6161 return finalValue
6262}
@@ -126,12 +126,12 @@ export const calculateCategoryPrice = (
126126 ) || [ 0 , 0 ]
127127
128128 const discountedPriceMin =
129- category . discount && category . discount < 1
129+ category . discount && category . discount <= 1
130130 ? categoryPrice [ 0 ] * category . discount
131131 : categoryPrice [ 0 ] - ( category . discount ?? 0 )
132132
133133 const discountedPriceMax =
134- category . discount && category . discount < 1
134+ category . discount && category . discount <= 1
135135 ? categoryPrice [ 1 ] * category . discount
136136 : categoryPrice [ 1 ] - ( category . discount ?? 0 )
137137
@@ -141,7 +141,7 @@ export const calculateCategoryPrice = (
141141
142142 categoryPrice . map ( price =>
143143 Math . max (
144- category . discount && category . discount < 1
144+ category . discount && category . discount <= 1
145145 ? price * category . discount
146146 : price - ( category . discount ?? 0 ) ,
147147 0 ,
0 commit comments