Jump to content

category tree with products


Recommended Posts

I would have thought this would be a very common module that is relatively easy to build. I dont really know enough about prestashop yet and am looking for direction. The whole smarty thing is a little over my head currently but this is something I have done with oscommerce in the past.

Basically I need the following categories block:

Parent Cat 1
---- product 2
---- product 3
---- product 4
---- product 5
Parent Cat 2
---- product 6
---- product 7
---- product 8
Parent Cat 3
---- product 9
---- product 10


There are not many products in my cart so to list the main cats with the products on the left side will be helpful for the visitors by leaving the products within one click from anywhere on the site where the categories block exists.

Can anyone give me direction on how to query the db for products after the category ID is gotten and then display them by name?

I have tried to pull bits and pieces out from the category php page but I seem to be getting no where.

p.s. a little sad to see the lack of free modules. anyone who publishes even the most simple modules seems to be looking for make money off of it - which is all fine but this is an open source project.. adding to it will only help it grow

Link to comment
Share on other sites

Can anyone give me direction on how to query the db for products after the category ID is gotten and then display them by name?


You can calling following static function getProducts() of Product class to get the product list from a category.

here is detailed function signature

public static function getProducts($id_lang, $start, $limit, $orderBy, $orderWay, $id_category = false, $only_active = false)

Link to comment
Share on other sites

×
×
  • Create New...