| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How to call a language variable | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hi there,
I have a text that comes back in a lot of products pages. So, my idea is to insert that text in a language variable. Problem is how to call the variable from txt_welcome, from category description and from product description ? I have tested from txt-welcome but the variable itself is interpreted as text... So, how to call it ?...i've not found in my research in the forums. Thanks.
__________________
X-Cart Gold v4.4.3 |
|||||||
#2
|
|||||||||
|
|||||||||
![]() {$lng.your_variable}. But you can't have language variable inside language variable
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#3
|
|||||||
|
|||||||
![]() Steve,
Before creating my own language variable, i tried again to test with an existing one but it doesn't work. I tried to put the following both in category description and in product description but it is still treated as text : {$lng.disable_chinfo_msg} {$lng.txt_disable_chinfo_msg} {literal} {$lng.txt_disable_chinfo_msg} {/literal} {{$lng.txt_disable_chinfo_msg}} Those 4 attempts above did not displayed the text contained but only the variable itself. I have a doubt as if the variable could not be found it should maybe give back an error but not display the variable itselfs logically. I have both french and english languages installed with english currently disabled, the variable is called from the french language version. Is the path to the variable wrong ?
__________________
X-Cart Gold v4.4.3 |
|||||||
#4
|
|||||||||
|
|||||||||
![]() You also cannot have smarty tags inside descriptions (they are treated as plain text) or if you insist of doing it you have to call the decsription with "eval" function in the template so the smarty tags are resolved - http://www.smarty.net/docs/en/language.function.eval.tpl
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#5
|
|||||||
|
|||||||
![]() Technically, should I be able to use {$lng.lbl_myLabel} inside the includes/help.php file. It not working correctly when placed there.
__________________
X-Cart version 4.4.3 |
|||||||
#6
|
|||||||||
|
|||||||||
![]() This is smarty code which cannot be used in PHP script directly.
You should use the following PHP code instead: PHP Code:
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful ![]() Click here to learn how to apply patches X-Cart Extensions |
|||||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|