Display number of downloads

  • Posts: 114
  • Thank you received: 14
11 years 1 month ago #129400

How can I get the number of downloads for each file within "product / show_block_product_files".

I would like to add it next to each file from within the "foreach ($this->element->files as $file) {" loop

I notice that the number of downloads is stored within #__hikashop_download table and does not seem to be available via the class properties. Are there any methods available to give me the number of downloads

TIA

/DM

Please Log in or Create an account to join the conversation.

  • Posts: 114
  • Thank you received: 14
11 years 1 month ago #129403

NM. I've done it the old fashioned way.

$query = "SELECT `download_number` FROM `#__hikashop_download` WHERE `file_id` = '" . $file->file_id . "'";    
$db->setQuery($query);
$downloads = $db->loadResult();  

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum