Skip to content

Commit

Permalink
Merge pull request #32 from lukepolo/lukepolo-patch-1
Browse files Browse the repository at this point in the history
Lukepolo patch 1
  • Loading branch information
lukepolo committed Dec 9, 2015
2 parents 52c37de + 30f712a commit ae89076
Showing 1 changed file with 6 additions and 26 deletions.
32 changes: 6 additions & 26 deletions src/LaraCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function formatMoney($number, $locale = null, $internationalFormat = null
return money_format($internationalFormat ? '%i' : '%n', $number);
}

return number_format($number, 2);
return number_format($number, 2, '.', '');
}

/**
Expand Down Expand Up @@ -461,11 +461,7 @@ public function feeTotals($format = true)
}
}

if ($format) {
return $this->formatMoney($feeTotal);
}

return number_format($feeTotal, 2);
return $this->formatMoney($feeTotal, null, null, $format);
}

/**
Expand All @@ -484,11 +480,7 @@ public function totalDiscount($format = true)

}

if ($format) {
return $this->formatMoney($total);
}

return $total;
return $this->formatMoney($total, null, null, $format);
}


Expand All @@ -503,11 +495,8 @@ public function taxTotal($format = true)
{
$totalTax = $this->total(false, false) - $this->subTotal(false, false, false) - $this->feeTotals(false);

if ($format) {
return $this->formatMoney($totalTax);
}

return number_format($totalTax, 2);
return $this->formatMoney($totalTax, null, null, $format);
}

/**
Expand All @@ -528,12 +517,7 @@ public function subTotal($tax = false, $format = true, $withDiscount = true)
}
}

if ($format) {
return $this->formatMoney($total);
}


return number_format($total, 2);
return $this->formatMoney($total, null, null, $format);
}

/**
Expand All @@ -552,10 +536,6 @@ public function total($format = true, $withDiscount = true)
$total -= $this->totalDiscount(false);
}

if ($format) {
return $this->formatMoney($total);
}

return number_format($total, 2);
return $this->formatMoney($total, null, null, $format);
}
}

0 comments on commit ae89076

Please sign in to comment.