def product_count(category, args=''):
    args, kwargs = get_filter_args(args, boolargs=('variations'))
    variations = kwargs.get('variations', False)
    try:
        ct = keyedcache.cache_get('product_count', category, variations)
    except keyedcache.NotCachedError:
        if not category:
            ct = Product.objects.active_by_site(variations=variations).count()
        else:
            ct = category.active_products(include_children=True, variations=variations).count()

        keyedcache.cache_set('product_count', category, args, value=ct)
    return ct
Get a count of products for the base object.
dataset/ETHPy150Open dokterbob/satchmo/satchmo/apps/product/templatetags/satchmo_product.py/product_count