Update CartItemModel.php

This commit is contained in:
Patrick
2022-02-09 00:20:25 +01:00
committed by GitHub
parent 56fb4250ea
commit 312a010406

View File

@@ -90,9 +90,9 @@ class CartItemModel extends Model
return new Attribute( return new Attribute(
get: function ($value, $attributes): Money { get: function ($value, $attributes): Money {
if (! $attributes['discount_fixed']) { if (! $attributes['discount_fixed']) {
return $attribute['price_all']->subtract($attributes['discount_fixed']) return $attribute['price_all']->subtract($attributes['discount_fixed']);
} else { } else {
return $attribute['price_all']->multiply(sprintf('%.14F', $attributes['discount_rate']), Config::get('cart.rounding', Money::ROUND_UP)), return $attribute['price_all']->multiply(sprintf('%.14F', $attributes['discount_rate']), Config::get('cart.rounding', Money::ROUND_UP));
} }
}, },
); );