Only run product count queries if enabled

Provides significant speed boost on large stores