Jump to content

[SOLVED] IF Function based on currency


Recommended Posts

On my website, when the customer visits us they are asked which currency they would like, £, $ etc. This is then remembered for the next time they visit. We want it so that if a customer selects a different currency to £, lets say $ then the logo changes to a different logo on the shop front.

 

Does anyone know how to do this????

 

Thanks in advance

Link to comment
Share on other sites

hello

it is possible

but in this case it will be necessary to modify .tpl file of your theme

the tpl file is: header.tpl

 

you have to upload different logos somewhere

then, in header.tpl file you can use someting like:

{if $cookie->id_currency=='3'}
<img class="logo img-responsive" src="{$logo_url}" alt="{$shop_name|escape:'html':'UTF-8'}"{if $logo_image_width} width="{$logo_image_width}"{/if}{if $logo_image_height} height="{$logo_image_height}"{/if}/>
</a>
{else if $cookie->id_currency=='2'}
<a href="{$base_dir}" title="{$shop_name|escape:'html':'UTF-8'}">
<img class="logo img-responsive" src="{$logo_url}" alt="{$shop_name|escape:'html':'UTF-8'}"{if $logo_image_width} width="{$logo_image_width}"{/if}{if $logo_image_height} height="{$logo_image_height}"{/if}/>
</a>
{else}
<a href="{$base_dir}" title="{$shop_name|escape:'html':'UTF-8'}">
<img class="logo img-responsive" src="{$logo_url}" alt="{$shop_name|escape:'html':'UTF-8'}"{if $logo_image_width} width="{$logo_image_width}"{/if}{if $logo_image_height} height="{$logo_image_height}"{/if}/>
</a>
{/if}

where 3, 2 in if condition is a currency id number.

remember to change also url to images for different currencies.

Link to comment
Share on other sites

Okay, so lets say the user selects £ as their currency. We would then want an IF function in the html text that displayed CV on the front end. If the user then selects $ as their currently, the word would change to Resume. 

 

Hope that makes sense, let me know if not.

 

Thanks

Link to comment
Share on other sites

Sorry, I probably aren't explaining it very well.

 

This the code below I want to alter.

 

<div class="home-content-bottom">
                <div class="home-content-bottom-menu bottom-menu1 col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <div class="home-content-bottom-menu-img img-saving hidden-xs col-sm-5 col-md-5 col-lg-5"></div>
                    <div class="home-content-bottom-menu-text text-saving col-xs-12 col-sm-6 col-md-6 col-lg-6">
                        <h2>Saving You Time</h2>
                        <p>We appreciate your time is precious, thats why we
                        do all the work for you. Simply upload your existing
                        CV and we'll do everything else. Saving you hours.</p>
                        
                        <a href="#">Learn more about #CV's features</a> <br />
                        <a class="greylink" href="#">Or view our themes now</a>
                    </div>
                </div>
 
Where it says CV (highlighted in red), I want this word to change to Resume if the user selects the $ currency on the website. If they don't select $ and leave it as say £ then is will say CV.
Link to comment
Share on other sites

×
×
  • Create New...