ricsavoy Posted August 19, 2014 Share Posted August 19, 2014 Hi everyone, I really need to add one feature after the title product on my product.tpl. Not only in the data sheet. I copy/paste this piece of code at the right place, but i've got the entire list of features of course.... {if isset($features) && $features} <!-- product's features --> <ul id="idTab2" class="bullet"> {foreach from=$features item=feature} {if isset($feature.value)} <li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li> {/if} {/foreach} </ul> {/if} Please help me... Thank you in advance PS 1.5.6.2 Link to comment Share on other sites More sharing options...
Rolige Posted August 19, 2014 Share Posted August 19, 2014 Use an if condition and validate it by the id of the feature, eg: {if isset($features) && $features} {foreach from=$features item=feature} {if isset($feature.id_feature) && ($feature.id_feature == 1)} <li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li> {/if} {/foreach} {/if} Change ($feature.id_feature == 1) the "1" by the id you are looking for, good luck. Link to comment Share on other sites More sharing options...
ricsavoy Posted August 19, 2014 Author Share Posted August 19, 2014 Yeess !! it works like a charm Thank you so much... Link to comment Share on other sites More sharing options...
ricsavoy Posted September 5, 2014 Author Share Posted September 5, 2014 HI, Sorry to bother you again but i'd like to do the same thing in my product-list.tpl. I added the piece of code you gave me before but it doesn't work. Could you help me please. Thx Link to comment Share on other sites More sharing options...
Rolige Posted September 5, 2014 Share Posted September 5, 2014 Because is code for product.tpl not for product-list.tpl Link to comment Share on other sites More sharing options...
ricsavoy Posted September 6, 2014 Author Share Posted September 6, 2014 (edited) I don't doubt that but could you explain why it works in one hand and not work in the other hand. What's the working code if you know it Thank you Edited September 6, 2014 by ricsavoy (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted September 6, 2014 Share Posted September 6, 2014 categories controller doesnt have the same variables as product page controller categories controller = category page with list of products product controller = product page Link to comment Share on other sites More sharing options...
ricsavoy Posted September 7, 2014 Author Share Posted September 7, 2014 Therefore we can't make it ? Link to comment Share on other sites More sharing options...
vekia Posted September 7, 2014 Share Posted September 7, 2014 you have to alter category controller and pass the same variables to smarty array as product controller passes. there is no other way to achieve it Link to comment Share on other sites More sharing options...
ricsavoy Posted September 7, 2014 Author Share Posted September 7, 2014 (edited) How can i do that precisely ??? Is there a tuto about that ? sorry but i'm a real newbie in smarty.. Thank Edited September 7, 2014 by ricsavoy (see edit history) Link to comment Share on other sites More sharing options...
ricsavoy Posted September 8, 2014 Author Share Posted September 8, 2014 Nobody knows ? Link to comment Share on other sites More sharing options...
ricsavoy Posted September 10, 2014 Author Share Posted September 10, 2014 For people interested in this subjet, i've found the solution in another thread and it works great for PS 1.5.6.2 : {foreach $product.features as $feature}{if $feature.name == 'Your protection'}<p>{$feature.value|escape:'htmlall':'UTF-8'}</p>{/if}{/foreach} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now