anothermethod Posted August 16, 2006 Share Posted August 16, 2006 Hey. I was wondering if anyone had a solution for this: I have a downloadable product and when you select Check/Money Order for payment and submit, it gives you the address to send the check to, but it also lets you download the product right then. Is there a way to get this module to allow me to authorize a download after the money has cleared? Or, is there another module that does this already? Thanks in advance ;) Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted August 16, 2006 Share Posted August 16, 2006 You will need to install Downloads Controller by Linda McGrath Downloads Controller v5.0: Link: http://www.oscommerce.com/community/contri...oads+controller Read the instruction carefully. It is a very confusing mod. But once you have it installed correctly it works great. Quote Link to comment Share on other sites More sharing options...
cealex Posted August 31, 2006 Share Posted August 31, 2006 Hi, Another way is ... in the file catalog/include/modules/downloads.php about line 25 add the column field , orders_status in the sql statment. just like this: $downloads_query = tep_db_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, orders_status from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' 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 != ''"); in the beginning of <!-- left box -->, (same php page) insert in the if -> ($downloads['orders_status'] == 3 ), for me the state is 'Delivered', so when the state is 'Delivered' the field 'orders_status' is equal to 3. <?php // The link will appear only if: // - Download remaining count is > 0, AND // - The file is present in the DOWNLOAD directory, AND EITHER // - No expiry date is enforced (maxdays == 0), OR // - The expiry date is not reached //cealex: added --> ($downloads['orders_status'] == 3 ) if ( ($downloads['orders_status'] == 3 ) && ($downloads['download_count'] > 0) && (file_exists(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'])) && ( ($downloads['download_maxdays'] == 0) || ($download_timestamp > time())) ) { echo ' <td class="main"><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '">' . $downloads['products_name'] . '</a></td>' . "\n"; echo ' <td class="main">' . TABLE_HEADING_DOWNLOAD_DATE . tep_date_long($download_expiry) . '</td>' . "\n" . ' <td class="main" align="right">' . $downloads['download_count'] . TABLE_HEADING_DOWNLOAD_COUNT . '</td>' . "\n"; } else { echo ' <td class="main">' . $downloads['products_name'] . '</td>' . "\n" . ' <td colspan=2 class="main">' . TABLE_HEADING_DOWNLOAD_AFTER_SUCCESSFULL_PAID . '</td>' . "\n"; } ?> <!-- right box --> <?php echo ' </tr>' . "\n"; } ?> Note that the "<td's>" was changed, put all the code above. It's necessary to define TABLE_HEADING_DOWNLOAD_AFTER_SUCCESSFULL_PAID in all languagens. Don't forget to backup your code :) , before the changes. for example, //cealex: added //cealex: change the text .... define('TABLE_HEADING_DOWNLOAD_AFTER_SUCCESSFULL_PAID', 'Download available after complete transaction payment'); Hope this help, hasta. Quote Link to comment Share on other sites More sharing options...
anothermethod Posted September 1, 2006 Author Share Posted September 1, 2006 Thanks guys ;) For some reason I wasn't subscribed to my post though and I had someone code it for me. I'll keep this for later project though! Cheers, g Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.