Jump to content

Smarty - Only display certain features


vezek

Recommended Posts

Hi

 

I am sure it must very simple but I cannot manage to make it work, I have this table:

 

{if $features}
 <table >
	  <col/>
	  <col />
	  <tbody>
	  {foreach from=$features item=feature}
		  <tr>
			  <th>{$feature.name|escape:'htmlall':'UTF-8'} :</th>
			  <td>{$feature.value|escape:'htmlall':'UTF-8'}</td>
		  </tr>
	  {/foreach}
	  </tbody>
  </table>
  {/if}

 

This loops through all the features but I would like to remove only one feature from the loop. I know the feature's ID but I do not know how to integrate it the code above.

 

Many thanks.

Link to comment
Share on other sites

  • 8 months later...

Hi, how can I make this for PS 1.4.8.2 ?

 

I used this, but not:

 

{if isset($product.features)}

{foreach from=$product.features item=feature name=features}

{if $feature.id_feature == 1}

<span>{$feature.name|escape:'htmlall':'UTF-8'}: {$feature.value|escape:'htmlall':'UTF-8'}</span>

{/if}

{/foreach}

{/if}

Link to comment
Share on other sites

Hi, how can I make this for PS 1.4.8.2 ?

 

I used this, but not:

 

{if isset($product.features)}

{foreach from=$product.features item=feature name=features}

{if $feature.id_feature == 1}

<span>{$feature.name|escape:'htmlall':'UTF-8'}: {$feature.value|escape:'htmlall':'UTF-8'}</span>

{/if}

{/foreach}

{/if}

 

but you want to display only one feature or hide it?

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