Product Check On Status Disabled Or Active

Hi guys,

For a client we made a small adjustment in CS-Cart. We show in the subcategories overview the number of products from the category. See our code:


Unfortunately now he shows the number of all products in the category. We also have products that are disabled. Is there a simple check for this?

Many Thanks!

Please provide us with the code of the fn_get_category_product_count function

Sorry for my late response. This is the function:

function fn_get_category_product_count($category_id)
{
    $count = db_get_field('select count(product_id) from ?:products_categories p inner join ?:categories c on p.category_id = c.category_id where c.id_path like ?s', '%' . $category_id . '%');

You should join ?:products table and add condition ?:products.status = 'A'