Skip to content

Commit

Permalink
Update CartItem.php
Browse files Browse the repository at this point in the history
  • Loading branch information
hardevine authored Jan 31, 2019
1 parent 9f2222f commit daeec55
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/CartItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,24 +274,24 @@ public function __get($attribute)
return $this->{$attribute};
}

if($attribute === 'priceTax') {
return $this->numberFormat( ($this->price + $this->tax) );
if ($attribute === 'priceTax') {
return number_format(($this->price + $this->tax), 2, '.', '');
}
if($attribute === 'subtotal') {
return $this->numberFormat( ($this->qty * $this->price) );

if ($attribute === 'subtotal') {
return number_format(($this->qty * $this->price), 2, '.', '');
}
if($attribute === 'total') {
return $this->numberFormat( ($this->qty * $this->priceTax) );

if ($attribute === 'total') {
return number_format(($this->qty * $this->priceTax), 2, '.', '');
}

if($attribute === 'tax') {
return $this->numberFormat( ($this->price * ($this->taxRate / 100)) );
if ($attribute === 'tax') {
return number_format(($this->price * ($this->taxRate / 100)), 2, '.', '');
}
if($attribute === 'taxTotal') {
return $this->numberFormat( ($this->tax * $this->qty) );

if ($attribute === 'taxTotal') {
return number_format(($this->tax * $this->qty), 2, '.', '');
}

if($attribute === 'model' && isset($this->associatedModel)) {
Expand Down

0 comments on commit daeec55

Please sign in to comment.