What... another bug!
OK... so downloads was working for me on one of my old sites... most be me again!
Recreating by doing a clean install
Zen Cart 1.5.2,
responsive template,
email archive manager 1.7b,
integrated COWOA 2.4 for ZC 1.5.2
xamp php 5.5.11
so.. no code edits, using downloads as designed, if a payment method was used that had an order status as Pending (default), no download would show as expected. Admin would have to change the status to Processing, add a comment for the buyer to access the download by using the order status page or account history if they have an account. Once email and order ID was entered, the download button would show on the status page or account page as expected. I wouldn't send the product download link by email or run the risk of many free downloads occurring.
This is where it gets interesting, if I use a payment method that has an order status of Processing, the download button should appear on the checkout success page. Well It seems to be blocked at line 122, and a session kill at line 80 for COWOA users, but not for account holders.
I'll leave the session destroy switch in place, uses, 'false' allow downloads to work, 'true' do zen_session_destroy() no downloads for COWOA users. So, line 82 section of code is modified to this;
includes/templates/YOUR_TEMPLATE/templates/tpl_checkout_sucess_default.php
Code:
if (isset($_SESSION['customer_guest_id']) || ($_SESSION['COWOA'])) {
line 122 remove the COWOA check;
Code:
if (DOWNLOAD_ENABLED == 'true') require($template->get_template_dir('tpl_modules_downloads.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_downloads.php');
We need to fix the download link for COWOA users so they don't think they have a account history page. Copy tpl_modules_downloads.php from the default template folder to yours and change line 86 to something that works for you..
includes/templates/YOUR_TEMPLATE/templates/tpl_modules_downloads.php
Code:
<p><?php if(!($_SESSION['COWOA'])) { printf(FOOTER_DOWNLOAD, '<a href="' . zen_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>');
} else {
printf(FOOTER_DOWNLOAD_COWOA);
}?></p>
Add to the language page for checkout success so it makes sense...
includes/languages/english/checkout_success.php
Code:
define('FOOTER_DOWNLOAD_COWOA', 'You can also download your products at a later time using the Order Status page.');
Play with this on a testing environment first, I didn't spend allot of time testing it out, but seems to work for me..
Bookmarks