mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-22 15:15:27 +00:00
Added: taxTotal format method
This commit is contained in:
@@ -168,7 +168,7 @@ class CartItem implements Arrayable
|
||||
*/
|
||||
public function taxTotal($decimals = 2, $decimalPoint = '.', $thousandSeperator = ',')
|
||||
{
|
||||
return number_format(($this->tax * $this->qty), $decimals, $decimalPoint, $thousandSeperator);
|
||||
return number_format($this->taxTotal, $decimals, $decimalPoint, $thousandSeperator);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,6 +265,10 @@ class CartItem implements Arrayable
|
||||
if($attribute === 'tax') {
|
||||
return $this->price * ($this->taxRate / 100);
|
||||
}
|
||||
|
||||
if($attribute === 'taxTotal') {
|
||||
return $this->tax * $this->qty;
|
||||
}
|
||||
|
||||
if($attribute === 'model') {
|
||||
return with(new $this->associatedModel)->find($this->id);
|
||||
|
||||
Reference in New Issue
Block a user