Skip to content

Commit 1afd10f

Browse files
Revert "Fixes tax rounding issue"
This reverts commit a2dce3c.
1 parent 4d93d10 commit 1afd10f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/CartItem.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,23 +255,23 @@ public function __get($attribute)
255255
}
256256

257257
if($attribute === 'priceTax') {
258-
return $this->numberFormat( ($this->price + $this->tax) );
258+
return $this->price + $this->tax;
259259
}
260260

261261
if($attribute === 'subtotal') {
262-
return $this->numberFormat( ($this->qty * $this->price) );
262+
return $this->qty * $this->price;
263263
}
264264

265265
if($attribute === 'total') {
266-
return $this->numberFormat( ($this->qty * $this->priceTax) );
266+
return $this->qty * ($this->priceTax);
267267
}
268268

269269
if($attribute === 'tax') {
270-
return $this->numberFormat( ($this->price * ($this->taxRate / 100)) );
270+
return $this->price * ($this->taxRate / 100);
271271
}
272272

273273
if($attribute === 'taxTotal') {
274-
return $this->numberFormat( ($this->tax * $this->qty) );
274+
return $this->tax * $this->qty;
275275
}
276276

277277
if($attribute === 'model' && isset($this->associatedModel)) {
@@ -373,7 +373,7 @@ public function toJson($options = 0)
373373
* @param string $thousandSeperator
374374
* @return string
375375
*/
376-
private function numberFormat($value, $decimals = null, $decimalPoint = null, $thousandSeperator = null)
376+
private function numberFormat($value, $decimals, $decimalPoint, $thousandSeperator)
377377
{
378378
if (is_null($decimals)){
379379
$decimals = is_null(config('cart.format.decimals')) ? 2 : config('cart.format.decimals');

0 commit comments

Comments
 (0)