Jump to content

[SOLVED] Hide "Features or Data Sheet" in product description


Recommended Posts

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 by Sarak (see edit history)
Link to comment
Share on other sites

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

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

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

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

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

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

@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

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

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

@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

  • 5 months later...
  • 1 year later...

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

 

2dbqg51.jpg

Edited by amirl (see edit history)
Link to comment
Share on other sites

  • 1 year later...

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

  • 1 year later...
  • 2 weeks later...
  • 2 months later...

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 by c.cristinziano (see edit history)
Link to comment
Share on other sites

  • 4 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...