Page 1 of 1

Remaining Downloads Counter doesnt decrease

Posted: Mon Feb 16, 2015 12:02 am
by Huweto
Hello Guys, i have a problem with the total downloads allowed feature. (1.5.6.4)

I offer downloadable products on my page and i want that my customers can download their purchased product max. 10x times.

Well, if the size of the downloadable product is small, a few KB, the counter is working normal and decreases every time when the customer click on the download button..

But i have also downloads which are a few MB or over 100MB, and then the counter does not decrease. I dont know why.
I am not sure if this is a bug or i have wrong settings, but can somebody help me?

Image

Is it possible to create a module for it?

My php.ini settings:

Code: Select all

magic_quotes_gpc = Off;
register_globals = Off;
default_charset = UTF-8;
memory_limit = 64M;
max_execution_time = 36000;
upload_max_filesize = 999M;
safe_mode = Off;
mysql.connect_timeout = 20;
session.use_only_cookies = On;
session.use_trans_sid = Off;
session.cookie_httponly = On;
session.gc_maxlifetime = 172800;
allow_url_fopen = on;
;display_errors = 1;
;error_reporting = E_ALL;

Re: Remaining Downloads Counter doesnt decrease

Posted: Tue Feb 17, 2015 6:52 am
by Huweto
So nobody have a fix or idea?

Re: Remaining Downloads Counter doesnt decrease

Posted: Tue Feb 17, 2015 10:07 pm
by MarketInSG
because in catalog/controller/account/download.php

Code: Select all

$this->model_account_download->updateRemaining($this->request->get['order_download_id']);
is called after the file download has complete. If you want, you could switch the order around, to deduct the count before allowing the download to start

Re: Remaining Downloads Counter doesnt decrease

Posted: Sat Jul 02, 2016 11:07 pm
by debbiekipt
Hi
Sorry I cannot help, but I do have the same problem and have had since 2012 and 1.5.5.1!

I have not been able to find a solution to this at all :-(

Re: Remaining Downloads Counter doesnt decrease

Posted: Sun Jul 03, 2016 12:20 am
by debbiekipt
MarketInSG wrote:because in catalog/controller/account/download.php

Code: Select all

$this->model_account_download->updateRemaining($this->request->get['order_download_id']);
is called after the file download has complete. If you want, you could switch the order around, to deduct the count before allowing the download to start
Could I ask specifically what would i need to change the code to try this?

Thanks!

Re: Remaining Downloads Counter doesnt decrease

Posted: Sun Jul 03, 2016 1:58 am
by IP_CAM
he probably meant this:
untested! ;)
Ernie

Re: SOLVED Remaining Downloads Counter doesnt decrease

Posted: Sun Jul 03, 2016 8:26 pm
by debbiekipt
Ernie - you are a star!

Thank you! It fixes the issue for me! :-D

Great instructions on MarketInSG suggestion (thanks to you too!) and easy for a non coder to follow :-)

Many thanks again!