1. You are getting a message saying "Downloads are not available until ...", so, search the /includes/languages folders for "Downloads are not available until" to see which constant that's defined in.
That brings up this:
define('DOWNLOADS_CONTROLLER_ON_HOLD_MSG','NOTE: Downloads are not available until payment has been confirmed');
2. So now search the /includes folder for that constant:
DOWNLOADS_CONTROLLER_ON_HOLD_MSG
found in:
/includes/templates/tpl_modules_downloads.php:
[FONT="Courier New"]<?php
// download is not available yet
if ($downloads_check_query->RecordCount() > 0 and $downloads->RecordCount() < 1) {
?>
<fieldset><?php echo DOWNLOADS_CONTROLLER_ON_HOLD_MSG ?></fieldset>
<?php
}
?>
[/FONT]
3. Now search /includes for $downloads_check_query:
found in:
/includes/modules/downloads.php:
Code:
// If there is a download in the order and they cannot get it, tell customer about download rules
$downloads_check_query = $db->Execute("select o.orders_id, opd.orders_products_download_id
from " .
TABLE_ORDERS . " o, " .
TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
where
o.orders_id = opd.orders_id
and o.orders_id = '" . (int)$last_order . "'
and opd.orders_products_filename != ''
");
So, this tells you that it checks the "orders" and "orders_products_download" tables for downloads whose filename is not blank, and having an order ID matching the most recent order placed by that customer.
4. Additionally, the $downloads->RecordCount reference applies to the same file, where the $downloads query was run:
Code:
// Now get all downloadable products in that order
$downloads_query = "select date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day,
opd.download_maxdays, op.products_name, opd.orders_products_download_id,
opd.orders_products_filename, opd.download_count, opd.download_maxdays
from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, "
. TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd
where o.customers_id = '" . (int)$_SESSION['customer_id'] . "'
and (o.orders_status >= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS . "'
and o.orders_status <= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS_END . "')
and o.orders_id = '" . (int)$last_order . "'
and o.orders_id = op.orders_id
and op.orders_products_id = opd.orders_products_id
and opd.orders_products_filename != ''";
$downloads = $db->Execute($downloads_query);
This checks the orders, orders_products, orders_products_download tables for downloadable items connected with that order where the order-status is within the right range.
The constant is displayed if there are no downloads that match these criteria.
So, this suggests that the reason your downloads aren't being made available is that your orders' order_status doesn't fall within the range defined by the upper-and-lower limits set in the Attributes Settings admin page.
And if you're convinced that the settings are correct, then maybe you've got some custom code that's busting it, or you've got some database corruption that's preventing good data from being retrieved. Or something otherwise preventing normal operation.
Bookmarks