tozi Posted November 2, 2009 Share Posted November 2, 2009 Is it possible create product’s features any like this?I have copied this code from product.tpl and paste to product-list.tpl. But it is wrong. thx > {if $features} <!-- product's features --> </pre> <ul> {foreach from=$features item=feature} {$feature.name|escape:'htmlall':'UTF-8'} {$feature.value|escape:'htmlall':'UTF-8} {/foreach} </ul> <br> Solution: {foreach from=$product.features item=feature name=features} {$feature.name|escape:'htmlall':'UTF-8'}: {$feature.value|escape:'htmlall':'UTF-8'} {/foreach} Link to comment Share on other sites More sharing options...
cerberus22 Posted November 16, 2009 Share Posted November 16, 2009 thanks for the info, works well on prestashop v1.1 Link to comment Share on other sites More sharing options...
daz-dm Posted January 4, 2010 Share Posted January 4, 2010 I have updated my file as per ToziI have 3 features for my products but I only wish to show one feature on the product-list.tpl.Is there a way to select which features to show?ThanksDarren Link to comment Share on other sites More sharing options...
Draco Posted March 27, 2010 Share Posted March 27, 2010 Hi Darren,I was having the same problem but I customized the thread above.You will have to make some change to the product-list.tpl fileMy Shop sells DVDs and Blu-rays, so I wanted to show only two features Release Date and StudioHere is the code I used : {foreach from=$product.features item=feature name=features} {if $feature.name == 'Release Date'} {$feature.name|escape:'htmlall':'UTF-8'}: {$feature.value|escape:'htmlall':'UTF-8'} {/if} {if $feature.name == 'Studio'} {$feature.name|escape:'htmlall':'UTF-8'}: {$feature.value|escape:'htmlall':'UTF-8'} {/if} {foreachelse} Awaiting Release Details... {/foreach} I hope this help guys,Thanks for the help tozi ,Draco 2 Link to comment Share on other sites More sharing options...
Benimaru Posted December 21, 2010 Share Posted December 21, 2010 Hi,I know this is an old thread, but I was trying to solve the same issue. Draco's solution worked really well, but I have a newbie code question.It is possible to display each feature in a desired order ? I don't know why, when updating a product feature, it changes it's order display, and it's a mess when trying to desing expecting items in a fixed known order.Thanks in advance. Link to comment Share on other sites More sharing options...
Benimaru Posted December 21, 2010 Share Posted December 21, 2010 By the way, this is my code: > </pre> <ul> {foreach from=$features item=feature name=features} {if $feature.name == 'DO'} </ul> <strong>{$feature.name|escape:'htmlall':'UTF-8'|cat:" "}{$feature.value|escape:'html':'UTF-8'}</strong><br><br> {/if}<br><br> {if $feature.name == 'Variedad 1'}<br><span>{l s='Variedades: '}</span> br>{$feature.value|escape:'html':'UTF-8'|strip}<br> {/if}<br> {if $feature.name == 'Variedad 2'}<br>{$feature.value|escape:'html':'UTF-8'|strip}<br> {/if}<br> {if $feature.name == 'Variedad 3'}<br>{$feature.value|escape:'html':'UTF-8'|strip}<br> {/if}<br> {if $feature.name == 'Variedad 4'}<br>{$feature.value|escape:'html':'UTF-8'|strip}<br> {/if}<br> {if $feature.name == 'Variedad 5'}<br>{$feature.value|escape:'html':'UTF-8'|strip}<br> {/if}<br><br> {* feature 14 is grad. If I don't use id, does not work (accents?)*}<br> {if $feature.id_feature == 14}<br><span>{$feature.name|escape:'html':'UTF-8'|cat:": "}</span>{$feature.value|escape:'htmlall':'UTF-8'}<p></p> <br> {/if}<br> {* feature 8 is note. Without id, does not work (accents? spaces?)*}<br> {if $feature.id_feature == 8}<br> {if $feature.value >= 90}<br><img src="%7B%24img_dir%7Dicon_winner.gif" alt="%7B$img_dir%7Dicon_winner.gif" border="0" width="36" height="27"><br> {/if}<br> {/if}<br> {foreachelse}<br> {/foreach}<br><br Getting features randomized in order in every feature update :S 1 Link to comment Share on other sites More sharing options...
nikmagnus Posted January 29, 2011 Share Posted January 29, 2011 Thanks for your help, I found this useful.The code I used was: {foreach from=$product.features item=feature name=features} {$feature.value|escape:'htmlall':'UTF-8'}{/foreach} As I have only one feature.If using multiple features, this may work: {capture name=full_product} {if $product.features.0.name eq"Discount"} {$product.features.0.value|trim} {/if} {/capture} {$smarty.capture.full_product} Link to comment Share on other sites More sharing options...
123maverick456 Posted June 7, 2011 Share Posted June 7, 2011 Great this is what i'm looking for. Thanks so much. I really appreciate this. Link to comment Share on other sites More sharing options...
ltempest Posted March 15, 2012 Share Posted March 15, 2012 Does anyone know how to wrtie the script above to work in v1.4.7. I only want to show one of the features. How do I target a specific feature? Thanks Lee Link to comment Share on other sites More sharing options...
zounars Posted May 9, 2012 Share Posted May 9, 2012 As Itempest I'm looking for a way to use this method with PrestaShop 1.4.7.3. Thanks for your help. Link to comment Share on other sites More sharing options...
Start Online Design Posted June 5, 2012 Share Posted June 5, 2012 I wanna share with you a module that organizes product features in groups (like Dimmensions, Display etc). More details here...http://www.prestashop.com/forums/topic/172215-organize-product-features-into-groups/ Link to comment Share on other sites More sharing options...
need4speed Posted September 22, 2012 Share Posted September 22, 2012 Thank you very much for your post. Link to comment Share on other sites More sharing options...
OliB Posted January 22, 2013 Share Posted January 22, 2013 Thank you all. Works for Prestashop 1.5.2 Link to comment Share on other sites More sharing options...
AZC Posted April 3, 2014 Share Posted April 3, 2014 (edited) Hi, this is an ages old thread, but if anyone can help please. The features show on the product list page but when changing from grid to list they disappear . When I change back to grid view they do not return. Any ideas? Thanks {SOLVED} see http://nemops.com/features-to-product-list-prestashop-16/#.U0GOAvldWHf Edited April 6, 2014 by AZC (see edit history) 1 Link to comment Share on other sites More sharing options...
Deiindd Posted April 8, 2014 Share Posted April 8, 2014 (edited) . Edited April 26, 2014 by Deiindd (see edit history) Link to comment Share on other sites More sharing options...
S7 Media Ltd Posted June 12, 2014 Share Posted June 12, 2014 Hi Darren, I was having the same problem but I customized the thread above. You will have to make some change to the product-list.tpl file My Shop sells DVDs and Blu-rays, so I wanted to show only two features Release Date and Studio Here is the code I used : {foreach from=$product.features item=feature name=features} {if $feature.name == 'Release Date'} <b style="color: blue; font-weight: 600;">{$feature.name|escape:'htmlall':'UTF-8'}</b>: {$feature.value|escape:'htmlall':'UTF-8'} {/if} {if $feature.name == 'Studio'} <b style="color: blue; font-weight: 600;">{$feature.name|escape:'htmlall':'UTF-8'}</b>: {$feature.value|escape:'htmlall':'UTF-8'} {/if} {foreachelse} <b>Awaiting Release Details...</b> {/foreach} I hope this help guys, Thanks for the help tozi , Draco Thank you sooo much! Link to comment Share on other sites More sharing options...
nilskm Posted November 20, 2014 Share Posted November 20, 2014 I want to do something similar but to show features in columns with headers. Preferably in a second version of list view. Has anyone ever seen a theme that looks anything like the image I've attached? In the example attached the products are screws with some features like diameter that should be shown to the customer. Link to comment Share on other sites More sharing options...
Blue Bear Posted February 5, 2019 Share Posted February 5, 2019 Hi there Is there a way to call the feature of level two by id ? when I used for example {if $feature.id_feature == '24'} -> it's working {if $feature.id_feature == '123'} -> it's not working (this two have the same $product->id_category_default) And do you know how to remove a feature_id list of product ? I'm new to this language so I don't have the grammar For example {if $product->id_category_default && [exclude ??] $feature.id_feature == '24'} ?? Thanks a lot, Clément 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