Fix negative values on item price (#335)

* Fix negative values on item price

* Remove console log
This commit is contained in:
mchev
2025-04-05 00:43:34 +02:00
committed by GitHub
parent 23a99758d2
commit 1bb65f420c
2 changed files with 31 additions and 13 deletions

View File

@@ -254,22 +254,12 @@ const quantity = computed({
const price = computed({
get: () => {
const price = props.itemData.price
if (parseFloat(price) > 0) {
return price / 100
}
return price
return price / 100
},
set: (newValue) => {
if (parseFloat(newValue) > 0) {
let price = Math.round(newValue * 100)
updateItemAttribute('price', price)
} else {
updateItemAttribute('price', newValue)
}
let price = Math.round(newValue * 100)
updateItemAttribute('price', price)
setDiscount()
},
})