Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Assigning Variable - !!! Solved thanks to Funky!

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-25-2003, 07:04 PM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default Assigning Variable - !!! Solved thanks to Funky!

I'm trying to assign the sku# to the variable $id.

Here is my code:

Code:
{assign var="id" value="$product[productcode]" }

Here is the code to display it:
Code:
{$id}

I'm adding this code to product.tpl

This works successfully on an older version of x-cart, but as I test it on the newest version of x-cart the {$id} comes up as blank.

Has somthing changed? Anyone got any ideas on how to make this work with the newest version of x-cart?

Thanks in Advance!

John7
Reply With Quote
  #2  
Old 08-27-2003, 03:15 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

try $product.productcode instead

that'll work
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 08-27-2003, 07:03 AM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default Nope tried that already.

Nope tried that already.

When I use that instead it says Array.productcode as the results.
Reply With Quote
  #4  
Old 08-27-2003, 07:41 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

{assign var="id" value=$product.productcode}
{$id}

works for me on 3.4.4 in product.tpl
__________________
ex x-cart guru
Reply With Quote
  #5  
Old 08-27-2003, 07:42 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

just spotted the difference - the ""
__________________
ex x-cart guru
Reply With Quote
  #6  
Old 08-27-2003, 08:54 AM
 
John7 John7 is offline
 

Senior Member
  
Join Date: Jan 2003
Posts: 136
 

Default It works!!!

It works!!!

It was the " " all along. It seemed so hard, but was so simple.

Thanks once again Funydunk!

John7
Reply With Quote
  #7  
Old 08-27-2003, 09:00 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

__________________
ex x-cart guru
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:12 AM.

   

 
X-Cart forums © 2001-2020