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)
-   -   Adding a language variable (https://forum.x-cart.com/showthread.php?t=39163)

beetlejuice 04-17-2008 04:34 PM

Adding a language variable
 
Must be having one of those days :(

I need to add a text variable (as highlighted) to the shipping methods template at the checkout on a client's site.

Code:

{* $Id: shipping_methods.tpl,v 1.7.2.11 2007/09/26 10:35:04 ferz Exp $ *}
<table cellpadding="5" cellspacing="5" width="100%">
<tr>
  <td></td>
{$lng.txt_delnote}
</tr>
<tr>
<td valign="top" width="30%">
{include file="customer/main/subheader.tpl" title=$lng.lbl_shipping_address}
{if $userinfo}
{if $userinfo.default_fields.s_address}{$userinfo.s_address}<br />{/if}
{if $userinfo.default_fields.s_address_2 and $userinfo.s_address_2}
{$userinfo.s_address_2}<br />
{/if}
{if $userinfo.default_fields.s_city}{$userinfo.s_city}<br />{/if}
{if $userinfo.default_fields.s_county and $config.General.use_counties eq "Y" and $userinfo.s_county}{$userinfo.s_county}<br />{/if}
{if $userinfo.default_fields.s_state}{$userinfo.s_statename}<br />{/if}
{if $userinfo.default_fields.s_country}{$userinfo.s_countryname}<br />{/if}
{if $userinfo.default_fields.s_zipcode}{$userinfo.s_zipcode}{/if}
{else}
No data
{/if}

{if $login ne ""}
<br /><br />
{include file="buttons/modify.tpl" href="register.php?mode=update&action=cart"}
{/if}</td>
<td valign="top" width="70%">
{include file="customer/main/subheader.tpl" title=$lng.lbl_delivery}



I've created the txt file but it never shows. What blatantly obvious thing am I missing?

Thanks

balinor 04-17-2008 04:52 PM

Re: Adding a language variable
 
You've got the language variable outside the table cell, it'll never show. Put it between the <td> and </td>

beetlejuice 04-17-2008 05:02 PM

Re: Adding a language variable
 
Quote:

Originally Posted by balinor
You've got the language variable outside the table cell, it'll never show. Put it between the <td> and </td>


Thanks Balinor, I tried that and it still doesn't show. I created a new cell which now bumps the rest of the page down a little so I know that is working but even placing the txt variable between those tags it still doesn't show.

This is so easy, so I'm stumped why it won't show.

Any other suggestions???

balinor 04-17-2008 05:11 PM

Re: Adding a language variable
 
You sure you copied the variable exactly as you created it?

beetlejuice 04-17-2008 05:19 PM

Re: Adding a language variable
 
Yeah mate, I've lost count how many times I've checked it. :roll:

I'm going to send a message to Jon at WebsiteCM as I'm using their Ezy checkout, however when using Webmaster mode it tells me that their mod still uses all the standard XCart fastlane checkout templates but just changes some language variables and the way the array is shown.

Perhaps their mod bans anyone from making alterations ?? :lol:

Thanks for helping out.

balinor 04-17-2008 05:21 PM

Re: Adding a language variable
 
Na, doubt that. So if you type text in where the language variable is, does that update on the site? And have you cleared your cache?

beetlejuice 04-17-2008 05:34 PM

Re: Adding a language variable
 
Cleared the cache but still doesn't show. typed in "Delivery Notes" between the TD and /TD tags and that appears so I have no idea why I can't show a variable.

Weird, weird.

I suppose I can just replace Delivery Notes with the text from the variable, but it's ugly doing it that way.

kube 04-17-2008 06:00 PM

Re: Adding a language variable
 
Have you tried using a standard lng variable like {$lng.txt_welcome}, or a similar language variable you're familiar with, in its place? If it printed that would most likely prove whether the var you have created is at fault or not (I would have thought).

Can you search for your language variable directly by inputting the variable name in the filter under languages?

For example, in admin, this page below should give a result... (although you may have some different requirements to be entered below)
Code:

languages.php?language=US&topic=&filter=txt_delnote
Does it contain a value? Is it simple text (no HTML included)?

I know the questions are silly to ask - but you never know.

beetlejuice 04-17-2008 06:26 PM

Re: Adding a language variable
 
Quote:

Originally Posted by kube
Have you tried using a standard lng variable like {$lng.txt_welcome}, or a similar language variable you're familiar with, in its place? If it printed that would most likely prove whether the var you have created is at fault (I would have thought).

Can you search for your language variable directly by inputting the variable name in the filter under languages?
Code:

languages.php?language=US&topic=&filter=txt_delnote
Does it contain a value? Is it simple text (no HTML included)?

I know the questions are silly to ask - but you never know.


Thanks Kube for replying. Yes I can search and find the variable and it has a plain text value with no html. If I include {$lng.txt_welcome} it appears fine, so I created a new variable again and it still won't appear. So I raise the white flag.

kube 04-17-2008 06:55 PM

Re: Adding a language variable
 
*scratches head* What could possibly be doing that?

Can you print the variable, you have created, somewhere else? Like on the home page home.tpl. That would definitely confirm something is up if it did print.


All times are GMT -8. The time now is 11:20 AM.

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