Check Number Of Products Under A Category Or Feature

Hi,

From which sql tables can I get number of products for each category or a feature?

How do I map a category_id to category name & then products under it?

I need this info to track a website crash while loading a specific category products. I want to check the size of products (memory) which is needed to be load products for that category.

Thanks & Regards,

Fahad

The fn_get_products function is used to get products on the category and feature pages. It returns search results which contain the total amount of found items. It can be checked in templates with the following code:

{$search.total_items|fn_print_r}

What about database tables?

If I want to check above info from db then which tables should I explore?


let me check code.

Thanks for response ! :)

What about database tables?

If I want to check above info from db then which tables should I explore?


let me check code.

Thanks for response ! :)

It is hard to specify the exact tables since a huge amount of tables is joined to the main sql request depending on the received parameters.

Hi,

From which sql tables can I get number of products for each category or a feature?

How do I map a category_id to category name & then products under it?

I need this info to track a website crash while loading a specific category products. I want to check the size of products (memory) which is needed to be load products for that category.

Thanks & Regards,

Fahad

For categories, something like this:

select
  ccd.category, count(cpc.product_id) as cnt
from
  cscart_products_categories cpc,
  cscart_category_descriptions ccd
where
  cpc.category_id = ccd.category_id
group by
  ccd.category

Feature codes would be similar but uses cscart_product_feature_values which seems to join feature ids with product ids.