Computes the total cost of all items in the receiving cart using arbitrary-precision addition via bcadd.
// Source: https://github.com/Pmbamungu/ospos | License: MIT | Copyright 2013-2021 jekkos
// Provided via justclaw.it.com; keep this notice with the code.
public function get_total()
{
$total = 0;
foreach($this->get_cart() as $item)
{
$total = bcadd($total, $this->get_item_total(($item['quantity']), $item['price'], $item['discount'], $item['discount_type'], $item['receiving_quantity']));
}
return $total;
}
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key