Jump to content
Sign in to follow this  
Ajeh

[Contribution] Downloads Controller v5.3 with Free Ship/Pay

Recommended Posts

Would someone please verify that I am on the right track with the following before I begin:

 

I need this zip to overwrite or add to the files in the 17 Aug 2005 zip

zipe wouldnt download lhaase0217 19 Aug 2005

 

I need this zip for the bulk of the correct files

l1064 SQL Error fix lhaase0217 17 Aug 2005

 

AND, I need this zip to the the sql file

Download / Free Ship /Pay v5.3 MS 2.2 Farrukh Saeed 7 Aug 2003

 

And while I'm here, please direct me to this "wiki instructions" that's been mentioned.

 

Thanks in Advance!


Toward Continued Success - - > Carol Hawkey - - > KidsLearnToSew.com - - > Wyoming, USA

Mods Installed - - > Authnet AIM2 - Bundled Products 1.4 - Fancier Invoice 6.1 - Email_HTML_Order_Link_Fixed - Header Tags Controller - Login aLa Amazon - JustOneAttribute - Article Manager - SPPC w/PB - spiders.txt - Dangling Carrot/Olive - Printable Catalog - CCGV(trad)

Planned Mods - - > Purchase Without Account - USPS Label - Ultimate SEO

Share this post


Link to post
Share on other sites
I had Downloads Controller mod working fine until I added PWA mod (Purchase Without Account).

 

If I log on to an account, Downloads Controller works fine.

 

If I purchase physical items without account, it works fine too.

 

However if I purchase download items without account, it works fine until at success page. There's download button, but when I tried to clicked it, it came up with a blank screen.

 

I see this was followed up by a somewhat vague workaround, but I was hoping to see some code. Has anyone encountered and/or addressed this issue recently? I have a store selling both digital downloads and tangible items, and have encountered the same error when checking out via PWA.

Share this post


Link to post
Share on other sites

OK, answering my own question. I've taken a stab at a guess about what another contriibuter has posted here, and done the following to try and get the Download Controller to work with PWA:

 

First off, this is an installation of oscMAX 2.0 rc2.

 

In checkout_success.php I commented out lines 34-43, and lines 66-98. Anything to do with PHP source code is like drawing with your elbows for me, so I'm going to post the code here and ask you if you see any significant potential downsides to what I've done:

 

// BOF:
//	tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));
// Added a check for a Guest checkout and cleared the session - 030411 
//	if (tep_session_is_registered('noaccount')) { 
//	  tep_session_destroy(); 
//	  tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL')); 
//	} else { 
//	 tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string, 'SSL')); 
//	}
// EOF:
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS);

 $breadcrumb->add(NAVBAR_TITLE_1);
//  $breadcrumb->add(NAVBAR_TITLE_2);  //Removed for PWA 0.8

 $global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'");
 $global = tep_db_fetch_array($global_query);

 if ($global['global_product_notifications'] != '1') {
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
$orders = tep_db_fetch_array($orders_query);

$products_array = array();
$products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name");
while ($products = tep_db_fetch_array($products_query)) {
  $products_array[] = array('id' => $products['products_id'],
							'text' => $products['products_name']);
}
 }

// BOF: MOD - PWA:  Added a check for a Guest checkout and cleared the session - 030411 v0.71
//if (tep_session_is_registered('noaccount')) {
// $order_update = array('purchased_without_account' => '1');
// tep_db_perform(TABLE_ORDERS, $order_update, 'update', "orders_id = '".$orders['orders_id']."'");
//  tep_db_query("insert into " . TABLE_ORDERS . " (purchased_without_account) values ('1') where orders_id = '" . (int)$orders['orders_id'] . "'");
// tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . tep_db_input($customer_id) . "'");
// tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . tep_db_input($customer_id) . "'");
// tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . tep_db_input($customer_id) . "'");
// tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . tep_db_input($customer_id) . "'");
// tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . tep_db_input($customer_id) . "'");
// tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . tep_db_input($customer_id) . "'");
// tep_session_destroy();

// BOF: Bugfix 0000062
// OK, so this was a PWA, so lets check for other MIA PWA accounts, and clear them as well!!
//  $old_customers_query = tep_db_query("select c.customers_id, c.purchased_without_account as pwa, ci.customers_info_date_account_created as date from " . TABLE_CUSTOMERS_INFO . " ci left join " . TABLE_CUSTOMERS . " c on ci.customers_info_id = c.customers_id");
// while ($old_customer = tep_db_fetch_array($old_customers_query)) {
//the second and third part of this if statement should be moved into the mysql select as a where clause...
//   if ((!tep_session_is_registered($old_customer['customers_id'])) && //dont't want to delete PWA accounts with registered sessions...
//	   ((strtotime($old_customer['date']) + (60*60)) < time()) && //make sure the MIA PWA account is at least an hour old (is this old enough? ...its worked well for me so far... a session is 24 minutes, so I figure its safe)
 //	  ($old_customer['pwa'] == 1) ) { //Oh, and make sure it IS a PWA...
//Then delete it like we did above... might be able to compact this code, but...
//	 tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $old_customer['customers_id'] . "'");
//	 tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . $old_customer['customers_id'] . "'");
//	 tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . $old_customer['customers_id'] . "'");
//	 tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . $old_customer['customers_id'] . "'");
//	 tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . $old_customer['customers_id'] . "'");
 //	tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . $old_customer['customers_id'] . "'");
 //  }
// }
// EOF: Bugfix 0000062
//}
// EOF: MOD - PWA:  Added a check for a Guest checkout and cleared the session - 030411 v0.71

 

PS-- I have not, as a.sage suggested, modified download.php. When I tried to edit it, I was getting errors. Things seem to be working the way I have it. My test order went through alright, at least.

So my download.php looks like this:

 

<?php
/*
 $Id: download.php,v 1.1.1.1.2.1.2.2 2005/09/21 20:57:17 Michael Sasek Exp $

 osCMax Power E-Commerce
 http://oscdox.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 include('includes/application_top.php');

 if (!tep_session_is_registered('customer_id')) die;

// Check download.php was called with proper GET parameters
 if ((isset($HTTP_GET_VARS['order']) && !is_numeric($HTTP_GET_VARS['order'])) || (isset($HTTP_GET_VARS['id']) && !is_numeric($HTTP_GET_VARS['id'])) ) {
die;
 }

// Check that order_id, customer_id and filename match
 $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 != ''");
 if (!tep_db_num_rows($downloads_query)) die;
 $downloads = tep_db_fetch_array($downloads_query);
// MySQL 3.22 does not have INTERVAL
 list($dt_year, $dt_month, $dt_day) = explode('-', $downloads['date_purchased_day']);
 $download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads['download_maxdays'], $dt_year);

// Die if time expired (maxdays = 0 means no time limit)
 if (($downloads['download_maxdays'] != 0) && ($download_timestamp <= time())) die;
// Die if remaining count is <=0
 if ($downloads['download_count'] <= 0) die;
// Die if file is not there
 if (!file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) die;

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

// Returns a random name, 16 to 20 characters long
// There are more than 10^28 combinations
// The directory is "hidden", i.e. starts with '.'
function tep_random_name()
{
 $letters = 'abcdefghijklmnopqrstuvwxyz';
 $dirname = '.';
 $length = floor(tep_rand(16,20));
 for ($i = 1; $i <= $length; $i++) {
  $q = floor(tep_rand(1,26));
  $dirname .= $letters[$q];
 }
 return $dirname;
}

// Unlinks all subdirectories and files in $dir
// Works only on one subdir level, will not recurse
function tep_unlink_temp_dir($dir)
{
 $h1 = opendir($dir);
 while ($subdir = readdir($h1)) {
// Ignore non directories
if (!is_dir($dir . $subdir)) continue;
// Ignore . and .. and CVS
if ($subdir == '.' || $subdir == '..' || $subdir == 'CVS') continue;
// Loop and unlink files in subdirectory
$h2 = opendir($dir . $subdir);
while ($file = readdir($h2)) {
  if ($file == '.' || $file == '..') continue;
  @unlink($dir . $subdir . '/' . $file);
}
closedir($h2); 
@rmdir($dir . $subdir);
 }
 closedir($h1);
}


// Now send the file with header() magic
 header("Expires: Mon, 26 Nov 1962 00:00:00 GMT");
 header("Last-Modified: " . gmdate("D,d M Y H:i:s") . " GMT");
 header("Cache-Control: no-cache, must-revalidate");
 header("Pragma: no-cache");
 header("Content-Type: Application/octet-stream");
 header("Content-disposition: attachment; filename=" . $downloads['orders_products_filename']);

 if (DOWNLOAD_BY_REDIRECT == 'true') {
// This will work only on Unix/Linux hosts
tep_unlink_temp_dir(DIR_FS_DOWNLOAD_PUBLIC);
$tempdir = tep_random_name();
umask(0000);
mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777);
symlink(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']);
tep_redirect(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']);
 } else {
// This will work on all systems, but will need considerable resources
// We could also loop with fread($fp, 4096) to save memory
readfile(DIR_FS_DOWNLOAD . $downloads['orders_products_filename']);
 }
?>

Share this post


Link to post
Share on other sites

the first part i got no prob... but this part lower down I don't understand :blink:

 

 

 

can you clarify this a lil more...

 

 

CODE

if (isset($HTTP_GET_VARS['cID'])) {

$cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);

$orders_query_raw = "select o.orders_id, .................

Change all three instances of:

 

CODE

order by $orders";

 

to

 

CODE

order by " . $sort_by;

*

 

 

and starting ~ line 406

<?php
if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by $order";
} elseif (isset($HTTP_GET_VARS['status'])) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by $order";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by $order";
}

 

 

thank you Steve, the error is no longer in the admin now. Now, if I could figure out why no download link is getting sent in the email, or even a download button, i would be good to go.

Edited by remixstore

Share this post


Link to post
Share on other sites
If you go to the contributions and enter download_controller and get this version

Download / Free Ship /Pay v5.3 MS 2.2 Farrukh Saeed

It contains the sql file. Don't worry I had a lot sleepless nights over it as well. You'd think that if someone was going to upload a contribution they would put in everything needed. Anyway this one works

 

#NEW FIELDS FOR DOWNLOADS CONTROLLER

INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) VALUES ('', 'Downloads Controller Update Status Value', 'DOWNLOADS_ORDERS_STATUS_UPDATED_VALUE', '4', 'What orders_status resets the Download days and Max Downloads - Default is 4', '13', '90', '2003-02-18 13:22:32', '', NULL , NULL);
INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) VALUES ('', 'Downloads Controller Download on hold message', 'DOWNLOADS_CONTROLLER_ON_HOLD_MSG', '<BR><font color="FF0000">NOTE: Downloads are not available until payment has been confirmed</font>', 'Downloads Controller Download on hold message', '13', '91', '2003-02-18 13:22:32', '', NULL , NULL);
INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) VALUES ('', 'Downloads Controller Order Status Value', 'DOWNLOADS_CONTROLLER_ORDERS_STATUS', '2', 'Downloads Controller Order Status Value - Default=2', '13', '92', '2003-02-18 13:22:32', '', NULL , NULL);

Share this post


Link to post
Share on other sites

Hola I think I've done everything right here - the correct settings in my configure.php file (I replaced my site w/ (mysite.com) below - but otherwise everything below is from my config file)

define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');

define('DIR_FS_CATALOG', '/home/httpd/vhosts/mysite.com/httpdocs/cart/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

I have a fresh install of CRE Loaded 6.15 - and I have downloads enabled - w/ redirect enabled as I want instant downloads, not emailed ones - I have the correct permissions on the pub/ and download/ folders -which are both in my cart/ folder (I didn't use the standard catalog/ setup)

 

I thought when I did this before that you were supposed to put your download folder below your httpdocs folder - but the instructions I read for setting up OSC downloads w/ the download controller said to just put the files in the download/ folder - which has an .htaccess file in it already.

 

I'm getting the following error - from IE and Firefox when a user tries to click on their download - which does all seem to work fine, as far as the user being issued some sort of download, and the download being clickable in their "my account" or after checkout success -

 

Forbidden

 

You don't have permission to access /cart/pub/.wbxdwzqmbztqkelticd/unreal.zip on this server.

 

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

 

Any ideas? I really need the help and would be happy to donate a few bucks for your efforts.

Share this post


Link to post
Share on other sites

I wanted to point out that I have the Fast Easy Checkout 2.0 contribution installed - but so far it works great and has broken nothing - it uses a PWA type thing to avoid a long checkout - but the Paypal IPN 2.8 installed also works great. It's just that when the user clicks on the download links, they get a forbidden notice instead of a download.

Share this post


Link to post
Share on other sites

Has anybody gotten this contribution to work with the Multi-Vendor Shipping (MVS) contribution? In short, MVS adds the capability to control shipping options by vendor. It actually works great. However, after installing, Downloads Controller 5.3 no longer worked.

 

MVS should work with any shipping module, but modules that are not part of MS2.2 need to be modified manually. I believe for Downloads Controller 5.3, that would mean modifying the freeshipping.php module and moving it into the vendor_shipping directory.

 

I would appreciate hearing from anyone who has these great contributions working together. :rolleyes:

Share this post


Link to post
Share on other sites
I wanted to point out that I have the Fast Easy Checkout 2.0 contribution installed - but so far it works great and has broken nothing - it uses a PWA type thing to avoid a long checkout - but the Paypal IPN 2.8 installed also works great. It's just that when the user clicks on the download links, they get a forbidden notice instead of a download.

 

 

stace20,

I don't know too much about Fast Easy Checkout... but I do know that some people on this forum who are using Purchase Without Account had problems with downloads. Hence the reason that it's not always a good idea to a ton of modules pre-installed (CRE).


My Contribution

Music Download Store Template

http://www.oscommerce.com/community/contributions,4275

Share this post


Link to post
Share on other sites

it seems my osc is not compatible with the downloads controller. is there a simple way to remove the sql input rather then reloading a backup?

Share this post


Link to post
Share on other sites

This is an excellent contribution, exactly what I was looking for. I've tested purchasing a digital product and it works beautifully.

 

However, I am getting an error when i go to the orders page. I don't see the orders, I get the following error message:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 0, 20' at line 1

 

select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by limit 0, 20

 

I am using a clean install of the newest version of oscommerce, MySQL version 4.1.14-standard.

 

I have tried every fix I have been able to find throughout the site to no avail.

 

I would appreciate any help you might be able to offer.

 

Lynn

Share this post


Link to post
Share on other sites

Here is the fix...I think this is the whole thing I copied it from a forum a while back

 

 

QUOTE(TWDesignStudios @ May 5 2004, 04:29 PM)

1064 - You have an error in your SQL syntax near 'limit 0, 20' at line 1

 

select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by limit 0, 20

 

[TEP STOP]

New Error

*

 

 

 

I was getting this too. Looks like someone meant to put in a SORT BY based on the LISTING variable passed in the URL, but I never found any code to cover it. So, in /admin/orders.php, find this line, near the top:

 

CODE

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

 

Above that, add:

 

CODE

if($HTTP_GET_VARS['listing']=="customers") { $sort_by = "o.customers_name"; }

elseif($HTTP_GET_VARS['listing']=="customers-desc") { $sort_by = "o.customers_name DESC"; }

elseif($HTTP_GET_VARS['listing']=="ottotal") { $sort_by = "order_total"; }

elseif($HTTP_GET_VARS['listing']=="ottotal-desc") { $sort_by = "order_total DESC"; }

elseif($HTTP_GET_VARS['listing']=="id-asc") { $sort_by = "o.orders_id"; }

elseif($HTTP_GET_VARS['listing']=="id-desc") { $sort_by = "o.orders_id DESC"; }

elseif($HTTP_GET_VARS['listing']=="status-asc") { $sort_by = "o.orders_status"; }

elseif($HTTP_GET_VARS['listing']=="status-desc") { $sort_by = "o.orders_status DESC"; }

else { $sort_by = "o.orders_id DESC"; }

 

 

Then, go way down and find the block that starts:

 

CODE

if (isset($HTTP_GET_VARS['cID'])) {

$cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);

$orders_query_raw = "select o.orders_id, .................

 

 

Change all three instances of:

 

CODE

order by $orders";

 

to

 

CODE

order by " . $sort_by;

Share this post


Link to post
Share on other sites
I wanted to point out that I have the Fast Easy Checkout 2.0 contribution installed - but so far it works great and has broken nothing - it uses a PWA type thing to avoid a long checkout - but the Paypal IPN 2.8 installed also works great. It's just that when the user clicks on the download links, they get a forbidden notice instead of a download.

It might be cause the files in the download Controller are for the paypal.php not the paypal_ipn.php

 

 

Anyone else know how to get the PayPal IPN controlller to work and what part of the paypal_ipn.php needs to be modified?

 

Thanks.

Share this post


Link to post
Share on other sites

I'm getting the order page problem as well but when I try to implement your fix for

CODE

if (isset($HTTP_GET_VARS['cID'])) {

$cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);

$orders_query_raw = "select o.orders_id, .................

 

 

Change all three instances of:

 

CODE

order by $orders";

 

to

 

CODE

order by " . $sort_by;

 

I cannot find any instance of "order by $orders"

 

i have oscm2.2 no fast checkout or related contribs.

 

My order status page shows up for the customer but not in the admin panel

Share this post


Link to post
Share on other sites
I'm getting the order page problem as well but when I try to implement your fix for

I cannot find any instance of "order by $orders"

 

i have oscm2.2 no fast checkout or related contribs.

 

My order status page shows up for the customer but not in the admin panel

 

In orders.php around lines 403 to 412 you will find it, here is the ammended ver as a guide

 

CODE

 

<?php

if (isset($HTTP_GET_VARS['cID'])) {

$cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);

$orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by " . $sort_by;

} elseif (isset($HTTP_GET_VARS['status'])) {

$status = tep_db_prepare_input($HTTP_GET_VARS['status']);

$orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total'order by " . $sort_by;

} else {

$orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by " . $sort_by;

 

CODE END

Share this post


Link to post
Share on other sites

Okay...sorry I am late to the game, but my record label is just about to start doing digital downloads for our albums and was wondering is if this module has someway to randomize the url of the d/l because I am afraid of if someone sees the URL and it's something pretty standard and never changes of where the files are..then they could paste that out onto the internet and then everyone would be grabbing the d/ls for free before paying for them......

I have seen other shopping carts to where after you purchase the digital download(s), then it gives you a random URL like:

https://www.mystore.com/download/ur439867dhjdl

and then based on the admininstration of the downloads, say 48 hours or how ever many downloads before the link expires....

because of what I am gathering now on the oscommerce download function to work is that one has to manually copy over the files to the /download directory and then the download works off of that and if this is not randomized..then that url could be pasted all over the inet for free d/ls...

Thanks...

 

This includes the Downloads Controller v5.3 and Free Shipping and Payment Modules.

No other shipping and payment modules are changed.

If these are not turned on, then they do not effect the functionality of the programs.

Also includes a handy dandy Downloads Button to make it easier on the shopper to know where to click to get their download.

http://www.oscommerce.com/community/contri...ions,994/page,4

Share this post


Link to post
Share on other sites
Get the earlier version 7 Aug 2003, Farrukh Saeed. The other ones after don't have it. I used this one and it works great.

Trev

 

Yeah I pulled the sql from an earlier version and it works fine, thanks.

Share this post


Link to post
Share on other sites

Dear All,

I have installed the Downloads Controller v5.3 and I have had it working, but now for some reason, I do not get a download link or button to start the download, as I used to have.

I have compared all of the files in the contrib with the ones in my shop and there is no difference at all, unless I missed something out.

Can anyone help me please, the shop is ready to go live apart from this not working.

George

Share this post


Link to post
Share on other sites
Dear All,

I have installed the Downloads Controller v5.3 and I have had it working, but now for some reason, I do not get a download link or button to start the download, as I used to have.

I have compared all of the files in the contrib with the ones in my shop and there is no difference at all, unless I missed something out.

Can anyone help me please, the shop is ready to go live apart from this not working.

George

The only way to be sure that the files have not been corrupted is to replace them with the original ones. That will at least eliminate the issue "unless I missed something".

Are you getting any errors?

 

Trev

Share this post


Link to post
Share on other sites
The only way to be sure that the files have not been corrupted is to replace them with the original ones. That will at least eliminate the issue "unless I missed something".

Are you getting any errors?

 

Trev

Also Has the attributes been altered? has the shipping value been set properly or changed?

 

Trev

Share this post


Link to post
Share on other sites

Dear Trev,

Thanks for someone getting back to me, but I have cured the problem, is was the link in the configure.php file, it needed to be changed from downloads/ to /downloads/, and the link worked.

I thought I would share that one, just in case someone else had the same problem.

Thanks again,

George

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×