<?php
$sub_total = 0;

if(isset($tpl['price_arr']))
{
	$sub_total += $tpl['price_arr']['sub_total'];
}
if(isset($tpl['return_price_arr']))
{
	$sub_total += $tpl['return_price_arr']['sub_total'];
}

$discount = 0;
if ($controller->_get('voucher_type') && $controller->_get('voucher_discount')) {
	$discount_arr = array(
		'voucher_type' => $controller->_get('voucher_type'),
		'voucher_discount' => $controller->_get('voucher_discount')
	);
	if ($discount_arr) {
		if ($discount_arr["voucher_type"] == 'amount') {
			if ($has_return) {
				$discount = $discount_arr["voucher_discount"] / 2;
			} else {
				$discount = $discount_arr["voucher_discount"];
			}
		} else {
			$discount = ($sub_total * $discount_arr["voucher_discount"]) / 100;
		}
	}
}

?>
<span class="bsTitle"><?php __('front_roundtrip_price');?>: <?php echo pjUtil::formatCurrencySign(number_format($sub_total - $discount, 2, ".", "."), $tpl['option_arr']['o_currency']);?></span>
