Ricky Blunda Posted April 22, 2016 Share Posted April 22, 2016 Hello good people! I found this tutorial on the internet. It seems really neat and easy and lets you display a product features on the product list: http://nemops.com/features-to-product-list-prestashop-16/#.VxnuMkepzOU I would be extremely grateful if you could help me develop this code a bit. The code right now seems to display *all* features of the products, but surely there must be a way of selecting exactly which features you want to display? Can this code be altered in an easy manner to do that? I'm guessing it's this part that needs to be changed somehow: ------------------------------------------------------------------------ {if isset($product.features)} <div class="features"> {foreach from=$product.features item=feature} <div> {$feature.name}: <span>{$feature.value}</span> </div> {/foreach} </div> {/if} ------------------------------------------------------------------------ BR, Ricardo Link to comment Share on other sites More sharing options...
NemoPS Posted April 23, 2016 Share Posted April 23, 2016 Glad you liked my tut You can use an if to check for feature ids{if $feature.id_feature == 12}do something{else if $feature.id_feature == 1}something else{/if} 1 Link to comment Share on other sites More sharing options...
Ricky Blunda Posted April 23, 2016 Author Share Posted April 23, 2016 'ello there Nemo Yes, I liked the tutorial alot. I've been searching for something like this for weeks and months! If I beg really nicely, could you perhaps give an example of what code I should use if I want to display a feature with for instance ID #12? I know some VB and C#, but this is beyond me for some reason. I cannot even grasp it :\ Thanks! Link to comment Share on other sites More sharing options...
Ricky Blunda Posted April 25, 2016 Author Share Posted April 25, 2016 Pretty please with sugar coating on top? I'd be willing to pay a few dollars/pounds/euros for this feature. Link to comment Share on other sites More sharing options...
NemoPS Posted April 25, 2016 Share Posted April 25, 2016 Like this: {foreach from=$product.features item=feature} <div> {if $feature.id_feature == 12} {$feature.name}: <span>{$feature.value}</span> {else if $feature.id_feature == 1} not that one {/if} </div> {/foreach} 2 Link to comment Share on other sites More sharing options...
Ricky Blunda Posted May 4, 2016 Author Share Posted May 4, 2016 I forgot to say thank you, so here it is: Thank you! 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