Displaying 2 currencies

  • Posts: 2143
  • Thank you received: 747
11 years 4 months ago #153352

-- url of the page with the problem -- : local dev server
-- HikaShop version -- : Business 2.3.0
-- Joomla version -- : 3.2.3
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message

Hi again,

Other than the other post on image sizes, I must say that I'm pretty impressed by HikaShop! Got my head around it, I guess, spend a lot of time with pretty extensive mods of views (also to display things better in Yootheme templates), and am quite happy with the outcome! One day, when it's 'live', I'll show, but meanwhile big compliment for your work of putting it together!

Still, there'll be some questions from here, though I've been through a lot of code and the forum here (where the latter often helped!).
Here's one:

I am publishing and displaying one currency (USD), but only displaying several - to give clients the option to view pricing in their local currency, though all purchasing will be only in USD = the main currency.

When selecting a 'secondary' currency, they are displayed as 2nd currency (main currency), as a single string.
Two things I'd like to change:

  1. Swap them around, meaning displaying them as main currency (2nd currency), and
  2. add separate classes to them, so I can e.g. use a smaller font size for the secondary currency, or so.

To me it makes no sense to have the main currency in parentheses while the secondary/unpublished one, which can not be paid in, appears as if it's THE thing. Also, being able to control/format them separately is mandatory, I believe, also as otherwise it gets tight in div's with 3 prices in total (when displaying the price before discount as well)...

Again, couldn't find it in the code, so if you could please give me a hint on where to look?

Thanks!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 11 years 4 months ago by lousyfool.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 4 months ago #153432

Hello,

to give clients the option to view pricing in their local currency

I think that the best solution will probably be to use a currency switcher content module through your front-end, so that you'll be able to select your shop currency regarding the product currency.

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

  • Posts: 2143
  • Thank you received: 747
11 years 4 months ago #153500

Thanks for replying, Mohamed, but this is a known, I am using the currency switcher, otherwise I wouldn't get to see what I was describing next.

So, in a div - and same on the product page - this is what I get to see with only the main currency selected:



When selecting a second currency (yes, of course with the currency switcher), this is being displayed:


According to Firebug, this is one string in a span. I don't want that, though. The least I'd want is to have the main currency in front and the secondary following, as well as the parentheses around the secondary - not the main.
And while I'm on it, I'd like to apply a separate class to the secondary currency, so that I can alter its display via CSS.

So, which file has the code?

No matter what, yet it's the same classes on the price(s), no difference when another currency is selected.
Think I've been through all relevant views and any other *price.php and *currency.php file, but can't find this code... help, please.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Attachments:
Last edit: 11 years 4 months ago by lousyfool.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #153516

Hi,

So you have to edit the view "product / listing_price" in order to edit the html tags to have what you need.
www.hikashop.com/support/support/documen...ize-the-display.html

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

  • Posts: 2143
  • Thank you received: 747
11 years 4 months ago #153625

Dear Xavier,

I don't mean to be a smart*ss, but I think once you look closely again, you'll agree with me that it's not the listing_price.php.

Look at the content of the blue part, please:



Promised, if I use only the published currency US$, it's the very same, except for the "AUD 13,362" and the parenthesis around the US$ amount not showing, naturally.

Then look into the listing_price.php. The lines with that span are #70-#122. There's a lot with discount and tax, and a little bit with "currencyHelper" and, of course, "price_currency_id", but nothing that I can see fit.
In that section, there's not even the expressions ' (' and ')' as would be surrounding the main currency price. (That I find in line #33, but it doesn't help me at all.)

If I do a search for "currencyHelper" across my site, 95 files are coming up. Ok, many have names which are taking them clearly out of responsibility. Anyway, and please trust me again, but I've been through some of these files already, too. Oh, and through all 4 "currency.php" files as well. No luck.

You can tell already from the bits surrounding the blue box in the screenshot that I'm somewhat "familiar" with the general structure of views and editing them... been successfully customizing quite a bit without a glitch. So, thanks for the link, and no offence, but it's like handing the mechanic who needs to get into the transmission the user's manual of the car (and I've been through HikaShop's manuals a lot!)... :lol:

So, can someone please give me a another hint? In return I promise that I'll continue not asking questions that are already answered in the documentation or here in the forum. ;) Thank you once again.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Attachments:
Last edit: 11 years 4 months ago by lousyfool.

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

  • Posts: 84292
  • Thank you received: 13692
  • MODERATOR
11 years 4 months ago #153627

Hi,

Iit's really the file "listing_price" of the view "product" that you want to edit.
You don't see the parenthesis there because they are added as a translation:
PRICE_BEFORE_ORIG=" ("
PRICE_AFTER_ORIG=") "
with the code:

if($this->params->get('show_original_price') && !empty($price->price_orig_value)){
				echo JText::_('PRICE_BEFORE_ORIG');
				if($this->params->get('price_with_tax')){
					echo $this->currencyHelper->format($price->price_orig_value_with_tax,$price->price_orig_currency_id);
				}
				if($this->params->get('price_with_tax')==2){
					echo JText::_('PRICE_BEFORE_TAX');
				}
				if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
					echo $this->currencyHelper->format($price->price_orig_value,$price->price_orig_currency_id);
				}
				if($this->params->get('price_with_tax')==2){
					echo JText::_('PRICE_AFTER_TAX');
				}
				echo JText::_('PRICE_AFTER_ORIG');
			}
The "orig" in the code is for the price before currency conversion (the original price).

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

  • Posts: 2143
  • Thank you received: 747
11 years 4 months ago #153655

Wow! Who could have guessed...

Anyway, Nicolas my saviour! And on a Saturday... double wow... WOW WOW WOW!

Thanks a mega ton, and now wishing you a well deserved great weekend!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

Time to create page: 0.107 seconds
Powered by Kunena Forum