Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Total product count


Recommended Posts

Hi all, this is probably really obvious, but how can i show the total amount of products in database?

I'm not sure which query to use to pull this infor from the database.

I wish to put it in the footer bar, opposite the date




Link to comment
Share on other sites

Ok, I think i've nearly got it, but i just got a parse error now.


The code i'm using is:-


function tep_get_products_total($product_id, $language = '') {

global $languages_id;


if (empty($language)) $language = $languages_id;


$product_query = tep_db_query("select COUNT('products_id') from " . TABLE_PRODUCTS_DESCRIPTION . " where products_status = 1;

$product = tep_db_fetch_array($product_query);


return $product['products_total'];



And then i'm trying to display the output with this line....



<?php echo $products_total;?>


Any ideas where the problem is?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...