Quantcast
Channel: Phoca Forum
Viewing all articles
Browse latest Browse all 2012

Phoca Cart • Re: Order of Total and Subtotal

$
0
0
Thanks Jan. I am asking this because I get informed that in Sweden practice is when an invoice is issued to a person, the total amount should be listed first. If it is a company, then the subtotal is listed first.
I am trying but with no luck.

Is that row with price 0 necessary and is it necessary to create $newTotal array?

This is //TOTAL// part of order.php in Phoca Cart 5.0.0. Beta61

Code:

// TOTAL// -----------$t = array();$toPay = '';$tColspanLeft = 5;$tColspanMid = 2;$tColspanRight = 2;if ($tax_calculation > 0) {$tColspanLeft = 7;$tColspanMid = 3;$tColspanRight = 2;}if (!empty($d['total'])) {foreach($d['total'] as $k => $v) {// display or not display shipping and payment methods with zero amount//if($v->amount == 0 && $v->amount_currency == 0 && $v->type != 'brutto' && $v->type != 'sbrutto' && $v->type != 'pbrutto') {if($v->amount == 0 && $v->amount_currency == 0 && $v->type != 'brutto') {// Don't display coupon if null} else if ($v->type == 'netto') {$t[] = '<tr '.$totalF.'>';$t[] = '<td colspan="'.$tColspanLeft.'"></td>';$t[] = '<td colspan="'.$tColspanMid.'"><b>'. PhocacartLanguage::renderTitle($v->title, $v->title_lang, array(0 => array($v->title_lang_suffix, ' '), 1 => array($v->title_lang_suffix2, ' '))).'</b></td>';$t[] = '<td style="text-align:right" colspan="'.$tColspanRight.'"><b>'.$d['price']->getPriceFormat($v->amount).'</b></td>';$t[] = '</tr>';if ($pR) { $oPr[] = $pP->printLineColumns(array(PhocacartLanguage::renderTitle($v->title, $v->title_lang, array(0 => array($v->title_lang_suffix, ' '), 1 => array($v->title_lang_suffix2, ' '))), $d['price']->getPriceFormat($v->amount))); }} else if ($v->type == 'brutto') {// Brutto or Brutto currency$amount = (isset($v->amount_currency) && $v->amount_currency > 0) ? $d['price']->getPriceFormat($v->amount_currency, 0, 1) : $d['price']->getPriceFormat($v->amount);$t[] = '<tr '.$totalF.'>';$t[] = '<td colspan="'.$tColspanLeft.'"></td>';$t[] = '<td colspan="'.$tColspanMid.'"><b>'.PhocacartLanguage::renderTitle($v->title, $v->title_lang, array(0 => array($v->title_lang_suffix, ' '), 1 => array($v->title_lang_suffix2, ' '))).'</b></td>';$t[] = '<td style="text-align:right" colspan="'.$tColspanRight.'"><b>'.$amount.'</b></td>';$t[] = '</tr>';if ($pR) {$oPr[] = $pP->printSeparator();$oPr[] = $pP->printLineColumns(array(PhocacartLanguage::renderTitle($v->title, $v->title_lang, array(0 => array($v->title_lang_suffix, ' '), 1 => array($v->title_lang_suffix2, ' '))), $amount), 0, 'pDoubleSize');$oPr[] = $pP->printFeed(2);}if ($d['type'] == 2) {$toPay = $amount;}} else if ($v->type == 'rounding') {// Rounding or rounding currency$amount = (isset($v->amount_currency) && $v->amount_currency > 0) ? $d['price']->getPriceFormat($v->amount_currency, 0, 1) : $d['price']->getPriceFormat($v->amount);$t[] = '<tr '.$totalF.'>';$t[] = '<td colspan="'.$tColspanLeft.'"></td>';$t[] = '<td colspan="'.$tColspanMid.'">'.PhocacartLanguage::renderTitle($v->title, $v->title_lang, array(0 => array($v->title_lang_suffix, ' '), 1 => array($v->title_lang_suffix2, ' '))).'</td>';$t[] = '<td style="text-align:right" colspan="'.$tColspanRight.'">'.$amount.'</td>';$t[] = '</tr>';if ($pR) { $oPr[] = $pP->printLineColumns(array(PhocacartLanguage::renderTitle($v->title, $v->title_lang, array(0 => array($v->title_lang_suffix, ' '), 1 => array($v->title_lang_suffix2, ' '))), $amount)); }} else {$t[] = '<tr '.$totalF.'>';$t[] = '<td colspan="'.$tColspanLeft.'"></td>';$t[] = '<td colspan="'.$tColspanMid.'">'.PhocacartLanguage::renderTitle($v->title, $v->title_lang, array(0 => array($v->title_lang_suffix, ' - '), 1 => array($v->title_lang_suffix2, ' '))).'</td>';$t[] = '<td style="text-align:right" colspan="'.$tColspanRight.'">'.$d['price']->getPriceFormat($v->amount).'</td>';$t[] = '</tr>';if ($pR) { $oPr[] = $pP->printLineColumns(array(PhocacartLanguage::renderTitle($v->title, $v->title_lang, array(0 => array($v->title_lang_suffix, ' - '), 1 => array($v->title_lang_suffix2, ' '))), $d['price']->getPriceFormat($v->amount))); }}}}if ($d['type'] != 3) {$o[] = implode("\n", $t);}if ($tax_calculation > 0 || $d['type'] == 3) {$o[] = '<tr><td colspan="12">&nbsp;</td></tr>';} else {$o[] = '<tr><td colspan="9">&nbsp;</td></tr>';}// -----------

Statistics: Posted by Nidzo — 18 Jun 2024, 23:50



Viewing all articles
Browse latest Browse all 2012

Trending Articles