Jump to content

Help How to display all feature exept only one on product.tpl


Patrick Proot

Recommended Posts

Hi

 

Newbie question :/

 

I need to display in list all the feature of the product except one feature id = 2  feature.name = "DC"

 

I can display all the feature but can't insert the right condition to exclude only the id 2 from my request.

 

{if isset($features) && $features}
{foreach from=$features item=feature}
{if isset($feature.value)}
<STRONG>{$feature.name|escape:'html':'UTF-8'} :</STRONG> {$feature.value|escape:'html':'UTF-8'}<BR>
{/if}
{/foreach}
{/if}
 
Any help will be very appreciate.
 
TIA
 
Patrick
Link to comment
Share on other sites

Try this code:

 

{if isset($features) && $features}
{foreach from=$features item=feature}
{if $feature.id_feature != 2}
{if isset($feature.value)}
<STRONG>{$feature.name|escape:'html':'UTF-8'} :</STRONG> {$feature.value|escape:'html':'UTF-8'}<BR>
{/if}
{/if}
{/foreach}
{/if}
  • Like 1
Link to comment
Share on other sites

  • 9 months later...

Try this code:

 

{if isset($features) && $features}
{foreach from=$features item=feature}
{if $feature.id_feature != 2}
{if isset($feature.value)}
<STRONG>{$feature.name|escape:'html':'UTF-8'} :</STRONG> {$feature.value|escape:'html':'UTF-8'}<BR>
{/if}
{/if}
{/foreach}
{/if}

 

Awsome :)

 

I figured out that I can use this code to show specific feature as well!
I have to change ! symbol to =
that's it :) Done
Link to comment
Share on other sites

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...