Both currency lev&euro

  • Posts: 9
  • Thank you received: 2
  • Hikashop Business
3 weeks 1 day ago #367786

-- url of the page with the problem -- : localhost
-- HikaShop version -- : 6.0
-- Joomla version -- : 5.3.1
-- PHP version -- : 8.3
-- Browser(s) name and version -- : Chrome latest

How to show prices by default to be in bulgarian levs and like a second currency to be in EURO. I make it euro to be default and in bracket shows price in levs. But the orders came in euro. I would like to be in bulgarian levs. How to make it?

Last edit: 3 weeks 1 day ago by Taurus76.

Please Log in or Create an account to join the conversation.

  • Posts: 84146
  • Thank you received: 13651
  • MODERATOR
3 weeks 1 day ago #367790

Hi,

In that case, you need to enter the prices in EUR in your backend and then make the LEV currency the main one in the HikaShop configuration.
That way, it will display both prices with the EUR in parenthesis and the orders will came in LEV.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 2
  • Hikashop Business
3 weeks 21 hours ago #367793

How can I automatically make all prices in euros without having to go in and change each one individually?

Please Log in or Create an account to join the conversation.

  • Posts: 84146
  • Thank you received: 13651
  • MODERATOR
3 weeks 17 hours ago #367794

Hi,

You'll have to use a mass action in the menu System>Mass actions:
www.hikashop.com/support/documentation/167-massaction-form.html
There, you can add two actions:
- one "update the values" action on price_currency_id with the mode "int" and the value being the id of the LEV currency from the System>Currencies menu it should normally be 30 )
- one "update the values" action on price_value with the mode "operation" and the value being:
price.price_value*0.51
when you click on the "process" button, it will run the actions on the products and convert the prices with an exchange rate of 0.51.

Note that by default, it only process the first 500 products / variants due to the "limitations" area of the mass action. If you have more than that, you can increase the value or process the mass action several times incrementing the start by the limitation amount each time.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 2
  • Hikashop Business
3 weeks 6 hours ago #367802

Is there a simple way to add the price in euros via custom php code in the category and product views?

Please Log in or Create an account to join the conversation.

  • Posts: 84146
  • Thank you received: 13651
  • MODERATOR
2 weeks 6 days ago #367803

Well, you can always create view overrides and add a bit of code to calculate the converted price yourself and display it.
Here is a tutorial on view overrides:
www.hikashop.com/support/documentation/1...-display.html#layout

However, if the prices of your products are in LEV, and you configured the main currency of your shop to EUR as I recommended previously, then you should see the prices both in LEV and in EUR on your frontend. And so, you should not need to customize any view as far as I understand.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 2
  • Hikashop Business
2 weeks 5 days ago #367813

That`s right, the problem is only the orders which cames in euro, but should be in lev. How to fix only order to came in lev, not in euro?

The following user(s) said Thank You: elektrapomp

Please Log in or Create an account to join the conversation.

  • Posts: 84146
  • Thank you received: 13651
  • MODERATOR
2 weeks 5 days ago #367814

Hi,

What do you mean ?
If a previous order was made in lev and you received the payment for it in lev you, I don't think you should change it since it reflects the reality of the situation.
If you still want, you'll have to manually change the values in the hikashop_order and hikashop_order_product tables via PHPMyAdmin.
While changing the currency and the total amount would be relatively easy for all affected orders, changing each product price, the taxes amount, etc is complex. Especially the taxes as the information is encoded in the order_tax_info column.
I would recommend leaving the past orders in lev as they are.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 2
  • Hikashop Business
2 weeks 5 days ago #367822

All I want is the order came in bulgarian lev, and hikashop preview the price in both currency at the same time.

Please Log in or Create an account to join the conversation.

  • Posts: 84146
  • Thank you received: 13651
  • MODERATOR
2 weeks 5 days ago #367823

Change the "main currency" setting of the hikashop configuration page to EUR and in the System>Currencies menu, unpublish the lev currency while keeping its display toggle turned on.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 2
  • Hikashop Business
2 weeks 4 days ago #367828

In that case, there no any prices at frontend of the shop, I just would like the order came in lev! I change listng_price view with this code and now work perfect.

Last edit: 2 weeks 4 days ago by Taurus76.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 2
  • Hikashop Business
2 weeks 4 days ago #367830

<?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>

Last edit: 2 weeks 4 days ago by nicolas.
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.080 seconds
Powered by Kunena Forum