X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Assigning Variable - !!! Solved thanks to Funky! (https://forum.x-cart.com/showthread.php?t=4120)

John7 08-25-2003 07:04 PM

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

funkydunk 08-27-2003 03:15 AM

try $product.productcode instead

that'll work :)

John7 08-27-2003 07:03 AM

Nope tried that already.
 
Nope tried that already.

When I use that instead it says Array.productcode as the results.

funkydunk 08-27-2003 07:41 AM

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

works for me on 3.4.4 in product.tpl :?

funkydunk 08-27-2003 07:42 AM

just spotted the difference - the ""

John7 08-27-2003 08:54 AM

It works!!!
 
It works!!!

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

Thanks once again Funydunk!

John7

funkydunk 08-27-2003 09:00 AM

:)


All times are GMT -8. The time now is 09:50 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.