vezek Posted September 10, 2012 Share Posted September 10, 2012 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 More sharing options...
CartExpert.net Posted September 13, 2012 Share Posted September 13, 2012 Hi. {foreach from=$features item=feature} {if $feature.id_feature != [iD_OF_FEATURE]} <tr> <th>{$feature.name|escape:'htmlall':'UTF-8'} :</th> <td>{$feature.value|escape:'htmlall':'UTF-8'}</td> </tr> {/if} {/foreach} This should work. Regards. Robin. The CartExpert Team Link to comment Share on other sites More sharing options...
mimo81 Posted June 5, 2013 Share Posted June 5, 2013 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 More sharing options...
vekia Posted June 5, 2013 Share Posted June 5, 2013 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 More sharing options...
mimo81 Posted June 5, 2013 Share Posted June 5, 2013 I want to display only one feature (in PS 1.4.8.2). I got to hide it in a PS 1.5.3 time ago, but I think the code is not the same. 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