Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

display the number of products sold


hotcomputers

Recommended Posts

in your catalog\product_info.php change:

 

from this:

	$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 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 . "'");

 

to this:

	$product_info_query = tep_db_query("select p.products_id, p.products_ordered, 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 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 . "'");

 

and then to display it (depends where) on the same file right before this code:

 

	  <tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  </tr>
  <tr>
	<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
	  <tr class="infoBoxContents">
		<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
			<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
			<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
  </tr>

 

add this

	  <tr>
	<td><?php echo 'This product was ordered' .  product_info['products_ordered'] . ' times; ?></td>
  </tr>

Link to comment
Share on other sites

thank you very much.

 

i have done the changes but i have the folowing error

Parse error: syntax error, unexpected '[', expecting ',' or ';' in /home/logomon/public_html/product_info.php on line 252

 

 

What should i do?

Thanks in advance

Link to comment
Share on other sites

thank you very much.

 

i have done the changes but i have the folowing error

Parse error: syntax error, unexpected '[', expecting ',' or ';' in /home/logomon/public_html/product_info.php on line 252

What should i do?

Thanks in advance

 

the last part had a mistake use this instead

 

	  <tr>
	<td><?php echo 'This product was ordered' .  $product_info['products_ordered'] . ' times; ?></td>
  </tr>

Link to comment
Share on other sites

which part doesn't work? You should see an extra line at the end on the product_info.php page and should show this string:

 

'This product was ordered' .............

 

do you see that at your store?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...