Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Displaying backend information on the front end...


NiceGuyEd

Recommended Posts

Posted

Hi all,

 

I can't seem to figure out how I can display backend information on the front end of my site.

 

My shop sells only downloadable media. What I'd like to do is at the bottom of each product page, display the number of 'page views' and number of 'downloads' that given product has received. I need it to display right above the "This product was added to our catalog on....."

 

Thanks for any help! :)

Ed

Posted

In catalog/product_info.php change the query around line 72 to

 

// added pd.products_viewed, p.products_ordered - Tom
$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, pd.products_viewed, p.products_ordered from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

then around 169 add the following code just above the lines

 

<?php

$reviews_query = tep_db_query("selec...........

 

add

 

 

<?php // added following row to display number of times viewed and ordered/downloaded - Tom ?>
<tr>
<td class="main" align="center"><?php echo "Viewed " . $product_info['products_viewed'] . " times and ordered/downloaded " . $product_info['products_ordered'] . " times."; ?></td>
</tr>

 

This should do the trick for you.

 

Tom

Archived

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

×
×
  • Create New...