Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

--> Display download rate <--


Guest

Recommended Posts

Hi all. :lol:

 

My shop is offline coz im currently building it.

 

Ive the download options: when a person purchase a product, they can download it after. Then how can i display on my shop how many time the product was downloaded? :huh:

 

Example: Number of download: 4

 

TY! :P

Link to comment
Share on other sites

there is a table in the dbase called products_attributes_download. In there there the products_attributes_maxcount field holds the max number of d/ls for each order. The actual count is stored in the orders_products_download table, download_count field.

 

So now you could add all your past successful orders for the same product and display it in the product_info.php.

Link to comment
Share on other sites

there is a table in the dbase called products_attributes_download. In there there the products_attributes_maxcount field holds the max number of d/ls for each order. The actual count is stored in the orders_products_download table, download_count field.

 

So now you could add all your past successful orders for the same product and display it in the product_info.php.

 

Ok ill check this. Can i message you if ive other question?

Link to comment
Share on other sites

Ok yes i saw this when i was browsing my DATABASE but the problem is:

 

When a person buy a product, the download_count is set to 1 coz they r 1 download remaining. When he click on the download button, the field change to 0.

So.. its not the goos way for me.. :'(

 

What can i do..

Link to comment
Share on other sites

yes because if you look the catalog\download.php there is this:

// Now decrement counter
 tep_db_query("update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_count = download_count-1 where orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "'");

 

so you get the max downloads and subtract the download_count and there is the number of d/l for one order. You repeat it for each order for the same product and you have the total you want.

Link to comment
Share on other sites

yes because if you look the catalog\download.php there is this:

// Now decrement counter
?tep_db_query("update " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " set download_count = download_count-1 where orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "'");

 

so you get the max downloads and subtract the download_count and there is the number of d/l for one order. You repeat it for each order for the same product and you have the total you want.

 

Ok yeah i understand. But.. i can't call any table variable.. so i must make my one code line. Do u have an idea about the code? :thumbsup:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...