Jump to content

Multistore all featured products on home page


Recommended Posts

Hi all,

 

I've got some serious problem which doesn't allow me to put my multistore based Prestashop instance to production mode and start selling.

 

I enabled multistore mode in Prestashop 1.6 and have "Featured products on homepage" module installed. But every shop has the same products on homepage because there is no option which would allow to select a category for each shop separately.

 

Did anyone of you guys find any solution to this?

 

Thank you!

Link to comment
Share on other sites

  • 4 weeks later...
  • 3 weeks later...

Hi all,

 

I've got some serious problem which doesn't allow me to put my multistore based Prestashop instance to production mode and start selling.

 

I enabled multistore mode in Prestashop 1.6 and have "Featured products on homepage" module installed. But every shop has the same products on homepage because there is no option which would allow to select a category for each shop separately.

 

Did anyone of you guys find any solution to this?

 

Thank you!

 

So I fixed it by changing few lines in modules/homefeatured/homefeatured.php file. In each shop it will show only products from a category which you specify in the switch statement below.

 

Change these lines:

if (!isset(HomeFeatured::$cache_products))
{
	$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);
	$nb = (int)Configuration::get('HOME_FEATURED_NBR');
	HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position');
}

to these:

if (!isset(HomeFeatured::$cache_products))
{
	switch (Context::getContext()->shop->id) {
		case 1: $categoryId = 5; break;
		case 2: $categoryId = 97; break;
		case 3: $categoryId = 14; break;
		default: $categoryId = Context::getContext()->shop->getCategory(); break;
	}

	$category = new Category($categoryId, (int)Context::getContext()->language->id);
	$nb = (int)Configuration::get('HOME_FEATURED_NBR');
	HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position');
}

where 1, 2, 3 numbers are your shop ids (you can find them in your prestashop's database under the table called 'shop' in column 'id_shop'). Also don't forget to assign right category ids ;)

 

Be aware that this is just quick but dirty solution...

Link to comment
Share on other sites

  • 2 weeks later...

Fixed it by using changing in the global.css file in the theme directory.

 

#center_column {

  padding-bottom: 30px;
 
  background:#232323;
 

 

However now the "center_column sticks out alittle bit from the minicslider as you can see on attached picture. Tried a few stuff but didnt get it to work

post-719371-0-12086900-1414241516_thumb.jpg

Link to comment
Share on other sites

Fixed it by using changing in the global.css file in the theme directory.

 

#center_column {

 

  padding-bottom: 30px;

 

  background:#232323;

 

 

However now the "center_column sticks out alittle bit from the minicslider as you can see on attached picture. Tried a few stuff but didnt get it to work

 

how is this related to the topic of this thread?

Link to comment
Share on other sites

×
×
  • Create New...