You are here:  » Total Products Number


Total Products Number

Submitted by JasonG on Wed, 2013-02-13 10:47 in

Hi David

I am trying to establish how many products I have "live" on the website. In the admin area it shows "Total Products 33734"

Howevere I believe that is the total products from the feeds I have imported, we then remove a large % of products that are not relevant to what w do, i.e. Cat Food as we are a dog website, we do this via global filters

Is there a way to know how many products we have that are live on the site i.e. not removed using global filters?

Thanks
Stuart

Submitted by support on Wed, 2013-02-13 11:40

Hi Stuart,

The total displayed in /admin/ is the grand total of products per feed, so this _doesn't_ take into account comparison. It does however only reflect total product imported (per feed) after filters have been applied.

To see the total number of unique products on your site, simply do a query for bw: and the total results displayed will be the total number of unique products! bw: is the "begins with" search operator, and by leaving the part after the : empty results in matching all products on your site...

Cheers,
David.
--
PriceTapestry.com

Submitted by johnbanny on Sat, 2013-06-08 14:35

Hi David,

I would like to display the total number of unique products in admin, under where it says total products. So, something like:

Total Unique | xxx

How would you do this?

Thanks

Submitted by support on Sat, 2013-06-08 15:01

Hi John,

I know you've been a user for some time so for 12/10B, look for the following code at line 240 of admin/index.php:

  print "</table>";

...and REPLACE with:

  $sql = "SELECT COUNT(DISTINCT(name)) AS totalUnique FROM `".$config_databaseTablePrefix."products`";
  database_querySelect($sql,$rows);
  print "<tr><th align='left'>Total Uniuqe</th><td align='right'>".$rows[0]["totalUnique"]."</td></tr>";
  print "</table>";

Or for 13/03A, look for the following code at line 230:

  admin_tableEnd();

...and REPLACE with:

  $sql = "SELECT COUNT(DISTINCT(name)) AS totalUnique FROM `".$config_databaseTablePrefix."products`";
  database_querySelect($sql,$rows);
  admin_tableRow("Total Unique",$rows[0]["totalUnique"],"num");
  admin_tableEnd();

Cheers,
David.
--
PriceTapestry.com

Submitted by johnbanny on Sat, 2013-06-08 21:23

Great, thanks for that. So dam close, i nearly had it.

Submitted by stevebi on Fri, 2015-04-24 09:46

Hi David,

I have added the above code.
May I ask if it is possible to apply cache since now the admin page takes some time to load?

Cheers

S

Submitted by support on Fri, 2015-04-24 10:23

Hi Steve,

Sure - I know you've applied the SQL cache mod to includes/database.php so with that in place, where you have the following code in the modification described above:

   database_querySelect($sql,$rows);

...REPLACE with:

   database_querySelectCached($sql,$rows);

Cheers,
David.
--
PriceTapestry.com

Submitted by stevebi on Fri, 2015-04-24 11:11

Thank you very much David!!!