Jump to content

[SOLVED]Display a single feature value in theme


Cosmi

Recommended Posts

Hello folks,

I'm developing a new theme for Prestashop and I want to customize it a little bit more.
So, what I'm trying to do is to display a specific feature value in the product page

For example:
I have this list of feature/values on my product:
Type: Car
Make: Audi
Model: A4


And in my page I want to display this:

Page title
Audi
Type: Car
Make: Audi
Model: A4

As you can see, I need to display the value of the feature "Make" in a .

How can I display just a single feature value in the product page (not all features)?

Thank you!
Cosmi

Link to comment
Share on other sites

Add code like the following to product.tpl in your theme's directory to add a span with the value of the "Make" feature:

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

Link to comment
Share on other sites

  • 1 year later...

Its useful when we have one value of the feature.

 

Please tell what should i do when one feature have multiple values in drop down and I want to display one of them which is selected.

 

Like---

 

I have different painting technics and I have a feature "technics" and it have almsot 8 technics. When I enter a new product then I selected one technic from the features. So now I want to display that selected technic in product page.

 

Please help me.

Link to comment
Share on other sites

  • 3 weeks later...

Brilliant Rocky, exactly what I was after! Expanding on this idea a bit I have a quick question if you wouldn't mind. Is there a way I am able to remove/exclude a specific feature from a list?

 

The goal is to move a field named "Artist" from the products features list and up beside the product title.

 

Please let me know if you'd like to see exactly what I mean please let me know and I'll PM you a link.

 

First post! Booyah!

  • Like 1
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...