<?php
/**
 * @package	HikaShop for Joomla!
 * @version	6.0.0
 * @author	hikashop.com
 * @copyright	(C) 2010-2025 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
if(!$this->module || hikaInput::get()->getVar('hikashop_front_end_main',0)) {
	$app    = JFactory::getApplication();
	$active = $app->getMenu()->getActive();
	if (!$active) {
		$active = $app->getMenu()->getDefault();
	}
	$priceDisplayParams = $active->getParams();
} else {
	$priceDisplayParams = $this->params;
}
$config =& hikashop_config();
$class = (!empty($this->row->prices) && count($this->row->prices) > 1) ? ' hikashop_product_several_prices' : '';
if(!empty($this->row->has_options))
	$class .= ' hikashop_product_has_options';
// Ръчен курс EUR към BGN
$eur_to_bgn_rate = 0.511;
?>
<span class="hikashop_product_price_full<?php echo $class; ?>">
<?php
if(empty($this->row->prices)) {
	echo JText::_('FREE_PRICE');
} else {
	foreach ($this->row->prices as $price) {
		if(!empty($this->unit) && isset($price->unit_price)) {
			$price =& $price->unit_price;
		}
		if(empty($price->price_currency_id))
			continue;
		echo '<span class="hikashop_product_price">';
		if($this->params->get('price_with_tax')) {
			$priceInBgn = $price->price_value_with_tax;
			echo $this->currencyHelper->format($priceInBgn, $price->price_currency_id);
		} else {
			$priceInBgn = $price->price_value;
			echo $this->currencyHelper->format($priceInBgn, $price->price_currency_id);
		}
		$priceInEur = $priceInBgn * $eur_to_bgn_rate;
		echo '<br><span style="display:block; margin-top:4px; font-size:100%; color:#007bff;">(' . number_format($priceInEur, 2, ',', ' ') . ' €)</span>';
		echo '</span>';
	}
}
?>
</span>