| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Variables in product descriptions? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Variables in product descriptions?
Saw a similar thread for very low x-cart versions around 2007.
Can this be done for 4.4.4? I would absolutely love it if it can be done. That way I can create a template using the smarty code for my product descriptions, saving me hours and hours of work. e.g {$product.product} and {if $main eq "manufacturers} etc Someone please shed light on this!
__________________
Xcart 4.5.2 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Variables in product descriptions?
Yes, it can be done, using the Webmaster mode, in which you can view the templates involved in the rendering of each page, also can click on the 'Show Variables' button of the webmaster mode popup window, in which section you can view all the smarty variables and their content.
__________________
Vasilis Vrontisis X-Cart Development, Maintenance & Customization https://[URL="http://www.craftforweb.com"]craftforweb.com[/url] vasilis@craftforweb.com |
|||||||||
#3
|
|||||||
|
|||||||
Re: Variables in product descriptions?
Quote:
That's good to know, but how can I allow smarty variables to go in product descriptions? As they dont show up inside.
__________________
Xcart 4.5.2 |
|||||||
#4
|
|||||||
|
|||||||
Re: Variables in product descriptions?
I've tried a few ways of doing this but it doesn't work e.g
<td class="descr">{$product.fulldescr|default:$product .descr}</td> changed to <td class="descr">{eval var=$product.fulldescr|default:$product.descr}</td> Anyone got a suggestion? Editing skin/common_files/customer/main/product_details.tpl
__________________
Xcart 4.5.2 |
|||||||
#5
|
|||||||
|
|||||||
Re: Variables in product descriptions?
Doesn't matter, decided to do something different, thanks anyways!
__________________
Xcart 4.5.2 |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Variables in product descriptions?
How come
Code:
__________________
Vasilis Vrontisis X-Cart Development, Maintenance & Customization https://[URL="http://www.craftforweb.com"]craftforweb.com[/url] vasilis@craftforweb.com |
|||||||||
#7
|
|||||||
|
|||||||
Re: Variables in product descriptions?
I can do it on the code itself it works fine, I just wanted to be able to do it via product description e.g using xcart admin to edit a product description,, hope that makes sense.
__________________
Xcart 4.5.2 |
|||||||
#8
|
|||||||||
|
|||||||||
Re: Variables in product descriptions?
Not sure if this is what you are looking for. You could try using substitute. Just a thought as I haven't actually tried it in the description:
"This is my {{adjective}} description is." {$product.descr|substitute:"adjective":"amazing"} |
|||||||||
#9
|
|||||||||
|
|||||||||
Re: Variables in product descriptions?
I have tried this, and it worked (using the 'replace' smarty modifier):
(the following code is used inside any template file that displays the product description) Code:
__________________
Vasilis Vrontisis X-Cart Development, Maintenance & Customization https://[URL="http://www.craftforweb.com"]craftforweb.com[/url] vasilis@craftforweb.com |
|||||||||
#10
|
|||||||||
|
|||||||||
Re: Variables in product descriptions?
This is a very good question. You want in your Admin -> Product page to use in product short or full description any kind of variables (XC variables or your own). For language labels I can confirm that eval() function works.
http://forum.x-cart.com/showthread.php?t=57707&highlight=eval http://forum.x-cart.com/showthread.php?t=44405&highlight=eval Till now I did not think using other variables in product description, just static text.
__________________
X-Cart Next: Business 5.2 (learning and testing) X-Cart Classic: Gold and Gold Plus 4.7 Lots of Modules and Customizations OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions) You can catch my ideas here: http://ideas.x-cart.com |
|||||||||
|
|||
X-Cart forums © 2001-2020
|