I just found this post on another thread by lee987 on 03 June 2008 .
Maybe this is the solution?? Let me know if this works. I want to use it myself but I'm not swift enough on OsCommerce to get myself out of the Jams I get myself into...
To prevent download stealing a small mod to /catalog/download.php is required
Replace
$downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . $customer_id . "' and o.orders_id = '" . (int)$HTTP_GET_VARS['order'] . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != ''");
with
// mod to prevent download stealing
// $downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . $customer_id . "' and o.orders_id = '" . (int)$HTTP_GET_VARS['order'] . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != ''");
$downloads_query = tep_db_query("select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, opd.download_count, opd.download_maxdays, opd.orders_products_filename from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . $customer_id . "' and o.orders_id = '" . (int)$HTTP_GET_VARS['order'] . "' and o.orders_status = '3' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_download_id = '" . (int)$HTTP_GET_VARS['id'] . "' and opd.orders_products_filename != ''");
// end mod to prevent download stealing
This does an additional check that order status is 3 (or whatever you have set for payment received). If it does not match then the 'buyer' just sees a blank screen instead of getting access to the download. Instead of
and o.orders_status = '3'
I guess you could use >= '3' or use an or statement.
I can't remember where I found this suggestion but it worked for me.
I am using IPN along with this.
by lee987 on 03 June 2008
Latest News: (loading..)
TO HELP THOSE WITH DOWNLOAD PROBLEMS
Started by Cyber2000, Nov 12 2005, 12:58
88 replies to this topic
#81
Posted 28 March 2010, 02:56
Thanks,
Susan
Proudly uses Oscommerce!
Susan
Proudly uses Oscommerce!
#82
Posted 09 July 2010, 11:54
I am currently setting a up a store which will be selling software. I have products for download as well as physical products. What I would like to know is, is it possible to set up downloads which have different combinations of attributes? For example, I need the user to be able to select the type of license (office/home), and the platform (windows/mac), and to then be able to download the correct file according to these options. I've had a search on the contributions area of the site and haven't found anything which looks like it would allow me to do this...
I'd be extremely grateful for any help or suggestions.
Thanks,
Emily
I'd be extremely grateful for any help or suggestions.
Thanks,
Emily
#83
Posted 13 July 2010, 19:23
purplemartinart, on 28 March 2010, 02:56, said:
I just found this post on another thread by lee987 on 03 June 2008 .
Maybe this is the solution?? Let me know if this works. I want to use it myself but I'm not swift enough on OsCommerce to get myself out of the Jams I get myself into...
Maybe this is the solution?? Let me know if this works. I want to use it myself but I'm not swift enough on OsCommerce to get myself out of the Jams I get myself into...
I'd be really interested to know too...it seems like just a small piece of script to use compared to the downloads add ons that I've looked at that may take a while to install and could be tricky...I'd rather have something simple like this, I don't need bells and whistles..
#84
Posted 13 July 2010, 23:46
Hi,
I've tried all of this (Configuration, editing the source files, attributes, PayPal, literally every suggestion in this forum) and it's all as it should be yet still not working!
I go through PayPal and pay and it takes me back to the shopping cart where I then click "Confirm Order" -
The next page just says this:
Fatal error: Call to a member function call_api() on a non-object in /(filepath)/checkout_process.php on line 127
I haven't changed anything on checkout_process, does anybody get this error?
Thanks!

-- also, forgot to mention my customer order never shows up on the admin panel. PayPal puts it through fine so the error is probably somewhere in checkout_process or checkout_success. Help!!
I've tried all of this (Configuration, editing the source files, attributes, PayPal, literally every suggestion in this forum) and it's all as it should be yet still not working!
I go through PayPal and pay and it takes me back to the shopping cart where I then click "Confirm Order" -
The next page just says this:
Fatal error: Call to a member function call_api() on a non-object in /(filepath)/checkout_process.php on line 127
I haven't changed anything on checkout_process, does anybody get this error?
Thanks!
-- also, forgot to mention my customer order never shows up on the admin panel. PayPal puts it through fine so the error is probably somewhere in checkout_process or checkout_success. Help!!
Edited by Allybelle, 14 July 2010, 00:00.
#85
Posted 14 July 2010, 01:02
Never mind! Within checkout_process there's a call_api in the BuySafe module - since I'm not using BuySafe I just deleted it and now, FINALLY, my cart works! So, probably no help for anyone who IS using BuySafe, but if you're not, and you're getting my error, that's how to fix it. So relieved!
#86
Posted 24 July 2010, 06:45
I've read through all these posts and tried the suggestions but am still not getting a download link. I tried:
- Setting the attributes to 'download' and 'yes' as suggested
- Checked the filename was entered correctly etc.
- Downloads are enabled in admin and redirects set to false
- Checked the "/" were correct in catalog/includes/configure
But it still doesn't work.
I tried it using the test credit card - could the problem be with that somehow? Are there some other settings that need to be checked?
It's not working for the 'Unrreal Tournament' product either so I'm guessing it's a problem somewhere else, not with the new download I added. but I'm at a loss what to do to get it working. I'm using osc V2.2 RC 2a. Can anyone help?
- Setting the attributes to 'download' and 'yes' as suggested
- Checked the filename was entered correctly etc.
- Downloads are enabled in admin and redirects set to false
- Checked the "/" were correct in catalog/includes/configure
But it still doesn't work.
I tried it using the test credit card - could the problem be with that somehow? Are there some other settings that need to be checked?
It's not working for the 'Unrreal Tournament' product either so I'm guessing it's a problem somewhere else, not with the new download I added. but I'm at a loss what to do to get it working. I'm using osc V2.2 RC 2a. Can anyone help?
#87
Posted 24 July 2010, 07:11
Well I got it to work by changing the sort order from '0' to '1'. In case anyone still needs help see this post which gives the fix:
http://forums.oscommerce.com/topic/272171-download-link-not-showing-fixed/page__gopid__1522179&#entry1522179
http://forums.oscommerce.com/topic/272171-download-link-not-showing-fixed/page__gopid__1522179&#entry1522179
Edited by Dali45, 24 July 2010, 07:18.
#88
Posted 24 July 2010, 07:24
Well I got it to work by changing the order status of the category so it wasn't '0''. In case anyone still needs help see this post which gives the fix:
http://forums.oscommerce.com/topic/272171-download-link-not-showing-fixed/page__gopid__1522179&#entry1522179
See also the knowledge base:
http://www.oscommerce.info/confluence/display/OSCDOC22/Orders+Status
So it seems that you can set the download link to appear when any one of the status's (of your choosing) is completed. I tried changing the order status to 3 so that it would appear only when the order was set to 'delivered' in admin and it seemed to work. I hope that all makes sense
http://forums.oscommerce.com/topic/272171-download-link-not-showing-fixed/page__gopid__1522179&#entry1522179
See also the knowledge base:
http://www.oscommerce.info/confluence/display/OSCDOC22/Orders+Status
So it seems that you can set the download link to appear when any one of the status's (of your choosing) is completed. I tried changing the order status to 3 so that it would appear only when the order was set to 'delivered' in admin and it seemed to work. I hope that all makes sense
Edited by Dali45, 24 July 2010, 07:38.
#89
Posted 04 August 2010, 05:55
this helped me to,but got another problem
i uploaded a pretty big file for test like 43mb,but when customers download its like 200bytes and its nor posible to open
please help regards
i uploaded a pretty big file for test like 43mb,but when customers download its like 200bytes and its nor posible to open
please help regards














