mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-23 23:51:25 +00:00
Update CartItemModel.php
This commit is contained in:
@@ -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));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user