Jump to content

Display features products in module homefeatured


Nazo

Recommended Posts

Hello everybody,

 

I customize my prestashop (v 1.4) and I have a problem that unfortunately I can not solve alone. So I ask your for help.

 

I'm trying customize the homefeaturedproducts module. The idea is to replace the "short description" by product features. Here the code to modify :

 

<a href="{$product.link}" title="{l s='More' mod='homefeatured'}">{$product.description_short|strip_tags|truncate:130:'...'}</a>

 

I am researching. To display product features, I think I must use the variable $features. I also saw that some recommend to look in product.tpl file to inspire. Including:

 

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

 

My problem is that I try to combine in every sense but it doesn't work. I think it does not work because my feature variable is not defined in the phpfile of the homefeaturedproducts module. It's hard for me because I don't know the Smarty language but logically, I must be able to find a module where variable is defined. In which case I would make a copy and paste in the file php. The logic seems to be good isn't it?

 

Does someone know a module where feature variable is defined? (It saves me to search in all). After that, I do not know if it was a false statement or if this is true for version 1.4 but I read on a forum that the feature variable (not only) would be defined globally in prestashop and finally it would be accessible anywhere. Does it speak to you? In any case, if it's true, then I do not understand why it does not work ...

 

Thank you in advance for your help.

 

Regards

 

Ps : excuse me for my bad english

Link to comment
Share on other sites

  • 1 year later...

Hello everybody,

 

I customize my prestashop (v 1.4) and I have a problem that unfortunately I can not solve alone. So I ask your for help.

 

I'm trying customize the homefeaturedproducts module. The idea is to replace the "short description" by product features. Here the code to modify :

 

<a href="{$product.link}" title="{l s='More' mod='homefeatured'}">{$product.description_short|strip_tags|truncate:130:'...'}</a>

 

I am researching. To display product features, I think I must use the variable $features. I also saw that some recommend to look in product.tpl file to inspire. Including:

 

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

 

My problem is that I try to combine in every sense but it doesn't work. I think it does not work because my feature variable is not defined in the phpfile of the homefeaturedproducts module. It's hard for me because I don't know the Smarty language but logically, I must be able to find a module where variable is defined. In which case I would make a copy and paste in the file php. The logic seems to be good isn't it?

 

Does someone know a module where feature variable is defined? (It saves me to search in all). After that, I do not know if it was a false statement or if this is true for version 1.4 but I read on a forum that the feature variable (not only) would be defined globally in prestashop and finally it would be accessible anywhere. Does it speak to you? In any case, if it's true, then I do not understand why it does not work ...

 

Thank you in advance for your help.

 

Regards

 

Ps : excuse me for my bad english

 

I have the same issue! Did you solve this? :)

Link to comment
Share on other sites

  • 4 months 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...