Jump to content

Moving Currency Choice as dropdown in header


jkmorganpets

Recommended Posts

I would like to have a currency dropdown in the lower right hand side of my logo header. Also, is it possible to add the currency selected to the amount. Say if the site is in USD then the price would show 49.50USD so the customer would always know which currency they were operating in. I am in Canada, but 90% of my customer base is in the US. 

See image for clarification

homepage.jpg

Link to comment
Share on other sites

In the Kurouto skin:

box.currency.php

Find:
<div id="currency_select">
  <p>{$LANG.common.change_currency}:
  {foreach from=$CURRENCIES item=currency}
  <a href="{$currency.url}" class="{$currency.css}" title="{$currency.name}">{$currency.code}</a>
  {/foreach}
  </p>
</div>

Change to:
{*
<div id="currency_select">
  <p>{$LANG.common.change_currency}:
  {foreach from=$CURRENCIES item=currency}
  <a href="{$currency.url}" class="{$currency.css}" title="{$currency.name}">{$currency.code}</a>
  {/foreach}
  </p>
</div>
*}
<div id="quick_search">
<form id="currency_select" action="{$VAL_SELF}" method="post">
  <p>{$LANG.common.change_currency}:
  <select name="set_currency" class="auto_submit">
  {foreach from=$CURRENCIES item=currency}
  <option value="{$currency.code}" {$currency.selected} title="{$currency.name}">{$currency.symbol_left} {$currency.code} {$currency.symbol_right}</option>
  {/foreach}
  </select> <input type="submit" value="{$LANG.common.submit}" />
  </p>
</form>
</div>
main.php:

Find:
<div id="account">
  {$SESSION} {$CURRENCY} {$LANGUAGE}
</div>
<div id="header">
  {$SEARCH_FORM}
  <p class="logo"><a href="{$STORE_URL}"><img src="{$STORE_LOGO}" alt="{$META_TITLE}" /></a></p>
</div>

Change to:
<div id="account">
  {$SESSION} {* $CURRENCY *} {$LANGUAGE}
</div>
<div id="header">
  {* $SEARCH_FORM *}{$CURRENCY}
  <p class="logo"><a href="{$STORE_URL}"><img src="{$STORE_LOGO}" alt="{$META_TITLE}" /></a></p>
</div>

We may need to make some CSS adjustments for positioning and styling.

Link to comment
Share on other sites

 

main.php:

Find:
<div id="account">
  {$SESSION} {$CURRENCY} {$LANGUAGE}
</div>
<div id="header">
  {$SEARCH_FORM}
  <p class="logo"><a href="{$STORE_URL}"><img src="{$STORE_LOGO}" alt="{$META_TITLE}" /></a></p>
</div>

Change to:
<div id="account">
  {$SESSION} {* $CURRENCY *} {$LANGUAGE}
</div>
<div id="header">
  {* $SEARCH_FORM *}{$CURRENCY}
  <p class="logo"><a href="{$STORE_URL}"><img src="{$STORE_LOGO}" alt="{$META_TITLE}" /></a></p>
</div>

 

I no longer have the code in main.php you want me to find as we moved the search box. 

My code reads:

<div id="account">
      {$SESSION} {$CURRENCY} {$LANGUAGE}
    </div>
    <div id="header">
      
      <p class="logo"><a href="{$STORE_URL}"><img src="{$STORE_LOGO}" alt="{$META_TITLE}" /></a></p>
    </div>

 

I did replace the code anyway and what it has done is move the clickable currency selection to a drop down box just below where the clickable line was.  And when you change pages the word "submit" flashes then disappears. Also, the choices show twice. If I could move it over to the far right, that would be great. Check it here:   http://www.jkmorganpets.com/cc/index.php?_a=category&cat_id=70

 

Link to comment
Share on other sites

main.php:

Find:
<div id="account">
  {$SESSION} {$CURRENCY} {$LANGUAGE}

Change to:
<div id="account">
  {$SESSION} {* $CURRENCY *} {$LANGUAGE}
Find:
<div id="header">

  <p class="logo"><a href="{$STORE_URL}"><img src="{$STORE_LOGO}" alt="{$META_TITLE}" /></a></p>
</div>

Change to:
<div id="header">
  {$CURRENCY}
  <p class="logo"><a href="{$STORE_URL}"><img src="{$STORE_LOGO}" alt="{$META_TITLE}" /></a></p>
</div>

That should fix most of what you are experiencing. We need suppress the original display of {$CURRENCY}. Changing it to {* $CURRENCY *} will do that. And we will be putting the new {$CURRENCY} where the Search field was.

Link to comment
Share on other sites

I am just not thinking things through. Ughh!!

Of course, you had to change up the CSS to make the Search box work at its new location.

I had made the assumption that the quick_search CSS was still intact.

So:

box.currency.php

Change from:

<div id="quick_search">

To:

<div id="currency_select">

Then:

common.css

Find:

#currency_select {
	float: left;
	margin-left: 25px;
}

Change to:

#currency_select {
/*	float: left; */
/*	margin-left: 25px; */
	color: #FFF;
	float: right;
	position: relative;
	right: 0px;
	top: 90px;
	width: 320px;
}

For each edit in common.css, you must force your browser to reload that CSS file (force reload). Adjust the width as needed. The actual width of the drop-down will not be as great as 320px, so reducing the real estate width given to it will have it scoot more the right.

Link to comment
Share on other sites

I have no suggestion for the flashy submit button - it doesn't do that for me.

Set the width to 220px.

If you think it wise to delete the "Change Currency" caption, remove it and the <p> and </p> tags. Then you can set the width to 100px.

You can try this:

In box.currency.php, find:

</select> <input type="submit" value="{$LANG.common.submit}" />

Change to:

</select> <input style="display:none;" type="submit" value="{$LANG.common.submit}" />

This has the browser apply the style immediately instead of waiting for the javascript to do it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...