OpenCart’s system configuration section provides tools for maintaining your store, managing logs, performing backups, and handling system-level tasks. Regular maintenance ensures optimal performance and security.
Access system tools from System menu in the admin panel.
// From log.php controller (admin/controller/tool/log.php)namespace Opencart\Admin\Controller\Tool;class Log extends \Opencart\System\Engine\Controller { public function index(): void { $file = DIR_LOGS . 'error.log'; if (file_exists($file)) { $data['log'] = file_get_contents($file, FILE_USE_INCLUDE_PATH, null); $data['size'] = filesize($file); } }}
Viewing Error Logs
Navigate to System → Maintenance → Error Logs to view recent errors and warnings.Log location: system/storage/logs/error.log
Clearing Logs
Click Clear to delete the error log file. Recommended when log file becomes very large (>10MB).
Common Errors
PHP Notices: Minor issues, usually safe to ignore Warnings: Potential problems that should be investigated Fatal Errors: Critical issues that stop execution Database Errors: Connection or query problems
Updates exchange rates from configured currency services.
// catalog/controller/cron/gdpr.phppublic function index(): void { $this->load->model('account/gdpr'); // Delete customer data older than retention period $this->model_account_gdpr->deleteGdpr();}
Removes customer data after GDPR retention period expires.
// catalog/controller/cron/subscription.phppublic function index(): void { $this->load->model('checkout/subscription'); // Process recurring subscriptions $subscriptions = $this->model_checkout_subscription->getSubscriptions(); foreach ($subscriptions as $subscription) { if ($subscription['date_next'] <= date('Y-m-d')) { // Process payment and update next billing date } }}
Regularly optimize database tables for better performance.
-- Optimize all OpenCart tablesOPTIMIZE TABLE oc_product, oc_product_description, oc_category, oc_category_description, oc_customer, oc_order, oc_order_product, oc_session;-- Check table statusSHOW TABLE STATUS WHERE Name LIKE 'oc_%';
Run optimization during low-traffic periods as it may temporarily lock tables.
-- Delete old customer sessions (older than 7 days)DELETE FROM oc_session WHERE expire < DATE_SUB(NOW(), INTERVAL 7 DAY);-- Delete old customer activities (older than 90 days)DELETE FROM oc_customer_activity WHERE date_added < DATE_SUB(NOW(), INTERVAL 90 DAY);-- Delete old customer searches (older than 30 days)DELETE FROM oc_customer_search WHERE date_added < DATE_SUB(NOW(), INTERVAL 30 DAY);