bkan Posted February 20, 2007 Share Posted February 20, 2007 How can I add a products counter and each time a visitor see a product, it counts +1 and all people can see the number of visits? Tnx. Bkan. Link to comment Share on other sites More sharing options...
Velveeta Posted February 20, 2007 Share Posted February 20, 2007 How can I add a products counter and each time a visitor see a product, it counts +1 and all people can see the number of visits? Tnx. Bkan. The value is already there in default oscommerce, this is from product_info.php: tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); All you need to do is move that value up above the $product_info_query that's right above it, so it increments that value first, and then pull that value in addition to all of the others in the $product_info_query, and output it somewhere in the page with an "echo $$product_info['products_viewed']" statement... Richard. Richard Lindsey Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.