- Posts: 217
- Thank you received: 4
Display original currency in checkout cart total
- FilipHradil
-
Topic Author
- Offline
Hello,
I am trying to make own currency switcher module that will work with cache.
What I need is to display both prices everywhere, listing, product view, checkout and then I will show or hide one of them.
Only place where I still can't get both prices is cart total, as pictured bellow:
I need to have price in EURO (it is original currency) in total too.
I know where I should put the code, but I do not know the code, I tried this without success, it is always zero:
Thanl you in advance,
F.
Please Log in or Create an account to join the conversation.
The variable
You want to use
Please Log in or Create an account to join the conversation.
- FilipHradil
-
Topic Author
- Offline
- Posts: 217
- Thank you received: 4
unfortunately, this is not working for me.
It is always zero.
Products are in EUR currency and my default Hikashop currency is CZK.
Do you have any other tips? Or is this variable working for you?
Thank you,
Filip
Please Log in or Create an account to join the conversation.
It is working when I add it to the "cart" file of the "checkout" view with the legacy checkout.
Now I don't know in which view you're doing your changes since you didn't say.
I assumed it was the cart view file of the legacy checkout since you were trying to use $this->full_total which is only there.
If you're using the new checkout and editing the view file show_block_cart, then it's not $this->full_total but $cart->full_total that you want to use.
Please Log in or Create an account to join the conversation.
- FilipHradil
-
Topic Author
- Offline
- Posts: 217
- Thank you received: 4
not sure what legacy checkout means but yes, I am editing cart.php of view checkout.
The changes appear but variable is blank or zero if I use currency helper.
This is my code:
Do you have any other ideas what could be wrong?
I am again telling that my products are in currency CZK, main currency of hikashop is EUR and I need to get price in CZK in this variable. Both currencies are visible and active.
I tested also on testing site and the result is same.
F.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- FilipHradil
-
Topic Author
- Offline
- Posts: 217
- Thank you received: 4
Please Log in or Create an account to join the conversation.
Add that code:
var_dump($this->full_total->prices[0]);
and you'll see all the attributes that you can use instead of price_orig_value_with_tax which apparently doesn't exist there.
Please Log in or Create an account to join the conversation.
- FilipHradil
-
Topic Author
- Offline
- Posts: 217
- Thank you received: 4
Please Log in or Create an account to join the conversation.
Please read carefully the Nicolas message :
He is telling you that there is no "orig" price since there is no conversion of the price.and you'll see all the attributes that you can use instead of price_orig_value_with_tax which apparently doesn't exist there.
But he is telling you that you will have all the elements which will help you to continu your customization since you will have the available data.
Afterwards you might want to perform a conversion to another currency using the currency helper that you're using to format the price.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- FilipHradil
-
Topic Author
- Offline
- Posts: 217
- Thank you received: 4
as I said, my products are in CZK currency. I set main currency in Hika configuration to EUR as to as there will appear two currencies in product listing and product view.
Is there any work around or configuration that will make two prices visible? Can you advise something, please?
Filip
Please Log in or Create an account to join the conversation.
Since the orig prices are not available there. You need to convert them.
For example:
Please Log in or Create an account to join the conversation.
- FilipHradil
-
Topic Author
- Offline
- Posts: 217
- Thank you received: 4
perfect! It worked! Thank you very much.
I have a very last question, is there any way how to access this class and conversion method from banktransfer_end.php (file of plugin banktransfer) and order_creation_notification_preload.modified.php?
Thank you very muhc for all your help,
Filip
Please Log in or Create an account to join the conversation.
You can use the same code there, except for the variables.
in banktransfer_end, the total amount should be in $this->order->order_full_price instead of $this->full_total->prices[0]->price_value_with_tax and the currency id should be in $this->order->order_currency_id instead of $this->full_total->prices[0]->price_curreny_id
In the preload, it's the same but with $data->cart instead of $this->order
Please Log in or Create an account to join the conversation.
- FilipHradil
-
Topic Author
- Offline
- Posts: 217
- Thank you received: 4
Thank you very much! I finally made my javascript no-cache currency switcher modification
Thank you very much for your great and kind support!
Filip
Please Log in or Create an account to join the conversation.