Patrick Proot Posted May 19, 2016 Share Posted May 19, 2016 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 More sharing options...
endriu107 Posted May 19, 2016 Share Posted May 19, 2016 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} 1 Link to comment Share on other sites More sharing options...
Patrick Proot Posted May 19, 2016 Author Share Posted May 19, 2016 Super ! Working fine Thanks a lot for your help Have a nice evening Patrick Link to comment Share on other sites More sharing options...
fazfaz Posted March 7, 2017 Share Posted March 7, 2017 On 5/19/2016 at 3:15 PM, endriu107 said: 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 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