|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Nazo74 Smarty n00b
Joined: 18 Aug 2011 Posts: 4
|
Posted: Sun Aug 28, 2011 6:44 pm Post subject: Display features products in module homefeatured |
|
|
Hello everybody,
I customize my prestashop (v 1.4) and I have a problem that unfortunately I can not solve alone. So I ask your for help.
I'm trying customize the homefeaturedproducts module. The idea is to replace the "short description" by product features. Here the code to modify :
Code: | <a href="{$product.link}" title="{l s='More' mod='homefeatured'}">{$product.description_short|strip_tags|truncate:130:'...'}</a> |
I am researching. To display product features, I think I must use the variable $features. I also saw that some recommend to look in product.tpl file to inspire. Including:
Code: | {foreach from=$features item=feature}
<li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li>
{/foreach} |
My problem is that I try to combine in every sense but it doesn't work. I think it does not work because my feature variable is not defined in the phpfile of the homefeaturedproducts module. It's hard for me because I don't know the Smarty language but logically, I must be able to find a module where variable is defined. In which case I would make a copy and paste in the file php. The logic seems to be good isn't it?
Does someone know a module where feature variable is defined? (It saves me to search in all). After that, I do not know if it was a false statement or if this is true for version 1.4 but I read on a forum that the feature variable (not only) would be defined globally in prestashop and finally it would be accessible anywhere. Does it speak to you? In any case, if it's true, then I do not understand why it does not work ...
Thank you in advance for your help.
Regards
Ps : excuse me for my bad english |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|