Jump to content

Adding some features to product.tpl


Recommended Posts

Hello

 

I am currently editing two files: product-list.tpl and product.tpl. I successfully edited the product-list.tpl to replace the produc tdescription by three custom features from my features list. And this with the following code:

 

{foreach from=$product.features item=feature name=features} {if $feature.id_feature eq 9} {$feature.value|escape:'htmlall':'UTF-8'}{/if}{/foreach} | {foreach from=$product.features item=feature name=features} {if $feature.id_feature eq 12} {$feature.value|escape:'htmlall':'UTF-8'}{/if}{/foreach} | {foreach from=$product.features item=feature name=features} {if $feature.id_feature eq 15} {$feature.value|escape:'htmlall':'UTF-8'}{/if}{/foreach}

 

I would like to do the same in product.tpl. So atthe bottom of the page I alreadyhave the list with all features and I would like to put the three custom features above just under the product title instead of the category. So I had the following code:

 

{$category->name|escape:'htmlall':'UTF-8'}

 

and I replaced it with the code I used in product-llist.tpl but it won't work. The half of the page is blank. Could anyone help me please?

 

Thank you

Share this post


Link to post
Share on other sites
  • 2 months later...

Hi,

 

which Version of Prestshop do you use?

I Use 1.5.2 and tried nearly the same but was unable to put the product features to the product list with your code.

But I was able to move the product features in the product.tpl using the following code:

<li>{$features[0]['name']} {$features[9]['value']}</li>
<li>{$features[1]['name']} {$features[12]['value']}</li>
<li>{$features[1]['name']} {$features[15]['value']}</li>

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More