Jump to content

Blocklayered on homepage


ggyyvv

Recommended Posts

Hi ggy,

 

The blocklayered is coupled to the product-list (category-list). You don't have this list on your home page (You have a few modules, like Featured Products, New Products, Bestsellers maybe). To make these filters on these modules is a lot of work.

 

Maybe easier is to make a specific category list as your home page. This new homepage might then be able to use layered filters.

 

 

Can't fully recall where I've seen some module that does this.Maybe Vekia's shop has some (free???) module to do this, or otherwise Nemo may have some tutorial how to do this. I can't remember....

 

Maybe google a little and see what you come up with. Let us know!

 

pascal.

Link to comment
Share on other sites

thanks for replying.

 

I use advice from here https://www.prestashop.com/forums/topic/213127-module-blocklayered-on-the-front-page-ver-1520/

and module by Vekia - Prestashop Featured Products http://mypresta.eu/modules/front-office-features/featured-products.html

 

But only not all products display on homepage. In the module by Vekia i set categorie "1".

Display only products what have in connection with this categorie.

 

How to show all products (not to set in setting of product the home page)?

 

P.S. sorry for my bad english

Link to comment
Share on other sites

To show all products, you could edit file:

 

modules/featuredcategory/featuredcategory.php   (Make backup!!!)

 

go to function:public function _cacheProducts()

 

 

and add the red code:

public function _cacheProducts()
{
  if (!isset(featuredcategory::$cache_products))
  {
    if (Configuration::get('CFEATURED_ID') != 1)
    {
      $category = new Category(Configuration::get('CFEATURED_ID'), (int)Context::getContext()->language->id);
      $nb = (int)Configuration::get('CFEATURED_NBR');
      featuredcategory::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position');
    } else
    {
      $nb = (int)Configuration::get('CFEATURED_NBR');
      $result = Product::getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'id_product', 'ASC', null, true);
      featuredcategory::$cache_products = Product::getProductsProperties((int)Context::getContext()->language->id, $result);
    }
  }
 
  if (featuredcategory::$cache_products === false || empty(featuredcategory::$cache_products))
    return false;
}
 

Then, in the module configuration screen, add 1 as category number. It will then just get all products (limited to the "number of products to be displayed" field, independent of category.

 

N.B. If you add a high number in the "number of products to be displayed" field like 999999 or so, you will indeed get all products. Beware though, that this may take forever to load the page and may even time out. A more reasonable number is maybe more desirable.

 

 

pascal.

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...