Guest Posted May 15, 2012 Share Posted May 15, 2012 @@Winston_C My apologies Mitch, I was thinking of a different contribution. Does that product have two download attributes by chance ? I can't think of any reason it would duplicate the download link. Chris Quote Link to comment Share on other sites More sharing options...
Winston_C Posted May 16, 2012 Share Posted May 16, 2012 Figured it out! Thank you so much! @@Winston_C My apologies Mitch, I was thinking of a different contribution. Does that product have two download attributes by chance ? I can't think of any reason it would duplicate the download link. Chris Quote Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2012 Share Posted May 16, 2012 @@winston, can you share? I will try this contrib next, but the one I have tried today, the other super downloads, did the same thing... Quote Link to comment Share on other sites More sharing options...
Guest Posted May 16, 2012 Share Posted May 16, 2012 I see there's a version of this contrib for v2.3. It didn't work for me. Has anyone tried this one on v2.3? Quote Link to comment Share on other sites More sharing options...
steve-doherty Posted November 13, 2012 Share Posted November 13, 2012 I installed this, it's working great. But, now everything that was previously added set as 0 for Expiry Days now comes up as expiring the same day of purchase, instead of never expiring. Any idea about this? Thanks, Steve Quote Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2012 Share Posted November 13, 2012 @@vmjarala The v2.3.x contribution DOES work. The 2.2 version of this contribution WILL NOT work on v2.3.x Chris Quote Link to comment Share on other sites More sharing options...
Guest Posted November 13, 2012 Share Posted November 13, 2012 @@steve-doherty This contribution does not allow for ZERO days to expiry. Zero would indicate same day. You will need to set an exact number of days for the file to expire, up to 999 I believe. Chris Quote Link to comment Share on other sites More sharing options...
steve-doherty Posted November 13, 2012 Share Posted November 13, 2012 Thanks DunWeb Quote Link to comment Share on other sites More sharing options...
herbsandhelpers Posted March 24, 2013 Share Posted March 24, 2013 (edited) Hello! I've just installed this on 2.3.3 and got the Tuesday December 1999 date problem it was rather easily resolved by applying the following from ConradAskLand: OsCommerce 2.2 Download Mod – Problems with: Download Expires Tuesday December 1999″ Download link not showing (not clickable linking – no link) after approval of payment. I’m posting this here off the support forums because the search functions wouldn’t allow me to search and find this fix, I had to find it on Google. Assuming others are doing the same, here it is. Keyword help to find this: Osc MS2, Super Download Mod, error, problem, downloads expiry, no link not showing unable to download. Within download.php in modules I changed the following: $downloads_query = tep_db_query(“select o.orders_status, date_format(o.last_modified, ‘%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)$customer_id . “‘ and o.orders_status >= ‘” . DOWNLOADS_CONTROLLER_ORDERS_STATUS . “‘ 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_query = tep_db_query(“select o.orders_status, 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)$customer_id . “‘ and o.orders_status >= ‘” . DOWNLOADS_CONTROLLER_ORDERS_STATUS . “‘ 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 != ””); Its actually a very small change: Within the quiry I changed “o.last_modified” to “o.date_purchased”. Edited March 24, 2013 by herbsandhelpers Quote Link to comment Share on other sites More sharing options...
herbsandhelpers Posted March 25, 2013 Share Posted March 25, 2013 (edited) If it's not too clear then all you need to do is modify BOTH download.php files changing o.last_modified to o.date_purchased in the line: $downloads_query = tep_db_query(“select o.orders_status, date_format(o.last_modified, ‘%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)$customer_id . “‘ and o.orders_status >= ‘” . DOWNLOADS_CONTROLLER_ORDERS_STATUS . “‘ 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 != ””); to $downloads_query = tep_db_query(“select o.orders_status, 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)$customer_id . “‘ and o.orders_status >= ‘” . DOWNLOADS_CONTROLLER_ORDERS_STATUS . “‘ 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 != ””); Yep! that's it! Lorraine Edited March 25, 2013 by herbsandhelpers Quote Link to comment Share on other sites More sharing options...
herbsandhelpers Posted March 25, 2013 Share Posted March 25, 2013 [/background][/size][/font][/color] [color=#151515][font=Verdana, Georgia, 'Times New Roman', Times, serif][size=3][background=rgb(248, 248, 236)]$downloads_query = tep_db_query(“select o.orders_status, date_format(o.last_modified, ‘%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)$customer_id . “‘ and o.orders_status >= ‘” . DOWNLOADS_CONTROLLER_ORDERS_STATUS . “‘ 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 != ””);[/background][/size][/font][/color] [color=#151515][font=Verdana, Georgia, 'Times New Roman', Times, serif][size=3][background=rgb(248, 248, 236)]$downloads_query = tep_db_query(“select o.orders_status, 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)$customer_id . “‘ and o.orders_status >= ‘” . DOWNLOADS_CONTROLLER_ORDERS_STATUS . “‘ 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 != ””); Quote Link to comment Share on other sites More sharing options...
herbsandhelpers Posted March 25, 2013 Share Posted March 25, 2013 [/background][/size][/font][/color] [color=#151515][font=Verdana, Georgia, 'Times New Roman', Times, serif][size=3][background=rgb(248, 248, 236)]$downloads_query = tep_db_query(“select o.orders_status, date_format(o.last_modified, ‘%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)$customer_id . “‘ and o.orders_status >= ‘” . DOWNLOADS_CONTROLLER_ORDERS_STATUS . “‘ 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 != ””);[/background][/size][/font][/color] [color=#151515][font=Verdana, Georgia, 'Times New Roman', Times, serif][size=3][background=rgb(248, 248, 236)]$downloads_query = tep_db_query(“select o.orders_status, 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)$customer_id . “‘ and o.orders_status >= ‘” . DOWNLOADS_CONTROLLER_ORDERS_STATUS . “‘ 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 != ””); Quote Link to comment Share on other sites More sharing options...
dennish Posted August 5, 2014 Share Posted August 5, 2014 (edited) Hello, I am struggling with an issue already raised some time ago (See post #569 and the provided answer post#570): how to get the pages displaying the remaining downloads (checkout_success.php and account_history_info.php) to refresh and show the actual number of downloads still allowed after clicking the download button. (Hopefully this should also take care of the blank page emerging after the customer has exceeded the maximum number of downloads). As suggested in post #570, the pages should be reloaded (from the server) when the download button is clicked to acheive the desired result. I found some suggestions on how to accomplish this with javascript here: http://www.mediacollege.com/internet/javascript/page/reload.html http://stackoverflow.com/questions/5404839/how-can-i-refresh-a-page-with-jquery?rq=1 I added the following code to the download button links in catalog/includes/modules/downloads.php: onClick="window.location.reload(true);" The full code for the link now looks like this: echo ' <td class="main" align="left" width="70%"><div><a href="' . tep_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads['orders_products_download_id']) . '" onClick="window.location.reload(true);">' . tep_image_button('button_download.gif', 'Download', 'style="vertical-align:middle;padding-top:5px;padding-bottom:5px;"') . '</a><span style=""> ' . $downloads['products_name'] . ' - '. $file_array['download_group_file_description'] . '</span></div></td>' . "\n"; The resulting output is: <td class="main" align="left" width="25%"><a href="http://www.mydomain.com/catalog/download.php?order=67&id=72" onClick="window.location.reload(true);"><img src="includes/languages/english/images/buttons/button_download.gif" alt="Download" title="Download" width="120" height="20" style="vertical-align:middle;padding-top:5px;padding-bottom:5px;" /></a></td> However, the page is still not updated after the download button is clicked. If I refresh the page manually using the browser (in my case Firefox), the remaining number of downloads is set to 0 (as would be expected when the allowed 2 downloads in my case are fully used). Can anyone offer an explantion (and possibly a solution) for this issue? Thanks in advance. Kind regards, Dennis Edited August 5, 2014 by dennish Quote Link to comment Share on other sites More sharing options...
dennish Posted August 13, 2014 Share Posted August 13, 2014 (edited) Hello, I found a pretty straightforward solution to the "blank page" issue (the question related to updating the remaining number of allowed downloads after each download click is still open: any suggestions to solve this are very much appreciated!). My solution involves the following changes: 1. In catalog/checkout_succes.php: After require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS); Insert // New code - Start $navigation->set_snapshot(); // New code - End 2. In catalog/account_history_info.php: After if (!tep_session_is_registered('customer_id')) { $navigation->set_snapshot(); tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } Insert // New code - Start $navigation->set_snapshot(); // New code - End 3. In calatog/download.php: Replace if ($downloads['download_count'] <= 0) die; By // if ($downloads['download_count'] <= 0) die; // New code - Start if ($downloads['download_count'] <= 0) { // Return to the last page visited if (sizeof($navigation->snapshot) > 0) { $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']); $navigation->clear_snapshot(); } else { $origin_href = tep_href_link(FILENAME_DEFAULT); } tep_redirect($origin_href); } // New code - End Done! Another thing I came accross is the message displayed at catalog/checkout_succes.php refering the customer to the catalog/account.php page (in case he/she wishes to download at a later moment). This message is shown even if there are no downloads left. In this case I would rather leave that message out. In catalog/includes/modules/downloads.php: Replace <?php if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) { ?> <p><?php printf(FOOTER_DOWNLOAD, '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>'); ?></p> <?php } ?> By <?php if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) { // New code - Start // Don't refer customer to My account for downloads if no remaining downloads are left $downloads_query = tep_db_query("select o.orders_status, date_format(o.last_modified, '%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)$customer_id . "' and o.orders_status >= " . DOWNLOADS_CONTROLLER_ORDERS_STATUS . " 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 = tep_db_fetch_array($downloads_query); if ( ($downloads['download_count'] > 0) && ( ($downloads['download_maxdays'] == 0) || ($download_timestamp > time())) ) { // New code - End ?> <p><?php printf(FOOTER_DOWNLOAD, '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>'); ?></p> <?php // New code - Start } // New code - End } ?> Kind regards. Dennis Edited August 13, 2014 by dennish 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.