PrabuSS Posted May 27, 2017 Share Posted May 27, 2017 (edited) Hi I would like to display the features value in product detail page is not empty. So I've tried like this {foreach from=$features item=feature} {if $feature.id_feature == 16} {if !empty($feature.value)} <span> + </span>{$feature.value|escape:'html':'UTF-8'} {/if} {/if} {/foreach} But my Output : + It seems !empty() function is not working in feature value. Please help any one. Edited May 27, 2017 by PrabuSS (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted May 27, 2017 Share Posted May 27, 2017 Hi I would like to display the features value in product detail page is not empty. So I've tried like this {foreach from=$features item=feature} {if $feature.id_feature == 16} {if !empty($feature.value)} <span> + </span>{$feature.value|escape:'html':'UTF-8'} {/if} {/if} {/foreach} But my Output : + It seems !empty() function is not working in feature value. Please help any one. Try != '' Link to comment Share on other sites More sharing options...
PrabuSS Posted May 27, 2017 Author Share Posted May 27, 2017 (edited) Try != '' Thanks for your reply.. As per your suggestion I've tried like this. But this is also not working..Still cant find correct syntax to done this. {foreach from=$features item=feature} {if $feature.id_feature == 16} {if $feature.value != ''} <span> + </span>{$feature.value|escape:'html':'UTF-8'} {/if} {/if} {/foreach} Edited May 27, 2017 by PrabuSS (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted May 27, 2017 Share Posted May 27, 2017 Thanks for your reply.. As per your suggestion I've tried like this. But this is also not working..Still cant find correct syntax to done this. {foreach from=$features item=feature} {if $feature.id_feature == 16} {if $feature.value != ''} <span> + </span>{$feature.value|escape:'html':'UTF-8'} {/if} {/if} {/foreach} Try {$feature|@var_dump} to see its content, maybe is not empty. Link to comment Share on other sites More sharing options...
PrabuSS Posted May 27, 2017 Author Share Posted May 27, 2017 (edited) Try {$feature|@var_dump} to see its content, maybe is not empty. Hi How can i use this {$feature|@var_dump} in my code..And I'm able to see the feature value at BO it self. please make it clear.. Edited May 27, 2017 by PrabuSS (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted May 29, 2017 Share Posted May 29, 2017 Hi How can i use this {$feature|@var_dump} in my code..And I'm able to see the feature value at BO it self. please make it clear.. Put it before your if condition: {foreach from=$features item=feature} {if $feature.id_feature == 16} {$feature|@var_dump} {if $feature.value != ''} <span> + </span>{$feature.value|escape:'html':'UTF-8'} {/if} {/if} {/foreach} 1 Link to comment Share on other sites More sharing options...
PrabuSS Posted May 29, 2017 Author Share Posted May 29, 2017 (edited) Put it before your if condition: {foreach from=$features item=feature} {if $feature.id_feature == 16} {$feature|@var_dump} {if $feature.value != ''} <span> + </span>{$feature.value|escape:'html':'UTF-8'} {/if} {/if} {/foreach} Hi Thanks for your reply. I've used {$feature|@var_dump} like as above. I'm getting following output array(3) { ["name"]=> string(6) "P2_col" ["value"]=> string(1) " " ["id_feature"]=> string(2) "16" } Edited May 29, 2017 by PrabuSS (see edit history) Link to comment Share on other sites More sharing options...
PrabuSS Posted May 29, 2017 Author Share Posted May 29, 2017 (edited) Put it before your if condition: {foreach from=$features item=feature} {if $feature.id_feature == 16} {$feature|@var_dump} {if $feature.value != ''} <span> + </span>{$feature.value|escape:'html':'UTF-8'} {/if} {/if} {/foreach} Yessssss. Finally I've used following code to achieve this. Credit goes to you only my great friend . PS forum is in still active because of person like you {foreach from=$features item=feature} {if $feature.id_feature == 16} {if $feature.value != " "} <span> + </span>{$feature.value|escape:'html':'UTF-8'} {/if} {/if} {/foreach} So In PS 1.6 this is the condition to restrict empty feature value in product detail page {if $feature.value != " "}. Hope its helpful for some one. Edited May 29, 2017 by PrabuSS (see edit history) 1 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