View Single Post
  #1  
Old 02-18-2011, 11:04 AM
 
spwestwood spwestwood is offline
 

Member
  
Join Date: Aug 2007
Posts: 17
 

Default Smarty variable to {php}{/php} section

Hi,

I have a quick question. I want to display an extra field value on the cart page, and then do some database lookups with that value. For this I need to access a smarty variable in a {php}{/php} section.

I got it working on an install of xcart 4.4.1. In this version I have:

Extra field value:
Code:
{$product.extra_fields.0.value}
Then in the php section:
Code:
{php}$variable=$this->_tpl_vars['product']['extra_fields']['0']['value'];{/php}

Now I want to move this over to my current install, which is 4.1.9.

Extra field value (slightly different):
Code:
{$products[product].extra_fields.0.value}.
php section:
Code:
{php} ?? {/php}

The {php} bit I did for the version 4.2 doesn't work. Does anyone know how I can do this?

Thanks,
__________________
spwestwood.
Version 4.1.9
Version 4.4
Reply With Quote