| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Accessing Smarty Variable in Javascript?? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Accessing Smarty Variable in Javascript??
Hi,
I'm trying to access an extra field value from within javascript. How can I do this?? Here is what I have if it helps, it's take from the customer/main/product.tpl: I'm trying to Alert( {$v.field_value} ) Code:
__________________
X-Cart Gold version 4.2.2 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Accessing Smarty Variable in Javascript??
moved to X-Cart Customization > Storefront Design & Template Editing in v3.x, 4.0.x, 4.1.x
__________________
Sincerely yours, Alex Mulin VP of Business Development for X-Cart X-Payments product manager |
|||||||||
#3
|
|||||||
|
|||||||
Re: Accessing Smarty Variable in Javascript??
The {literal} ... {/literal} means don't do anything smarty between those tags. You have two choices. Since you don't use any { or } in your javascript you can just remove the {literal} and {/literal}. If you think you might be adding in some ifs where you'll be using { and } you can either leave out the {literal} {/literal} and use {ldelim} and {rdelim} instead { and } in your javascript. Or you can leave in the {literal} {/literal} and change
{$v.field_value} to {/literal}{$v.field_value}{literal}.
__________________
Manuka Bay Company X-Cart Version 4.0.19 [Linux] UGG Boots and other fine sheepskin products http://www.snowriver.com |
|||||||
|
|||
X-Cart forums © 2001-2020
|