Product price in two currencies

  • Posts: 20
  • Thank you received: 2
11 years 9 months ago #134792

Hi,

I wonder if I can enable (somehow) possibility that a product would show price in two currencies?

I did enable both currencies, I did set the price of the product for both currencies, but that product shows price in only one currency.

I'd appreciate some guidance what to do.

Best regards
Jure

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

  • Posts: 20
  • Thank you received: 2
11 years 9 months ago #134802

Done, all working well, showing main price in US$ and also price in Euro in the brackets.

The following user(s) said Thank You: Jerome

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

  • Posts: 187
  • Thank you received: 3
  • Hikaserial Standard Hikashop Business
11 years 1 month ago #164273

How you've done that?
i need to display two currencies too. My country is changing currency to Euro, ant according to law i need to display both prices now.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #164276

Hi,

You can edit the views "checkout / cart" "product / cart" and "product / checkout" in order to duplicate price PHP lines in order to use the other price currency id to display price in both currencies.

It require PHP knwoledges. Or you can use the currency switcher module to display one or another currency, but it display not them both at one time.

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

  • Posts: 13
  • Thank you received: 0
11 years 3 weeks ago #167647

Hi,
Like just mentioned arnask, my country is changing currency to Euro, ant according to law I need to display both prices.

Currency switcher module don’t suits my needs, because price shows up only then customer switches it on. According to law, two prices (Litas and Euro) seller must show, either way the seller will be punish by authorities. Two currencies must show half year before Euro, and half year after Euro becomes national currency, so two currencies needed just for one year (from 2014-08-22 till 2015-07-01).

I have no php knowledge, but I can easily change files via FTP client, or “ctrl+c, ctrl+v” specified code parts. Please help on this problem, because it can cause my business seriously.

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

  • Posts: 20
  • Thank you received: 2
11 years 3 weeks ago #167650

Hi,

set main currency (that will display in the shop) in the System/Configuration, while the price for the product remains in your (old) currency. Also do not forget to enable both currencies in System/Currencies.

See my page: www.svet-el.si/english/index.php/shop/category/12-books

Let me know if this works out for you and click Thank you if it does

The following user(s) said Thank You: Tamulionyte-Krilavičienė

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

  • Posts: 13
  • Thank you received: 0
11 years 3 weeks ago #167657

Thank you juremm, but your way will be good if I have no other choise, so I will keep it like a backup ;)

The thing that checkout is also important, and then I use your method there is no auto sum at the end. To have the auto sum I need to set Euro as main currency, correct all my items prices manually, then set Litas as main currency and then will be two currencies and auto sum (also appears just in one currency) in the end of checkout. But after half of year, then Euro really become our national currency, I’ll need to do everything vice versa, also manually. This method is painful.

Auto sum may be in two ways: 1. One currency, which is main in Country for the moment (till 2015-01-01 Litas, after 2015-01-01 Euro); 2. Both currencies (this way is the best).

So I still need help on this problem.

Sorry for my bad English :)

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 3 weeks ago #167662

Hi,

In HikaShop you have an option to "display the original price".
So if your main currency is EUR, it will display the price converted in EUR (which means that you don't have price in EUR for the product) and also the original price (so the price in Litas).

You just have to activate or deactivate this option in HikaShop.
That's all you have to do to make your switch.

I recommend you to remove the currency switcher in order to force the user to be in EUR. So the prices will always be displayed in EUR (with the original price in Litas depending the option).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 13
  • Thank you received: 0
11 years 3 weeks ago #167688

Hi,
Jerome, if I understand correctly your suggestion is the same as suggested juremm.

You mentioned "display the original price" option. I’m hanging around and can’t find such option. Maybe you mean “Show price in original currency” (I found it in Default parameters for products), this option switched on, but it can’t solve my problem. If I mismatch something, can you provide path to that option please?

I’ll try to explain again.

For next year (from 2014-08 till 2015-07) I need to display two prices in two currencies “Litas” and “Euro”.
Then I set “Euro” as main currency and leave original currency “Litas”, everything in my site is ok. I can see prices in this format: “10€ (35LTL)”.

But then I try to buy something, auto sum in checkout calculates only in Euros (see pic). Last price (for items, for shipping and for all amount) is only in one currency. But it is not suitable. According to law I must show two prices. Which one is first or last I don’t care, I just need them both.

My original price is in “Litas”, so I can’t set it as main currency, because disappears prices in euros. So I set “Euro” as main currency, and leave enabled original price, and “Litas” enabled in my currency list. If I’m understand correctly, I just need somehow to show two prices in different currencies in the end of checkout. After one year, then “Litas” in my country will be forgotten, and that law will not exist, I just swich off “Litas” in my currency list and that’s it on this case.

Attachments:

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 3 weeks ago #167698

Hi,

Okay, I see your problem.

Well, you will have to override some HikaShop views in order to display the price twice.
Like the view "checkout | cart" in order to display the price a second time in the old currency.

Where you see code like that

echo $this->currencyHelper->format($shipping_price, $this->full_total->prices[0]->price_currency_id);
it means that the price is displayed.
You can add some code
echo ' (' . $this->currencyHelper->format( $this->currencyHelper->convertUniquePrice($shipping_price, $this->full_total->prices[0]->price_currency_id, $latis_currency_id), $latis_currency_id) . ')';
to convert and display the price in the other currency.
You have to set the variable "$latis_currency_id" with the ID of your Latis currency (or hard code it).

There are several call of this function (one for each line in the checkout cart) and several views depending what features you are using.
So you might need to override the "cart | showcart", the "order | show" too.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 13
  • Thank you received: 0
11 years 3 weeks ago #168211

Hi,
Jerome, I guess we on the right way.

But again, I can’t achieve good result. I don’t know`why, because of my mistakes or something else. First of all I can say that I don’t need to do changes anywhere else than “checkout | cart”. So if we succeed with “checkout | cart” I’ll be satisfied. :)

I’m not a coder but I tried to do changes. Everything I get is result on attached picture (something went wrong). Its shows old currency just in “shipping line” with no conversion. There was mistake with old currency name (it is “litas”, not “latis”), but I guess the name have no influence (I changed to correct name).

So additional help needed :)

Attachments:

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

  • Posts: 187
  • Thank you received: 3
  • Hikaserial Standard Hikashop Business
11 years 3 weeks ago #168264

i haven't figured out this problem too, and from now i'm braking the low. That is something i do not want to do, even when using business version of hikashop. So please help and provide step by step things to be done, o just release an update solving that once and for all.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
11 years 3 weeks ago #168365

Hi,

@Tamulionyte-Krilavičienė

You have to continue the override of the view for the other elements ; I gave you the shipping line but you have to duplicate the process for the others lines (subtotal and total).
Like I said in my previous message:

There are several call of this function (one for each line in the checkout cart) and several views depending what features you are using.


Here the subtotal part:
<tr>
	<?php echo $td; ?>
	<td id="hikashop_checkout_cart_total2_title" class="hikashop_cart_subtotal_title hikashop_cart_title">
		<?php echo JText::_('SUBTOTAL'); ?>
	</td>
	<td class="hikashop_cart_subtotal_value">
	<?php
		$this->row = $this->total;
		echo $this->loadTemplate();

		if($this->params->get('price_with_tax'))
			echo ' (' . $this->currencyHelper->format( $this->currencyHelper->convertUniquePrice($this->total->prices[0]->price_value_with_tax, $this->total->prices[0]->price_currency_id, $latis_currency_id), $latis_currency_id) . ')';

		if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax'))
			echo ' (' . $this->currencyHelper->format( $this->currencyHelper->convertUniquePrice($this->total->prices[0]->price_value, $this->total->prices[0]->price_currency_id, $latis_currency_id), $latis_currency_id) . ')';
	?>
	</td>
</tr>
(Code which can be different depending the options you got about the price display (tax, no tax, discount, no discount, etc).

Here the total part:
<td id="hikashop_checkout_cart_final_total_title" class="hikashop_cart_total_title hikashop_cart_title">
	<?php echo JText::_('HIKASHOP_TOTAL'); ?>
</td>
<td class="hikashop_cart_total_value">
	<span class="hikashop_checkout_cart_final_total">
	<?php
		echo $this->currencyHelper->format($this->full_total->prices[0]->price_value_with_tax,$this->full_total->prices[0]->price_currency_id);
		echo ' (' . $this->currencyHelper->format( $this->currencyHelper->convertUniquePrice($this->full_total->prices[0]->price_value_with_tax, $this->full_total->prices[0]->price_currency_id, $latis_currency_id), $latis_currency_id) . ')';
	?>
	</span>
</td>

@arnask
Please follow the previous instructions in this thread.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 11 years 3 weeks ago by Jerome. Reason: code indent

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

  • Posts: 13
  • Thank you received: 0
11 years 3 weeks ago #168382

Hello Jerome,

I’m putting the code as you provided, but it doesn't work for me. After I insert the code, I just get following result:
- subtotal: 10€ (0.00 €);
- shipping: 1€ (0.00 €);
- total: 11€ (0.00 €).

With your code I can see second currency, but it is not Litas, and it is not with calculated rate.
I thing we just have some misunderstanding in our dialogue (because of my English :) , different IT experience and s.o.).

Again – I’m not a programmer (coder). I’m just advanced IT user who can “copy/paste” code, but you must understand that copypasting also can be difficult :) and provide step by step instructions.

When I’m opening “checkout / cart.php” in Joomla! CMS, the code is in plane text, so it is difficult to search and replace. So I’m just: 1. copy/paste this code to Notepade++; 2. adjusting Notepad++ for PHP language to see tags correctly; 3. replacing provided code.

But then I’m confused what I must do with your code. In your first post (there shipping code is) you posted “you can add some code” in the last post “here the (sub)total part”. So what I’m must to do with code? Just add but leave old lines, or replace with old lines?

I mentioned in the beginning of my post, that I tried to put your code, but the wrong result happened. So I can’t understand why, because of bad commands, or bad code replacement.

About php commands. If I understand correctly I need to insert second currency ID to this command "$latis_currency_id". So I inserted ID (91) from my currency list from Joomla! CMS, but it didn’t changed anything. Also my old currency not “latis” it is “LITAS”, but I doubt that the name changes anything because I tried to change it to correct.

Please pay attention to understand the problem.
Again short facts:
- I need to change just “checkout / cart.php“;
- there is no additional options in my site, and I need just basics in two currencies (subtotal, shipping and total);
- I’m attaching php file from my Notepad++, so you can see my mistakes and correct them.
- Also you can try to post clear instruction how to replace/add the code (highly appreciated with php line numbers);

The “Euro law” in my country will be valid from tomorrow, that means from tomorrow I have my business with two currencies Euro and Litas, in toher way my site will be offline for the one year.

Regards.

Attachments:

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

  • Posts: 187
  • Thank you received: 3
  • Hikaserial Standard Hikashop Business
11 years 2 weeks ago #168442

I think this is something that must be done by hikashop (update maybe). If you are selling your products in all EU countries, the smallest think you can do is make this software legal. For now - it is not legal. And i'm sorry, but if i pay 100 euro for this, i must know, that it is legal to use.
We are talking not about some feature that we need additionally. We need this according the low. Thats it. Do it and release an update please. Make hikashop legal!

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

  • Posts: 20
  • Thank you received: 2
11 years 2 weeks ago #168447

Hi,

did you check my web page: www.svet-el.si/english/index.php/shop/category/12-books

Is this suitable solution for you? I did no additional coding, that was just Hikashop setting.

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

  • Posts: 13
  • Thank you received: 0
11 years 2 weeks ago #168453

Jurrem,

No, it is not suitable for arnasK nether for me. Because it is everything is good till you proceed to checkout.

There is ok (for me) in e-shop with two currencies, but checkout proceeds only with one (it is also in your site. You have two currencies euro and dollar, but in checkout just dollar). As arnask and I mentioned few times before – it is not our freaky wish it is national law. Our country Lithuania is EU member more than decade with own currency Litas. From 2015-01-01 our currency will be Euro and according to this our government with this law demands that one year (2014-08_2015-07) all prices in all markets must be shown in two currencies.

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

  • Posts: 20
  • Thank you received: 2
11 years 2 weeks ago #168456

I see... We had same situation 10 years ago... In this case write to Hikashop owner, according to my experience he's replying fast.

Last edit: 11 years 2 weeks ago by juremm.

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

  • Posts: 187
  • Thank you received: 3
  • Hikaserial Standard Hikashop Business
11 years 2 weeks ago #168460

who is he, how to contact him?

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

  • Posts: 20
  • Thank you received: 2
11 years 2 weeks ago #168461

I will send his email privately, send me email to stik (at) svet-el.si

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

Time to create page: 0.110 seconds
Powered by Kunena Forum