mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-24 07:55:35 +00:00
Update DefaultCalculator.php
This commit is contained in:
@@ -23,7 +23,7 @@ class DefaultCalculator implements Calculator
|
|||||||
return $cartItem->price->multiply($cartItem->qty, config('cart.rounding', Money::ROUND_UP));
|
return $cartItem->price->multiply($cartItem->qty, config('cart.rounding', Money::ROUND_UP));
|
||||||
case 'subtotal':
|
case 'subtotal':
|
||||||
$subtotal = $cartItem->priceTotal->subtract($cartItem->discountTotal);
|
$subtotal = $cartItem->priceTotal->subtract($cartItem->discountTotal);
|
||||||
return $subtotal->isPositive() ? $subtotal : new Money(0, $this->price->getCurrency());
|
return $subtotal->isPositive() ? $subtotal : new Money(0, $cartItem->price->getCurrency());
|
||||||
case 'priceTarget':
|
case 'priceTarget':
|
||||||
return $cartItem->priceTotal->subtract($cartItem->discountTotal)->divide($cartItem->qty);
|
return $cartItem->priceTotal->subtract($cartItem->discountTotal)->divide($cartItem->qty);
|
||||||
case 'taxTotal':
|
case 'taxTotal':
|
||||||
|
|||||||
Reference in New Issue
Block a user