Jump to content

Finding products in specific category


tigtig22

Recommended Posts

Hi all,

 

I am making some modifications in the way that customers explore products in my shop. Is there a function that works similar to the getProducts() function but gets products from a defined category using a category ID (rather than the current category) ?

 

I would like to use the output of the function on the category.php page.

 

Thanks for any help you can offer.

 

Paul T

  • Like 1
Link to comment
Share on other sites

Hello!

This is the function's head:

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

 

id_lang - this is stored is a cookie

start - the index of the element in the result list

limit - number of elements

orderBy - criteria to be ordered by

orderWay - can be 'ASC' for ascending or 'DESC' for descending

id_category - this is where you set the category id

only_active - by default is false, so it will return all products

 

To use the function:

$product_list = Product::getProducts($cookie->id_lang, 0,0, 'id_product', 'ASC', [PUT_HERE_CATEGORY_ID], true);

  • Like 2
Link to comment
Share on other sites

  • 1 year later...

Hi, i have to customize the category products which shows on the page after clicking on a category.can you tell me which function i have to customize for this purpose.??

i have searched on google and found that Category::getProducts() is used to get category products. i am making changes in this function but changes are not taking place.

Can you guide me how i can customize category products.???

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