DOWNLOADABLE VERSION HERE: http://www.zen-cart.com/index.php?ma...oducts_id=1634
-------
I was asked by a fellow zenner if I could show them how to clear out the credit card and cvv numbers from the orders table as they did not want to retain this information even though it was only the 1st and last 4 digits and the CVV was stored in a binary format.
So, I decided to add this to the Admin - Tools - Store Manager page.
In the file /admin/store_manager.php at or around line 36 (After // clean out the admin_activity_log section) add this:
at or around line 473 after (<!-- eof: reset admin_activity_log --> add this:Code:// clear orders credit card info case 'clear_orders_cc_info': $db->Execute("update " . TABLE_ORDERS . " set cc_number = NULL, cc_cvv = NULL where cc_number > ' '"); $db->Execute("optimize table " . TABLE_ORDERS); $messageStack->add_session(SUCCESS_CLEARED_CREDIT_CARD_INFO, 'success'); unset($_SESSION['clear_orders_cc_info']); zen_redirect(zen_href_link(FILENAME_STORE_MANAGER)); break;
In the file /admin/includes/languages/english/store_manager.php add the following at or around line 20:Code:<!-- bof: reset credit card and cvv numbers in orders --> <tr> <td colspan="2"><br /><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class=<?php echo ($_SESSION['reset_orders_cc_info_log'] == true ? "alert" : "main"); ?> align="left" valign="top"><?php echo TEXT_RESET_ORDERS_CC_INFO; ?></td> <td class="main" align="right" valign="middle"><?php echo '<a href="' . zen_href_link(FILENAME_STORE_MANAGER, 'action=clear_orders_cc_info') . '">' . zen_image_button('button_reset.gif', IMAGE_RESET) . '</a>'; ?></td> </tr> </table></td> </tr> <!-- eof: reset credit card and cvv numbers in orders -->
At line 31 add the following:Code:define('SUCCESS_CLEARED_CREDIT_CARD_INFO', '<strong>Successful</strong> Credit Card and CVV Numbers have been cleared from the orders table');
You will now have a reset button that will permanently clear out the credit card and cvv numbers in your database but leave all other order info.Code:define('TEXT_RESET_ORDERS_CC_INFO', '<strong>Reset Credit Card and CVV Numbers to Null in all Orders<br />WARNING: Be sure to backup your database before running this update!</strong><br>This will reset ALL credit card and cvv numbers to Null on all Orders. This is a 3rd party mod from JT of GTI Custom: ');
I gave myself a shameless plug at the end of line 31, you can certainly remove it if you want to.
Remember, Always BACKUP your files and DB before adding any modifications!






