Jump to content

Get all features from a product


Recommended Posts

Hi.

 

I'm trying to get all features for a product inside shopping-cart-product-line.tpl.

 

I have following code:

 

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

 

I have two features for a given product and the loop is iterated two times. So the code seems to be correct, but all that is displayed is ::.

 

$feature.name and $feature.value seem to be empty. Does anybody has an idea why this code does not show the correct feature name and values?

Link to comment
Share on other sites

I figured out that in Prestashop 1.5.3 the features are language dependent and you can not access the value direct via $feature.name.

 

If I do a debug print of my above code I get following output:

Array ( [0] => Array (
[id_feature] => 7
[id_product] => 8
[id_feature_value] => 28 )

 

Can please anybody tell me how to get the actual value from the table feature_value_lang for the given id_feature_value and the actual language?

Edited by Rahvin (see edit history)
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...