Jump to content

[SOLVED] product’s features


Recommended Posts

Is it possible create product’s features any like this?


I have copied this code from product.tpl and paste to product-list.tpl. But it is wrong.
thx

>    {if $features}
       <!-- product's features -->
</pre>
<ul>
       {foreach from=$features item=feature}
{$feature.name|escape:'htmlall':'UTF-8'} {$feature.value|escape:'htmlall':'UTF-8}
       {/foreach}
</ul>
<br>  



Solution:

  {foreach from=$product.features item=feature name=features}         
{$feature.name|escape:'htmlall':'UTF-8'}: {$feature.value|escape:'htmlall':'UTF-8'}

                      {/foreach}   

13937_sWpeqgwgS2JD82ZJqDMb_t

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 2 months later...

Hi Darren,

I was having the same problem but I customized the thread above.

You will have to make some change to the product-list.tpl file

My Shop sells DVDs and Blu-rays, so I wanted to show only two features Release Date and Studio

Here is the code I used :

{foreach from=$product.features item=feature name=features}         
        {if $feature.name == 'Release Date'}
{$feature.name|escape:'htmlall':'UTF-8'}: 
             {$feature.value|escape:'htmlall':'UTF-8'}

       {/if}
      {if $feature.name == 'Studio'}
{$feature.name|escape:'htmlall':'UTF-8'}: 
           {$feature.value|escape:'htmlall':'UTF-8'}

      {/if}
      {foreachelse}
Awaiting Release Details...
      {/foreach} 



I hope this help guys,

Thanks for the help tozi ,
Draco

  • Like 2
Link to comment
Share on other sites

  • 8 months later...

Hi,

I know this is an old thread, but I was trying to solve the same issue. Draco's solution worked really well, but I have a newbie code question.

It is possible to display each feature in a desired order ? I don't know why, when updating a product feature, it changes it's order display, and it's a mess when trying to desing expecting items in a fixed known order.

Thanks in advance.

Link to comment
Share on other sites

By the way, this is my code:

>
</pre>
<ul>
       {foreach from=$features item=feature name=features}
       {if $feature.name == 'DO'}
</ul>
<strong>{$feature.name|escape:'htmlall':'UTF-8'|cat:" "}{$feature.value|escape:'html':'UTF-8'}</strong><br><br>       {/if}<br><br>       {if $feature.name == 'Variedad 1'}<br><span>{l s='Variedades: '}</span> br>{$feature.value|escape:'html':'UTF-8'|strip}<br>       {/if}<br>       {if $feature.name == 'Variedad 2'}<br>{$feature.value|escape:'html':'UTF-8'|strip}<br>       {/if}<br>       {if $feature.name == 'Variedad 3'}<br>{$feature.value|escape:'html':'UTF-8'|strip}<br>       {/if}<br>       {if $feature.name == 'Variedad 4'}<br>{$feature.value|escape:'html':'UTF-8'|strip}<br>       {/if}<br>       {if $feature.name == 'Variedad 5'}<br>{$feature.value|escape:'html':'UTF-8'|strip}<br>       {/if}<br><br>       {* feature 14 is grad. If I don't use id, does not work (accents?)*}<br>       {if $feature.id_feature == 14}<br><span>{$feature.name|escape:'html':'UTF-8'|cat:": "}</span>{$feature.value|escape:'htmlall':'UTF-8'}<p></p>
<br>       {/if}<br>       {* feature 8 is note. Without id, does not work (accents? spaces?)*}<br>       {if $feature.id_feature == 8}<br>           {if $feature.value >= 90}<br><img src="%7B%24img_dir%7Dicon_winner.gif" alt="%7B$img_dir%7Dicon_winner.gif" border="0" width="36" height="27"><br>           {/if}<br>       {/if}<br>       {foreachelse}<br>       {/foreach}<br><br



Getting features randomized in order in every feature update :S

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Thanks for your help, I found this useful.
The code I used was:

{foreach from=$product.features item=feature name=features}
{$feature.value|escape:'htmlall':'UTF-8'}{/foreach}


As I have only one feature.

If using multiple features,
this may work:


{capture name=full_product}    
{if $product.features.0.name eq"Discount"}
{$product.features.0.value|trim}
{/if} {/capture}
{$smarty.capture.full_product}

Link to comment
Share on other sites

  • 4 months later...
  • 9 months later...
  • 1 month later...
  • 4 weeks later...
  • 3 months later...
  • 3 months later...
  • 1 year later...

Hi, this is an ages old thread, but if anyone can help please. The features show on the product list page but when changing from grid to list they disappear . When I change back to grid view they do not return. Any ideas?

 

Thanks

 

{SOLVED} see http://nemops.com/features-to-product-list-prestashop-16/#.U0GOAvldWHf

Edited by AZC (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Hi Darren,

 

I was having the same problem but I customized the thread above.

 

You will have to make some change to the product-list.tpl file

 

My Shop sells DVDs and Blu-rays, so I wanted to show only two features Release Date and Studio

 

Here is the code I used :

 

{foreach from=$product.features item=feature name=features}                  {if $feature.name == 'Release Date'}         <b style="color: blue; font-weight: 600;">{$feature.name|escape:'htmlall':'UTF-8'}</b>:               {$feature.value|escape:'htmlall':'UTF-8'}
           {/if}       {if $feature.name == 'Studio'}       <b style="color: blue; font-weight: 600;">{$feature.name|escape:'htmlall':'UTF-8'}</b>:             {$feature.value|escape:'htmlall':'UTF-8'}
          {/if}       {foreachelse}       <b>Awaiting Release Details...</b>       {/foreach}

I hope this help guys,

 

Thanks for the help tozi ,

Draco

 

Thank you sooo much!

Link to comment
Share on other sites

  • 5 months later...

I want to do something similar but to show features in columns with headers. Preferably in a second version of list view. Has anyone ever seen a theme that looks anything like the image I've attached? 

 

In the example attached the products are screws with some features like diameter that should be shown to the customer. 

post-327265-0-41597500-1416490186_thumb.png

Link to comment
Share on other sites

  • 4 years later...

Hi there Is there a way to call the feature of level two by id ? when I used for example

{if $feature.id_feature == '24'} -> it's working

{if $feature.id_feature == '123'} -> it's not working

(this two have the same $product->id_category_default)

And do you know how to remove a feature_id list of product ? I'm new to this language so I don't have the grammar :)

For example {if $product->id_category_default && [exclude ??] $feature.id_feature == '24'} ??

Thanks a lot,

Clément

Link to comment
Share on other sites

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