Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding a product & customer counter to my footer


jasonaudio

Recommended Posts

Posted

As the title says, I want to add the registered customers & products in the database to the footer of my website.

 

This is the info I want to add to the footer (which is originally from the admin index):

 

Statistics 

Customers: 194

Products: 630

 

 

I have been messing with it a little bit and this is the code I have added to my footer, but I can't get the counters/numbers to show up correctly.

 

<?php echo

 

      $customers_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS);

  $customers = tep_db_fetch_array($customers_query);

  $products_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS);

      $products = tep_db_fetch_array($products_query);

 

 

      $contents[] = array('params' => 'class="infoBox"',

                      'text'  => $customers['count'] . '<br>' .

                                $products['count']) ;?>

 

Any help or ideas from anyone. I just want to show the # of registered customers & the # of products available. I appreciate your help ;)

Posted

here is a very crude method

<?php
$customers_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS);
 $customers = tep_db_fetch_array($customers_query);
 $products_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '1'");
 $products = tep_db_fetch_array($products_query);
echo CUSTOMERS . ' ' . $customers['count'] . '<br>' . PRODUCTS . ' ' . $products['count'] . '<br>';
?>

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted

you may want to put some window dressing around the code and alter the <br> breaks to suit, depending on where you are placing the code also you may want to put some style to the text and or change the textual wording at present it is all uppercase with CUSTOMERS and PRODUCTS

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted

OK do you really want the x :lol:

<?php
$customers_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS);
 $customers = tep_db_fetch_array($customers_query);
 $products_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS . " where products_status = '1'");
 $products = tep_db_fetch_array($products_query);
echo $customers['count'] . ' ' . CUSTOMERS . '<br>' . $products['count'] . ' ' . PRODUCTS . '<br>';
?>

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted

Thank you SOOO much! That's exactly what I was looking for. I knew I was close too, but I just couldn't get it exact

 

Thanks again ;)

Posted

agiftcodotcom

 

the x's are hidden :blink:

 

glad I could help, however as I say you may want to put your own style etc on the text

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Archived

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

×
×
  • Create New...