Jump to content

How to add a block showing the products of a given category?


Recommended Posts

Hi all,

I'd like to insert in my site a block that shows the products of a given category.

 

A sort of category carousel that I shoud be able to include in all page: product page, category page, static page and so on.

 

What's the best way to do this accord to you?

 

claudio

Edited by ilclaudio (see edit history)
Link to comment
Share on other sites

You can use the following code to fetch products of any category:




$cat_id = 5; //cany cateogry ID as per your requirement
$cat_obj = new Category($cat_id);
$all_products = $cat_obj->getProducts($id_lang, $p, $n); //$p and $n are page number and number of products respectively


 

Now you can use the $all_products array to show products as per the design you want on the front end.
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...