websitebuilder Posted July 1, 2014 Share Posted July 1, 2014 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 More sharing options...
vekia Posted July 1, 2014 Share Posted July 1, 2014 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 More sharing options...
websitebuilder Posted July 3, 2014 Author Share Posted July 3, 2014 This is great thanks. And a final question, if I then wanted to changed some of the html text. Lets say to say CV if selected £ and Resume if selected $, what would that look like? Thanks again Link to comment Share on other sites More sharing options...
vekia Posted July 3, 2014 Share Posted July 3, 2014 sorry but i don't understand especially this part Lets say to say CV if selected £ and Resume if selected $, what would that look like? Link to comment Share on other sites More sharing options...
websitebuilder Posted July 4, 2014 Author Share Posted July 4, 2014 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 More sharing options...
vekia Posted July 4, 2014 Share Posted July 4, 2014 what is CV ? Link to comment Share on other sites More sharing options...
websitebuilder Posted July 4, 2014 Author Share Posted July 4, 2014 Cv is the English word for resume. Link to comment Share on other sites More sharing options...
vekia Posted July 4, 2014 Share Posted July 4, 2014 omg sorry for my misunderstanding im still confused a little but... {if $cookie->id_currency=='3'} {l s='CV'} {else} {l s='RESUME'} {/if} Link to comment Share on other sites More sharing options...
websitebuilder Posted July 5, 2014 Author Share Posted July 5, 2014 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 More sharing options...
NemoPS Posted July 5, 2014 Share Posted July 5, 2014 in this case you can use {if $currency.iso_code == 'USD'}Resume{else}CV{/if} Link to comment Share on other sites More sharing options...
websitebuilder Posted July 5, 2014 Author Share Posted July 5, 2014 Just tried this and I get a Fatal error: Fatal error: Cannot use object of type Currency as array in Link to comment Share on other sites More sharing options...
NemoPS Posted July 5, 2014 Share Posted July 5, 2014 sorry it's $currency->iso_code Link to comment Share on other sites More sharing options...
websitebuilder Posted July 5, 2014 Author Share Posted July 5, 2014 Works great. Thanks guys. Link to comment Share on other sites More sharing options...
vekia Posted July 5, 2014 Share Posted July 5, 2014 okay :-) glad to hear that it's solved sorry for my confusion above i marked topic title as solved, with regards, Milos Link to comment Share on other sites More sharing options...
Recommended Posts