Sarak Posted June 21, 2012 Share Posted June 21, 2012 (edited) Is there a way to assign features to products, have them show up as filters in the Layered Navigation but not show up in the "Data Sheet" tab in the description? I'd like to manually add the features to the short description via the HTML Editor and not have them automatically show up in the long description. Thanks Edited June 26, 2012 by Sarak (see edit history) Link to comment Share on other sites More sharing options...
Sarak Posted June 21, 2012 Author Share Posted June 21, 2012 I've tried removing the following codes fron the product.tpl but this hasn't worked: {if $features} {l s='Data sheet'} {/if} and {if $features} <!-- product's features --> {foreach from=$features item=feature} {$feature.name|escape:'htmlall':'UTF-8'}{l s=':'} {$feature.value|escape:'htmlall':'UTF-8'} {/foreach} {/if} Link to comment Share on other sites More sharing options...
Sarak Posted June 22, 2012 Author Share Posted June 22, 2012 Anyone know if this is possible? Link to comment Share on other sites More sharing options...
Sarak Posted June 23, 2012 Author Share Posted June 23, 2012 Bump.... Link to comment Share on other sites More sharing options...
Sarak Posted June 23, 2012 Author Share Posted June 23, 2012 I've read that this can be done in a different post by deleting the code above but that's not working for me. Again, what I'd like to do is have the "features" that appear in the Data Sheet stay active in the Layered Navigation so that products can still be filtered with them but not actually have them appear in the product description. I plan to manually type the features in the short description myself. Is there a way to remove them from the long description while still having them work as filters? Thank you Link to comment Share on other sites More sharing options...
Sarak Posted June 25, 2012 Author Share Posted June 25, 2012 For the moment, I've had to remove everything I had under Features and make them attributes instead, so that they still show up in the Blocklayered filter but not in the long description in the Data Sheet. It's the only way I can think of doing it. Unless there are any ideas......???? Link to comment Share on other sites More sharing options...
vezek Posted June 26, 2012 Share Posted June 26, 2012 I need exactly the same thing. Perhaps you could test the feature value and decide to hide it in the product.tpl if {$feature.value|escape:'htmlall':'UTF-8'} == 'The feature to hide' then display:none. Link to comment Share on other sites More sharing options...
AKJV Posted June 26, 2012 Share Posted June 26, 2012 So basically you would like to hide the features tab on product pages? That should be possible. Did you enable "Force compile" from the backoffice when you made the changes in product.tpl? Otherwise those modifications won't show up in the frontend. Link to comment Share on other sites More sharing options...
vezek Posted June 26, 2012 Share Posted June 26, 2012 I don't know about Sarak precisely, but I have the following: I have a couple of features that I would like to keep in the blocklayered filter. On the product page, I have the following loop in my design: {if $features} ... {foreach from=$features item=feature} <tr> <th>{$feature.name|escape:'htmlall':'UTF-8'} :</th> <td>{$feature.value|escape:'htmlall':'UTF-8'}</td> </tr> ... {/if} However, I would like some features not being displayed. Link to comment Share on other sites More sharing options...
AKJV Posted June 26, 2012 Share Posted June 26, 2012 @vezek: You could try something like this: {foreach from=$features item=feature} {if $feature.name !='name1' && $feature.value !='value1'} <tr> <th>{$feature.name|escape:'htmlall':'UTF-8'} :</th> <td>{$feature.value|escape:'htmlall':'UTF-8'}</td> </tr> {/if} Or when you want to exclude multiple features: {foreach from=$features item=feature} {if ($feature.name !='name1' && $feature.value !='value1') && ($feature.name !='name2' && $feature.value !='value2')} <tr> <th>{$feature.name|escape:'htmlall':'UTF-8'} :</th> <td>{$feature.value|escape:'htmlall':'UTF-8'}</td> </tr> {/if} Fill in de correct features names and values for name1, value1, etc. And as I said before: don't forget to enable Force compile while you modify TPL files. Link to comment Share on other sites More sharing options...
vezek Posted June 26, 2012 Share Posted June 26, 2012 Veel bedankt :-) Would this hack work in category.tpl as well? Basically I would like to get one of my features displayed just under each product thumbnail. Link to comment Share on other sites More sharing options...
AKJV Posted June 26, 2012 Share Posted June 26, 2012 Veel bedankt :-) Would this hack work in category.tpl as well? Basically I would like to get one of my features displayed just under each product thumbnail. You're welcome My code is only to exclude features from the product pages. So no, this doesn't work for displaying features on product lists. That would require completely different code changes (and much more work as most likely feature variables cannot be called from product lists out-of-the-box). Link to comment Share on other sites More sharing options...
Sarak Posted June 26, 2012 Author Share Posted June 26, 2012 Hello AKJV, Thanks for your reply. Unfortunately, editing this code didn't work for me. The features are still appearing in the Data Sheet and also now, for some reason, under the Comments tab. When I Force Compile, my Homeslideshow image and Featured Products from the Home Page completely disappear. It seems I have to turn off Force Compile to get them to show up Link to comment Share on other sites More sharing options...
AKJV Posted June 26, 2012 Share Posted June 26, 2012 @Sarak, It seems that you haven't removed the relevant code completely when the features are still there or at a different spot. Assuming you're using a recent Prestashop version and the default theme, these are the parts you should remove: {if $features}<li><a id="more_info_tab_data_sheet" href="#idTab2">{l s='Data sheet'}</a></li>{/if} {if $features} <!-- product's features --> <ul id="idTab2" class="bullet"> {foreach from=$features item=feature} <li><span>{$feature.name|escape:'htmlall':'UTF-8'}</span> {$feature.value|escape:'htmlall':'UTF-8'}</li> {/foreach} </ul> {/if} Better yet, put both segments between comment brackets {* and *} so that you can restore them easily when needed. Force compile is essential when modifying TPL files. Well, you could also manually delete the cache files but that shouldn't be necessary really. But Force compile is only needed temporarily: so turn on this option, do a page refresh on a product page in your webshop and turn off again. Hope this helps. Link to comment Share on other sites More sharing options...
Sarak Posted June 26, 2012 Author Share Posted June 26, 2012 I'm using a custom theme but that worked, thank you so much Link to comment Share on other sites More sharing options...
AKJV Posted June 26, 2012 Share Posted June 26, 2012 Glad it works Would you be so kind to add [solved] to your topic title? You can change the title by editing your first post (use full editor). Link to comment Share on other sites More sharing options...
jincmd Posted December 12, 2012 Share Posted December 12, 2012 I am trying to exclude my "data sheet" (features) from the tabs, however keep them on the page beside my product image. I'm running 1.5 Thanks AK, help offered is appreciated Link to comment Share on other sites More sharing options...
fernandodelgado Posted July 5, 2014 Share Posted July 5, 2014 How I can hide the features by id? I'm having trouble hiding a feature with the letter ñ ... {if ($feature.name !='Tamaño de rueda')} <td>{$feature.name|escape:'html':'UTF-8'}</td> <td>{$feature.value|escape:'html':'UTF-8'}</td> {/if} How I can fix it? Link to comment Share on other sites More sharing options...
amirl Posted July 10, 2014 Share Posted July 10, 2014 (edited) my site when products have normal price, features products is true for example features products data sheet is cpu : 1.8 ram : 1 gig but when products have specific price for example 15 % offer, all off features products item duplicate cpu : 1.8 cpu : 1.8 ram : 1 gig ram : 1 gig please help how fix this problem Edited July 11, 2014 by amirl (see edit history) Link to comment Share on other sites More sharing options...
Simple Kiwi Posted February 25, 2016 Share Posted February 25, 2016 For 1.6 you can hide the features tab by opening Product.TPL and commenting out the "{if islet($features) && $features}" section (line 468 for me). Should look like this if you'd like to copy and paste my code. <!-- {if isset($features) && $features} <!-- Data sheet <section class="page-product-box"> <h3 class="page-product-heading">{l s='Data sheet'}</h3> <table class="table-data-sheet"> {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} </table> </section> <!--end Data sheet {/if} --> Link to comment Share on other sites More sharing options...
امیر Posted April 27, 2017 Share Posted April 27, 2017 plz help i need display feautre in other page by id example : display id feautre 12/25/14/36 by value Link to comment Share on other sites More sharing options...
امیر Posted May 11, 2017 Share Posted May 11, 2017 plz answer me Link to comment Share on other sites More sharing options...
c.cristinziano Posted August 5, 2017 Share Posted August 5, 2017 (edited) Hi, I'm using the 1.6.1.5 prestashop version and I already tried to remove this code from /themes/default-bootstrap/product.tpl: {if isset($features) && $features} <!-- Data sheet --> <section class="page-product-box"> <h3 class="page-product-heading">{l s='Data sheet'}</h3> <table class="table-data-sheet"> {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} </table> </section> <!--end Data sheet --> {/if} But the data sheet hasn't been removed from my product page... Could somebody help me?? thanks a lot Edited August 9, 2017 by c.cristinziano (see edit history) Link to comment Share on other sites More sharing options...
MouradEBrand Posted November 8, 2021 Share Posted November 8, 2021 Try put code between bracket {* ..... *} so you can figure wich one remove it 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