Graphics Back Label Posted October 20, 2016 Share Posted October 20, 2016 (edited) Goog morning, I work with Prestashop 1.6.1.7 and I'd like display a feature value of a product within the product list (where you see a list of products) below its name. We sell garments and in the BO I created a custom feature value (the material of garments, like Cashmere for example) and I'd like to display this value below its name on the product list. I had added this following code to display the feature value on the product.tpl and it works only there.. I think this variable it's not a "global, public" variable (I just play with PHP, I'm not an expert) {foreach from=$features item=feature} <tr class="{cycle values="odd,even"}"> {if isset($feature.value)} <td>{$feature.name|escape:'html':'UTF-8'}</td> <td>{$feature.value|escape:'html':'UTF-8'}</td> {/if} </tr> {/foreach} Edited October 20, 2016 by Graphics Back Label (see edit history) Link to comment Share on other sites More sharing options...
ventura Posted October 20, 2016 Share Posted October 20, 2016 Try it this way {foreach from=$product.features item=feature} Link to comment Share on other sites More sharing options...
Graphics Back Label Posted October 20, 2016 Author Share Posted October 20, 2016 Many thanks, it's correct! (I'll mark as Answered) One another question: where is written these classes? Which line in Product.php? Regards, Link to comment Share on other sites More sharing options...
hakeryk2 Posted October 20, 2016 Share Posted October 20, 2016 (edited) Try maybe this as well {if isset($features) && $features} {foreach from=$features item=feature} {if $feature.id_feature == ID OF FEATURE HERE} <span>{$feature.name|escape:'html':'UTF-8'}</span>: <span>{$feature.value|escape:'html':'UTF-8'}</span> {/if} {/foreach} {/if} Type ID of feature in ID OF HERE, you will have more control. Edited October 20, 2016 by hakeryk2 (see edit history) Link to comment Share on other sites More sharing options...
Sasni Posted July 7, 2019 Share Posted July 7, 2019 (edited) its possible get feature value from Accesories? EDITED I will answer myself - yes Edited December 30, 2019 by Sasni (see edit history) 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