Skip to content

Commit

Permalink
replace if block with min function
Browse files Browse the repository at this point in the history
  • Loading branch information
maks feltrin committed Nov 21, 2015
1 parent b02c806 commit ba34283
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions upload/catalog/model/total/voucher.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,8 @@ public function getTotal(&$total_data, &$total, &$taxes) {
$voucher_info = $this->getVoucher($this->session->data['voucher']);

if ($voucher_info) {
if ($voucher_info['amount'] > $total) {
$amount = $total;
} else {
$amount = $voucher_info['amount'];
}

$amount = min($voucher_info['amount'], $total);

if ($amount > 0) {
$total_data[] = array(
'code' => 'voucher',
Expand Down

0 comments on commit ba34283

Please sign in to comment.