Jump to content

Doporučené produkty


tromas
 Share

Recommended Posts

Tak už vyřešeno. V souboru modules/homefeatured/homefeatured.php jsem nahradil funkci public function hookDisplayHome($params) za tento kód:

public function hookDisplayHome($params)
{
   $category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);
   $nb = (int)(Configuration::get('HOME_FEATURED_NBR'));
   $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 10));
   shuffle($products);
   
   $this->smarty->assign(array(
      'products' => $products,
      'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
      'homeSize' => Image::getSize('home_default'),
   ));

   return $this->display(__FILE__, 'homefeatured.tpl');
}

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More