| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Variables in product descriptions? | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hi,
As part of the description in our products we often quote the price. As this is different for different users, we would like to be able to put something link {price} in the description of a product to be replaced with the actual price. Is there a method of doing this? When I tried including smarty code it was displayed rather than executed. Mocara.
__________________
4.0.15 Linux |
|||||||
#2
|
|||||||
|
|||||||
![]() Smarty tags won't work by default inside a product description, no.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
![]() 'by default'? Does that mean it can be done? Does that envolve surrounding any time the product description is displayed by an {eval} or some such?
Mocara.
__________________
4.0.15 Linux |
|||||||
#4
|
|||||||
|
|||||||
![]() For anyone interested in doing this. Place variables indside brackets in your description, e.g. {$products[product].list_price}
In skin1/customer/main/products.tpl change {$products[product].descr|truncate:900:"...":true} to {eval var=$products[product].descr|truncate:900:"...":true} Just in case anyone was interested ![]()
__________________
4.0.15 Linux |
|||||||
#5
|
|||||||
|
|||||||
![]() nice one, should be a sticky
are there any drawbacks to adding eval ?
__________________
X-Cart version 4.0.19 |
|||||||
#6
|
|||||||
|
|||||||
![]() no longer DESPERATE!!!!! -SOLVED-
Since upgrading from 4.1.8 to 4.1.10 this no longer is working for me and my includes in product descriptions are printing as the include code rather than including the contents of the include file. What is the way in 4.1.10 to allow includes in product descriptions? EDIT: To implement this you should modify the 'skin12/customer/main/product.tpl' file. Find the following code: ------------------------------- {if $product.fulldescr ne ""}{ $product.fulldescr}{else}{$product.descr}{/if} ------------------------------- and replace it with this one: ------------------------------- {if $product.fulldescr ne ""}{eval var=$product.fulldescr}{else}{$product.descr}{/if} |
|||||||
#7
|
|||||||
|
|||||||
![]() How can we accomplish this in 4.2???????
I use smarty to add in a custom tpl for sizing info and specific branding info that I have in one file rather than having to modify it in every individual product description when it changes. The eval var= does not work in 4.2. |
|||||||
#8
|
|||||||||
|
|||||||||
![]() Light Speed: I can confirm the {eval var= ...} works fine in X-Cart 4.2. Just change the template using eval and you will see it works.
Double check your modifications.
__________________
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 |
|||||||||
#9
|
|||||||
|
|||||||
![]() Quote:
Thanks for the confirmation! I will try again. |
|||||||
#10
|
|||||||
|
|||||||
![]() Yup it works!
THIS IS FOR XCART 4.2 AND UP ONLY! skin1/customer/main/product.tpl Change this: Code:
to this: Code:
|
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|