X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Language flags (https://forum.x-cart.com/showthread.php?t=36926)

buddy 01-22-2008 01:32 AM

Language flags
 
Hi,
is it possible to insert flags for languages instead of drop menu?

Thank you

pauldodman 01-22-2008 04:27 AM

Re: Language flags
 
Yes, that is basic html code. Replace the language drop down code with the flag graphics and setup a link on each one for exactly the same link that you get when you select your language now.

Asiaplay 01-22-2008 05:40 AM

Re: Language flags
 
Yes buddy - it is possible...

Use code in place of the drop-down box (delete the code that activates the drop down box)... and hard code it into the template instead.

In skin1/head.tpl

Find the following lines (and delete / replace them):-

<td><select name="sl" onchange="javascript: this.form.submit();">
{section name=ai loop=$all_languages}
<option value="{$all_languages[ai].code}"{if $store_language eq $all_languages[ai].code} selected="selected"{/if}>{$all_languages[ai].language}</option>
{/section}
</select></td>

Below is example of code which shows US Flag and German Flag... replace the deleted code above with this.
<td>
<a href="home.php?sl=US" title="{$lng.lbl_text_for_flag_us_alt}"><img src="{$Images}/folder_name_you_put_flags_into/flag_US.gif" border="0" width="24" height="16" alt="{$lng.lbl_text_for_flag_us_alt}" /> <a href="home.php?sl=DE" title="{$lng.lbl_text_for_flag_de_alt}"><img src="{$Images}/folder_name_you_put_flags_into/flag_DE.gif" border="0" width="24" height="16" alt="{$lng.lbl_text_for_flag_de_alt}" />
</td>

Then put a GIF photo file called "flag_US.gif" and one called "flag_DE.gif" into your images folder i.e. "Images/folder_name_you_put_flags_into/" (e.g. Images/flags/)
If you want alt text to appear, then under X-Cart Admin languages, add the language tag "lbl_text_for_flag_us_alt" and put in the text you want to appear (e.g. "USA - click here to change to USA English).

Note that this was a flag for USA English and Germany (German) - to make one for another language, change all the US and DE seen above to ES (Spanish) or FR (France) etc. - you can keep adding to the code to add more flags.

Hope this helps - cheers, Asiaplay

buddy 01-22-2008 06:09 AM

Re: Language flags
 
Simply great!

Thanks a lot, it's perfect!

:D/

Asiaplay 01-22-2008 07:36 AM

Re: Language flags
 
:) - happy worked as you wanted... cheers, Asiaplay

sales@webosusa.com 01-22-2008 07:28 PM

Re: Language flags
 
To bad didnt work as i wish.

Cyril Golub 01-23-2008 05:29 AM

Re: Language flags
 
1 Attachment(s)
Please see attached international icons set - it's completely free. Hope you'll find it suitable :-)

sales@webosusa.com 01-23-2008 05:35 AM

Re: Language flags
 
Thanks!


All times are GMT -8. The time now is 07:08 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.