Originally Posted by
lat9
You need to check your admin's Configuration->Attribute Settings, specifically the Downloads Controller Order Status Value >= lower value and Downloads Controller Order Status Value <= upper value. Those values define the range of order-status values that cover orders in your store for which you've received payment (so you're not giving your downloads away for free).
No matter what i do . change evertime to diffrent status .
same - NOTE: Downloads are not available until payment has been confirmed
i'm even don't know how it's need look after this "NOTE: Downloads are not available until payment has been confirmed" removed .
here the attribute setting
and here the code of tpl_modules_downloads
PHP Code:
<?php
/**
* Module Template
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_modules_downloads.php 6374 2007-05-25 20:24:42Z drbyte $
*/
/**
* require the downloads module
*/
require(DIR_WS_MODULES . zen_get_module_directory('downloads.php'));
?>
<?php
// download is available
if ($downloads->RecordCount() > 0) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0" id="downloads">
<caption><h4><?php echo HEADING_DOWNLOAD; ?></h4></caption>
<tr class="tableHeading">
<th scope="col" id="dlFileNameHeading"><?php echo TABLE_HEADING_PRODUCT_NAME; ?></th>
<th scope="col" id="dlByteSize"><?php echo TABLE_HEADING_BYTE_SIZE; ?></th>
<th scope="col" id="dlButtonHeading"><?php echo TABLE_HEADING_DOWNLOAD_FILENAME; ?></th>
<th scope="col" id="dlDateHeading"><?php echo TABLE_HEADING_DOWNLOAD_DATE; ?></th>
<th scope="col" id="dlCountHeading"><?php echo TABLE_HEADING_DOWNLOAD_COUNT; ?></th>
<th scope="col" id="dlButtonHeading"> </th>
</tr>
<!-- list of products -->
<?php
while (!$downloads->EOF) {
// MySQL 3.22 does not have INTERVAL
list($dt_year, $dt_month, $dt_day) = explode('-', $downloads->fields['date_purchased_day']);
$download_timestamp = mktime(23, 59, 59, $dt_month, $dt_day + $downloads->fields['download_maxdays'], $dt_year);
$download_expiry = date('Y-m-d H:i:s', $download_timestamp);
$is_downloadable = ( (file_exists(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename']) && (($downloads->fields['download_count'] > 0 && $download_timestamp > time()) || $downloads->fields['download_maxdays'] == 0)) ) ? true : false;
$zv_filesize = filesize (DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename']);
if ($zv_filesize >= 1024) {
$zv_filesize = number_format($zv_filesize/1024/1024,2);
$zv_filesize_units = TEXT_FILESIZE_MEGS;
} else {
$zv_filesize = number_format($zv_filesize);
$zv_filesize_units = TEXT_FILESIZE_BYTES;
}
?>
<tr class="tableRow">
<!-- left box -->
<?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
// if ( ($downloads->fields['download_count'] > 0) && (file_exists(DIR_FS_DOWNLOAD . $downloads->fields['orders_products_filename'])) && ( ($downloads->fields['download_maxdays'] == 0) || ($download_timestamp > time())) ) {
if ($is_downloadable) {
?>
<td class=""><?php echo '<a href="' . zen_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads->fields['orders_products_download_id']) . '">' . $downloads->fields['products_name'] . '</a>'; ?></td>
<?php } else { ?>
<td class=""><?php echo $downloads->fields['products_name']; ?></td>
<?php
}
?>
<td class=""><?php echo $zv_filesize . $zv_filesize_units; ?></td>
<td class=""><?php echo $downloads->fields['orders_products_filename']; ?></td>
<td class=""><?php echo ($downloads->fields['download_maxdays'] == 0 ? TEXT_DOWNLOADS_UNLIMITED : zen_date_short($download_expiry)); ?></td>
<td class="centeredContent"><?php echo ($downloads->fields['download_maxdays'] == 0 ? TEXT_DOWNLOADS_UNLIMITED_COUNT : $downloads->fields['download_count']); ?></td>
<td class="centeredContent"><?php echo ($is_downloadable) ? '<a href="' . zen_href_link(FILENAME_DOWNLOAD, 'order=' . $last_order . '&id=' . $downloads->fields['orders_products_download_id']) . '">' . zen_image_button(BUTTON_IMAGE_DOWNLOAD, BUTTON_DOWNLOAD_ALT) . '</a>' : ' '; ?></td>
</tr>
<?php
$downloads->MoveNext();
}
?>
</table>
<?php
// old way
// if (!strstr($PHP_SELF, FILENAME_ACCOUNT_HISTORY_INFO)) {
// new way
if (!($_GET['main_page']==FILENAME_ACCOUNT_HISTORY_INFO)) {
?>
<p><?php printf(FOOTER_DOWNLOAD, '<a href="' . zen_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_TITLE_MY_ACCOUNT . '</a>'); ?></p>
<?php } else { ?>
<?php
// other pages if needed
}
?>
<?php
} // $downloads->RecordCount() > 0
?>
<?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
}
?>
and here the code for tpl account history info
PHP Code:
<?php
/**
* Page Template
*
* Loaded automatically by index.php?main_page=account_edit.<br />
* Displays information related to a single specific order
*
* @package templateSystem
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: tpl_account_history_info_default.php 6247 2007-04-21 21:34:47Z wilt $
*/
?>
<div class="centerColumn" id="accountHistInfo">
<div class="forward"><?php echo HEADING_ORDER_DATE . ' ' . zen_date_long($order->info['date_purchased']); ?></div>
<br class="clearBoth" />
<table border="0" width="100%" cellspacing="0" cellpadding="0" summary="Itemized listing of previous order, includes number ordered, items and prices">
<caption><h2 id="orderHistoryDetailedOrder"><?php echo HEADING_TITLE . ORDER_HEADING_DIVIDER . sprintf(HEADING_ORDER_NUMBER, $_GET['order_id']); ?></h2></caption>
<tr class="tableHeading">
<th scope="col" id="myAccountQuantity"><?php echo HEADING_QUANTITY; ?></th>
<th scope="col" id="myAccountProducts"><?php echo HEADING_PRODUCTS; ?></th>
<th scope="col" id="myAccountModel"><?php echo "Model"; ?></th>
<?php
if (sizeof($order->info['tax_groups']) > 1) {
?>
<th scope="col" id="myAccountTax"><?php echo HEADING_TAX; ?></th>
<?php
}
?>
<th scope="col" id="myAccountTotal"><?php echo HEADING_TOTAL; ?></th>
</tr>
<?php
for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
?>
<tr>
<td class="accountQuantityDisplay"><?php echo $order->products[$i]['qty'] . QUANTITY_SUFFIX; ?></td>
<td class="accountProductDisplay"><?php echo $order->products[$i]['name'];
// BON added this part for show video instruction link
$products_video_query = "Select products_video_instruction, products_video_instruction_download From " . TABLE_PRODUCTS . " Where products_id = '" . (int)$order->products[$i]['id'] . "'";
$products_video = $db->Execute($products_video_query);
if ($products_video->RecordCount()) {
while (!$products_video->EOF) {
if(($products_video->fields['products_video_instruction']!='')/*&&(file_exists(DIR_FS_DOWNLOAD . $products_video->fields['products_video_instruction']))*/){
echo '<br> <a style="font-style: italic; font-size: 10px; color: blue; text-decoration: none;" href="video_instructions.php?oID=' . $_GET['order_id'] . '&pID=' . (int)$order->products[$i]['id'] . '&type=view" target="_blank" width=720 height=560>View video instruction</a>';
}
if($products_video->fields['products_video_instruction_download']!=''){
echo ' - <a style="font-style: italic; font-size: 10px; color: blue; text-decoration: none;" href="video_instructions.php?oID=' . $_GET['order_id'] . '&pID=' . (int)$order->products[$i]['id'] . '&type=download" target="_blank" width=720 height=560>Download video instruction</a>';
}
$products_video->MoveNext();
}
}
// END BON add
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
echo '<ul id="orderAttribsList">';
for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
echo '<li>' . $order->products[$i]['attributes'][$j]['option'] . TEXT_OPTION_DIVIDER . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value'])) . '</li>';
}
echo '</ul>';
}
?>
</td>
<td><?php echo $order->products[$i]['model'];?></td>
<?php
if (sizeof($order->info['tax_groups']) > 1) {
?>
<td class="accountTaxDisplay"><?php echo zen_display_tax_value($order->products[$i]['tax']) . '%' ?></td>
<?php
}
?>
<td class="accountTotalDisplay"><?php echo $currencies->format(zen_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ($order->products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->format(zen_add_tax($order->products[$i]['onetime_charges'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) : '') ?></td>
</tr>
<?php
}
?>
</table>
<hr />
<div id="orderTotals">
<?php
for ($i=0, $n=sizeof($order->totals); $i<$n; $i++) {
?>
<div class="amount larger forward"><?php echo $order->totals[$i]['text'] ?></div>
<div class="lineTitle larger forward"><?php echo $order->totals[$i]['title'] ?></div>
<br class="clearBoth" />
<?php
}
?>
</div>
<?php
/**
* Used to display any downloads associated with the cutomers account
*/
if (DOWNLOAD_ENABLED == 'true') require($template->get_template_dir('tpl_modules_downloads.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_downloads.php');
?>
<?php
/**
* Used to loop thru and display order status information
*/
if (sizeof($statusArray)) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0" id="myAccountOrdersStatus" summary="Table contains the date, order status and any comments regarding the order">
<caption><h2 id="orderHistoryStatus"><?php echo HEADING_ORDER_HISTORY; ?></h2></caption>
<tr class="tableHeading">
<th scope="col" id="myAccountStatusDate"><?php echo TABLE_HEADING_STATUS_DATE; ?></th>
<th scope="col" id="myAccountStatus"><?php echo TABLE_HEADING_STATUS_ORDER_STATUS; ?></th>
<th scope="col" id="myAccountStatusComments"><?php echo TABLE_HEADING_STATUS_COMMENTS; ?></th>
</tr>
<?php
foreach ($statusArray as $statuses) {
?>
<tr>
<td class="myAccountStatusComments"><?php echo zen_date_short($statuses['date_added']); ?></td>
<td class="myAccountStatusComments"><?php echo $statuses['orders_status_name']; ?></td>
<!-- Begin Ty Package Tracker -->
<?php
$display_track_id = '';
$display_track_id .= (empty($statuses['track_id1']) ? '' : "<b>" . CARRIER_NAME_1 . "</b>" . ": <a href=" . CARRIER_LINK_1 . nl2br(zen_output_string_protected($statuses['track_id1'])) . ' target="_blank">' . nl2br(zen_output_string_protected($statuses['track_id1'])) . "</a>" );
$display_track_id .= (empty($statuses['track_id2']) ? '' : "<b>" . CARRIER_NAME_2 . "</b>" . ": <a href=" . CARRIER_LINK_2 . nl2br(zen_output_string_protected($statuses['track_id2'])) . ' target="_blank">' . nl2br(zen_output_string_protected($statuses['track_id2'])) . "</a>" );
$display_track_id .= (empty($statuses['track_id3']) ? '' : "<b>" . CARRIER_NAME_3 . "</b>" . ": <a href=" . CARRIER_LINK_3 . nl2br(zen_output_string_protected($statuses['track_id3'])) . ' target="_blank">' . nl2br(zen_output_string_protected($statuses['track_id3'])) . "</a>" );
$display_track_id .= (empty($statuses['track_id4']) ? '' : "<b>" . CARRIER_NAME_4 . "</b>" . ": <a href=" . CARRIER_LINK_4 . nl2br(zen_output_string_protected($statuses['track_id4'])) . ' target="_blank">' . nl2br(zen_output_string_protected($statuses['track_id4'])) . "</a>" );
$display_track_id .= (empty($statuses['track_id5']) ? '' : "<b>" . CARRIER_NAME_5 . "</b>" . ": <a href=" . CARRIER_LINK_5 . nl2br(zen_output_string_protected($statuses['track_id5'])) . ' target="_blank">' . nl2br(zen_output_string_protected($statuses['track_id5'])) . "</a>" );
?>
<td class="myAccountStatusComments"><?php echo (empty($statuses['comments']) ? ' ' : nl2br(zen_output_string_protected($statuses['comments']))); ?><br>
<?php echo $display_track_id; ?><br></td>
<!-- End Ty Package Tracker -->
</tr>
<?php
}
?>
</table>
<?php } ?>
<hr />
<div id="myAccountShipInfo" class="floatingBox back" style="width:45%;">
<?php
if ($order->delivery != false) {
?>
<h3><?php echo HEADING_DELIVERY_ADDRESS; ?></h3>
<address><?php echo zen_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br />'); ?></address>
<?php
}
?>
<?php
if (zen_not_null($order->info['shipping_method'])) {
?>
<h4><?php echo HEADING_SHIPPING_METHOD; ?></h4>
<div><?php echo $order->info['shipping_method']; ?></div>
<?php } else { // temporary just remove these 4 lines ?>
<div>WARNING: Missing Shipping Information</div>
<?php
}
?>
</div>
<div id="myAccountPaymentInfo" class="floatingBox forward" style="float:left;width:30%;margin-left:40px;">
<h3><?php echo HEADING_BILLING_ADDRESS; ?></h3>
<address><?php echo zen_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br />'); ?></address>
<h4><?php echo HEADING_PAYMENT_METHOD; ?></h4>
<div><?php echo $order->info['payment_method']; ?></div>
</div>
<br class="clearBoth" />
</div>
Thanks for help
Bookmarks