Get Free Audit

Favorite Products Feature for Products on the Home Page in PrestaShop

Apr 28, 2014

1205 Alex Simonchik

Favorite Products Feature for Products on the Home Page in PrestaShop

We continue to help people who are searching for the answers on Prestashop forum. Today we will help ajnglagla who read our article  and had some difficulties with realization of similar functionality for module homefeatured on the main page.

Initial template themes/default/modules/homefeatured/homefeatured.tpl generates the block:

1Favorite Products Feature

To get data from the module favoriteproducts in module homefeatured we will act the same way as we would act in case with controller CategoryController. So we get information about existence of user’s favorite products in method HomeFeatured:: hookDisplayHome():


We also need to edit the template themes/default/modules/homefeatured/homefeatured.tpl. We insert the code in it that we know from the previous article (put it in any place that you think is appropriate. I recommend putting it into li.ajax_block_product div element):

Igor Dragun
Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Igor


Now the template has its data and logics of visualization, but because of fixed width of block on the main page new data doesn’t look good at all. To fix it you need to make changes in the css-file modules/homefeatured/homefeatured.css:


The final result should look like this. But remember that this can be applied only to authorized users.

2Favorite Products Feature

 

favoriteproducts

homefeatured.css

homefeatured.php

homefeatured.tpl

Igor Dragun
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Igor

2 Comments

  1. hi i have problem, cant remove products of the list of favorite product in my account, but inside of the product can, what is the problem

Post a new comment

BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *