| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Displaying smarty variables inside smarty variables | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Displaying smarty variables inside smarty variables
I recently revisited this problem and thought I'd share the solution.
Say you're setting up the help/conditions_customers.tpl page. You want the smarty language variable: {$lng.txt_conditions_customer} to contain something like: {$config.Company.location_address} {$config.Company.location_city}, {$config.Company.location_state} {$config.Company.location_zipcode} The trick is, in help/conditions_customers.tpl, instead of using the statement: {$lng.txt_conditions_customer} use: {eval var=$lng.txt_conditions_customer} This will render the smarty variables within the smarty variable {$lng.txt_conditions_customer}. Hope this helps someone, Rubyaryat
__________________
Rubymods.com - Your X-Cart services partner for over 9 years. Modules offered: FedEx labels, Live currency rates, GeoIP, Order Audit, Multiple e-goods. X-Cart Store Hosting, project management and affiliates program available. 4.2.3 gold [Unix] |
|||||||||
|
#2
|
|||||||
|
|||||||
Nice one...moving to FAQ
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||||
|
|||||||||
good find
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#4
|
|||||||||
|
|||||||||
Re: Displaying smarty variables inside smarty variables
There's a reason eval is one letter away from evIl
Quote:
Just to note, eval can be an evil function if it is overused, be sure and use such sparingly. It can become a security exploit and even cause excessive cpu cycles on your server end.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|