Contributions

Order Total Modules (Category Index)
Search: 

Download Count Reset

After looking for a solution and being unable to find it, I decided to star learning PHP and created my first Contribution.

Basic but effective.

You can install the provided files unless you have change their code.

In that case then:

1.- Add in catalog/admin/orders.php
After:
$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from

" . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
$check_status = tep_db_fetch_array($check_status_query);
This:
// Added by Erick Cedano

if ($HTTP_POST_VARS['reset_download'] == 'on') {
$order_updated = true;
$comments = ENTRY_RESET_DOWNLOAD_COMMENT;
tep_db_query("UPDATE " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " SET download_count = '2' where orders_id = '" .

(int)$oID . "'");
}

---------------------------------------------------
2.- Change in catalog/admin/orders.php
this:

<tr>
<td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '',

true); ?></td>
<td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo

tep_draw_checkbox_field('notify_comments', '', true); ?></td>
</tr>
for this:

<tr>
<td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '',

true); ?></td>
<td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo

tep_draw_checkbox_field('notify_comments', '', true); ?></td>
<td class="main"><b><?php echo ENTRY_RESET_DOWNLOAD_COUNT; ?></b> <?php echo

tep_draw_checkbox_field('reset_download', '', false); ?></td>
</tr>

---------------------------------------------------
3.- Add in catalog/admin/languajes/english.php before the last ?>

// Reset Order Download
define('ENTRY_RESET_DOWNLOAD_COUNT', 'Reset Download Count');
define('ENTRY_RESET_DOWNLOAD_COMMENT', 'Download Count Resetted');


4.- Add the same on other languajes if needed.


5.- (optional) Change in catalog/admin/orders.php if you want to see also the order number when the order is open

From this:
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
To This:
<td class="pageHeading"><?php echo HEADING_TITLE; echo '# '; echo (int)$oID; ?></td>

Enjoy!

Erick Cedano a.k.a. GraphiCore

Expand All / Collapse All

Fix Download reset count to DOWNLOAD_MAX_COUNT Vexiphne 17 Apr 2007

Just change :

tep_db_query("UPDATE " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " SET download_count = '2' where orders_id = '" .


to :


tep_db_query("UPDATE " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " SET download_count = '".DOWNLOAD_MAX_COUNT."' where orders_id = '" .

Download Count Reset graphicore 7 Jan 2007

Note: Contributions are used at own risk.