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)
-   -   disable languages (https://forum.x-cart.com/showthread.php?t=1291)

Satyr 01-26-2003 02:20 PM

disable languages
 
is there an easy way to disable the languages option?
If not, what code do I need to remove out of head.tpl to remove the dropdown box without screwing up the rest of head.tpl?

Thanks in advance

Satyr 01-26-2003 02:26 PM

hehe
 
Of course I fight with it for 2 hours and as soon as I post I figure it out.
For other who might need to know

Code:

{if $main eq "catalog" and $current_category.category eq "" and $all_languages_numba gt 1}
<FORM action="home.php" method=GET name=sl_form>
<SELECT name=sl onChange="javascript: document.sl_form.submit()">
{section name=ai loop=$all_languages}
<OPTION value="{$all_languages[ai].code}"{if $store_language eq $all_languages[ai].code} selected{/if}>{$all_languages[ai].language}</OPTION>
{/section}
</SELECT>
</FORM>
{else}

{/if}


Remove this from head.tpl and the pesky languages drop box goes away :wink:

heresmysite 02-03-2003 12:04 PM

Leave the code alone...
 
There's easier way other than removing the section of code from head.tpl. From Admin, enter Languages section. Under "Edit language", select the language you don't want to use and click on "Disable" button. If you disabled all but one language, the language option box on customer's page will disappear.

edupin 03-16-2004 04:41 AM

False!
I did it, I disabled all but one language (the one I use), and the combo box still appears, showing just one language...

shan 03-16-2004 05:22 AM

you can comment out the code in the header or run an sql statement to remove all language entries apart from the ones you want

something along the lines of

Code:

DELETE FROM xcart_languages WHERE code != 'us'

heresmysite 03-16-2004 04:11 PM

Yeah, disabled all but one language worked until I upgraded Cart to newer version. It came back again. I tried to remove other languages from SQL and it doesn't work so I just edit the header tpl to hide it instead. :(

gravel 03-30-2004 02:34 PM

Another way the code may look...
 
I think I took out the same section from head.tpl, but the code looks a little different. Anyway, it seems to work.

Code:

{if $usertype eq "C"}
<table border=0 cellpadding=0 cellspacing=0>
<FORM action="home.php" method=GET name=sl_form>
<INPUT type=hidden name="redirect" value="{$smarty.server.PHP_SELF}?{$smarty.server.QUERY_STRING}">
<tr>
<td>
{$lng.lbl_select_language}:
<SELECT name=sl onChange="javascript: document.sl_form.submit()">
{section name=ai loop=$all_languages}
<OPTION value="{$all_languages[ai].code}"{if $store_language eq $all_languages[ai].code} selected{/if}>{$all_languages[ai].language}</OPTION>
{/section}
</SELECT>
</td></tr>
</FORM>
</table>
{elseif ($usertype eq "P" or $usertype eq "A") and $login}
<table border=0 cellpadding=0 cellspacing=0>
<FORM action="{$smarty.server.REQUEST_URI}" method=POST name=asl_form>
<tr>
<td>Current language:</td>
<td>
<INPUT type=hidden name="redirect" value="{$smarty.server.QUERY_STRING}">
<SELECT name=asl onChange="javascript: document.asl_form.submit()">
{section name=ai loop=$all_languages}
<OPTION value="{$all_languages[ai].code}"{if $current_language eq $all_languages[ai].code} selected{/if}>{$all_languages[ai].language}</OPTION>
{/section}
</SELECT>
</td></tr>
</FORM>
</table>
{else}

{/if}


B00MER 03-31-2004 04:33 PM

You can always go into the admin->languages and delete all of them except the desired single one :)

heresmysite 04-01-2004 04:18 PM

Quote:

Originally Posted by B00MER
You can always go into the admin->languages and delete all of them except the desired single one :)


Well... It worked fine with older version until I upgraded it to v3.5.3. The v3.5.3 didn't hide the menu when I deleted all but one. I don't know if this is a bug and already fixed in newer releases. I ended up editing the header instead.

Jon 04-06-2004 10:16 AM

Can anybody tell me how to edit the /include/get_language.php file to reduce the server processing too?

thundernugs 05-09-2004 08:08 PM

i am on version 3.5.7

i disabled all the languages except english and the drop down box is gone.

hopefully, it will stay that way!

Jon 05-09-2004 08:11 PM

Hi Thundernugs,

That should do it for the language drop down, what I'd like to do it remove the parsing for languages all together, as right now it still runs through the language php processing each page load.

kpriest 05-31-2004 08:20 AM

I have a related problem (maybe) with 3.5.7: I deleted all languages except English and shortly after that, I noticed some of the txt_variables are not showing up on the home page. Specifically $lng.txt_today_news and $lng.txt_subscribe_monthly - these are the only ones I have found that do not appear. The news was in the today_news.tpl, but I consolidated it into news.tpl which now looks like this:
Code:

{* $Id: news.tpl,v 1.14 2003/08/13 06:49:07 svowl Exp $ *}
{capture name=menu}
<p class=SmallMsg>
{$lng.txt_today_news}
</p>
[img]{$ImagesDir}/spacer.gif[/img]

{$lng.txt_subscribe_monthly}
<form action="{$xcart_web_dir}/mail/subscribe.php" method=get name=subscribeform>
<input type="text" name="email" size=16>


{include file="buttons/subscribe_menu.tpl"}
<input type=hidden name=redirect value="{$redirect}">
</form>
</FONT>
{/capture}
{ include file="r_menu.tpl" dingbats="dingbats_news.gif" menu_title=$lng.lbl_news menu_content=$smarty.capture.menu }

They used to show up and the only related thing I can think of that changed was that I deleted the unused languages.

Yes, I double (triple) checked the variables in the languages table and they are there and as I said, they were working. There are other text vars and lbl vars all working ok.

Any ideas why these would suddenly not be displayed???

grrrr - very frustrated... :cry:

kpriest 05-31-2004 01:17 PM

UPDATE: I restored the original xcart_languages table and that fixed it. Not sure why, but oh well.

Frans@supremeanime.com 06-04-2004 11:16 AM

Languages off
 
Quote:

Originally Posted by thundernugs
i am on version 3.5.7

i disabled all the languages except english and the drop down box is gone.

hopefully, it will stay that way!


Thanks this worked for me.


All times are GMT -8. The time now is 03:01 PM.

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