Page 1 of 1

Opencart 1.5.6.4 - total number active items/product on home page store

Posted: Sun Mar 26, 2017 12:23 pm
by smiesek
How to get the number of total number of active items for sale on the home page store? No administration page.

using xml existension?

Code: Select all

<div>
<?php
  $query = $this->db->query("SELECT status FROM " . DB_PREFIX . "product WHERE status='1' ");
  $products_count = $query->rows ? count($query->rows) : 0;
  echo "Total products in store: " . $products_count;
?>
</div>

Code: Select all

<div>
   echo "Total products in store: " . $products_count;
</div>
thanks your help.