Jump to content

Slider: products dependent on Category page ID?

Mike Goodstadt

Recommended Posts

Hi all,

I am coding a slider block of products which can be placed in the header of any category page.

The slider must only show the products of the relevant page (navigated to from the menu) eg:


How can I get the category ID of each category page to feed into the following?

   	 $currentproducts = $category->getProducts($idLang, 0,0, 'id_product', 'ASC', [iNSERT CATEGORY ID HERE], true);

This $products gets used in the following to make a list in the .tpl template which the slide JS can manipulate.

   	 $products = $this->getImages($currentproducts, $params);

Can anyone help me with this?

Many thanks,


Link to comment
Share on other sites

Ok - no one ever seems to answer on these forums...

My own solution is :

   	 $currentcategory = (int)Tools::getValue('id_category');
       $currentproducts = Product::getProducts($idLang, 0,0, 'id_product', 'ASC', $currentcategory, true);
       $products = $this->getImages($currentproducts, $params);

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