Jump to content

Tutorial found: how to display features in product list (let us develope it!)


Recommended Posts

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

'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

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}
  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

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