Overview
OpenCart manages three types of users:
- Admin Users: Access to admin panel (staff, developers, agencies)
- Customers: Frontend users who make purchases
- Affiliates: Users who earn commission from referrals
Each user type has different management requirements and permissions.
Managing Admin Users
Admin users have access to your OpenCart admin panel and can manage store settings, products, orders, and more.
Adding Admin Users
Via Admin Panel
Navigate to Users Section
Admin Panel > System > Users > UsersClick Add New User
- Click the blue + button (top-right)
Enter User Details
General Tab:
- Username: Unique login name (e.g.,
john.smith) - User Group: Select permission level (see User Groups section)
- First Name: User's first name
- Last Name: User's last name
- E-Mail: Valid email address
- Image: Optional profile picture
- Status: Enabled/Disabled
Password Tab:
- Password: Strong password (8+ characters, mix of letters, numbers, symbols)
- Confirm: Re-enter password
- Username: Unique login name (e.g.,
Save User
- Click blue Save button (top-right)
- Success message appears
Via Database (Emergency Access)
If locked out of admin panel:
-- Connect to your database via phpMyAdmin or MySQL client
-- Insert new admin user
INSERT INTO oc_user (
user_group_id,
username,
password,
salt,
firstname,
lastname,
email,
status,
date_added
) VALUES (
1, -- User Group ID (1 = Administrator)
'emergency_admin', -- Username
SHA1(CONCAT('salt123', SHA1(CONCAT('salt123', SHA1('Password123!'))))), -- Password
'salt123', -- Salt
'Emergency', -- First Name
'Admin', -- Last Name
'admin@yourstore.com', -- Email
1, -- Status (1 = Enabled)
NOW() -- Date Added
);
Important: Change 'Password123!' and 'salt123' to your desired values.
Better password generation:
-- Generate password with random salt
SET @salt = MD5(RAND());
SET @password = 'YourSecurePassword123!';
INSERT INTO oc_user (
user_group_id,
username,
password,
salt,
firstname,
lastname,
email,
status,
date_added
) VALUES (
1,
'emergency_admin',
SHA1(CONCAT(@salt, SHA1(CONCAT(@salt, SHA1(@password))))),
@salt,
'Emergency',
'Admin',
'admin@yourstore.com',
1,
NOW()
);
Editing Admin Users
Navigate to Users List
Admin Panel > System > Users > UsersFind User to Edit
- Use filter/search if needed
- Click Edit button (pencil icon)
Update Information
- Change any fields as needed
- Note: Cannot change username after creation (delete and recreate instead)
Save Changes
- Click Save button
Disabling Admin Users
Instead of deleting, disable users to preserve audit trail:
Edit User
Admin Panel > System > Users > Users > EditChange Status
- Status: Disabled
- Click Save
Result: User cannot log in but user record remains.
Deleting Admin Users
Warning: Deleting removes user permanently. Consider disabling instead.
Navigate to Users
Admin Panel > System > Users > UsersSelect User(s)
- Check checkbox next to user(s) to delete
- Or use checkbox in header to select all
Click Delete
- Click red Delete button (trash icon)
- Confirm deletion
Via Database:
-- Delete specific user
DELETE FROM oc_user WHERE username = 'username_here';
-- Delete user by ID
DELETE FROM oc_user WHERE user_id = 5;
-- View users before deleting
SELECT user_id, username, email, status FROM oc_user;
Password Reset for Admin Users
Self-Service Reset (Email)
Admin Login Page
https://yourstore.com/admin/Click "Forgotten Password"
- Enter your email address
- Click Reset Password
- Check email for reset link
Manual Password Reset (Database)
-- Reset password for specific user
SET @salt = MD5(RAND());
SET @password = 'NewSecurePassword123!';
UPDATE oc_user
SET
password = SHA1(CONCAT(@salt, SHA1(CONCAT(@salt, SHA1(@password))))),
salt = @salt
WHERE username = 'admin';
-- Verify update
SELECT username, email FROM oc_user WHERE username = 'admin';
Via PHP File (Temporary)
File: reset_admin_password.php (place in OpenCart root)
<?php
// DELETE THIS FILE AFTER USE!
// Load OpenCart config
require_once('config.php');
// Database connection
$mysqli = new mysqli(DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
if ($mysqli->connect_error) {
die('Connection failed: ' . $mysqli->connect_error);
}
// Configuration
$username = 'admin'; // Username to reset
$new_password = 'NewSecurePassword123!'; // New password
// Generate salt
$salt = bin2hex(random_bytes(9));
// Hash password (OpenCart 3.x method)
$password_hash = sha1($salt . sha1($salt . sha1($new_password)));
// Update database
$stmt = $mysqli->prepare('UPDATE ' . DB_PREFIX . 'user SET password = ?, salt = ? WHERE username = ?');
$stmt->bind_param('sss', $password_hash, $salt, $username);
if ($stmt->execute()) {
echo "Password reset successful for user: $username<br/>";
echo "New password: $new_password<br/>";
echo "<br/><strong>DELETE THIS FILE IMMEDIATELY!</strong>";
} else {
echo "Error: " . $stmt->error;
}
$stmt->close();
$mysqli->close();
?>
Usage:
- Upload to OpenCart root
- Visit:
https://yourstore.com/reset_admin_password.php - DELETE FILE IMMEDIATELY after use
Managing Customers
Customers are frontend users who browse products and make purchases.
Adding Customers
Via Admin Panel
Navigate to Customers
Admin Panel > Customers > CustomersClick Add New
- Click blue + button
Enter Customer Details
General Tab:
- First Name: Customer's first name
- Last Name: Customer's last name
- E-Mail: Valid email (used for login)
- Telephone: Phone number
- Newsletter: Subscribe to newsletter (Yes/No)
- Customer Group: Default, Wholesale, etc.
- Status: Enabled/Disabled
- Safe: Mark customer as safe (not flagged for fraud)
Password Tab:
- Password: Customer's password
- Confirm: Re-enter password
Address Tab:
- Click Add Address button
- Fill in address details
- Can add multiple addresses
Save Customer
- Click Save button
Via Frontend Registration
Customers can register themselves:
Customer visits store
https://yourstore.com/Click Account > Register
- Or:
https://yourstore.com/index.php?route=account/register
- Or:
Fill Registration Form
- First Name, Last Name
- E-Mail, Telephone
- Password, Confirm Password
- Address information
- Privacy Policy agreement
Submit Registration
- Account created and active (if auto-approval enabled)
- Or pending approval (if manual approval required)
Configure Registration Settings:
Admin Panel > System > Settings > Edit Store > Option tab
Account Terms: Select terms & conditions page
Customer Group: Default group for new customers
Customer Approval: Automatic or Manual
Editing Customers
Navigate to Customers
Admin Panel > Customers > CustomersFind Customer
- Use filters: Name, E-Mail, Customer Group, Status
- Click Filter button
Edit Customer
- Click Edit button (pencil icon)
- Modify details
- Click Save
Disabling Customers
Prevent login without deleting account:
Edit Customer
Admin Panel > Customers > Customers > EditChange Status
- Status: Disabled
- Click Save
Deleting Customers
Warning: Deleting customer removes all associated data (orders, addresses, reviews).
Navigate to Customers
Admin Panel > Customers > CustomersSelect Customer(s)
- Check checkbox next to customer(s)
Delete
- Click Delete button (trash icon)
- Confirm deletion
Best Practice: Disable instead of delete to preserve order history.
Customer Password Reset
Self-Service (Frontend)
Customer clicks "Forgotten Password"
https://yourstore.com/index.php?route=account/forgottenEnter Email Address
- Click Continue
- Reset link sent to email
Admin Reset (Backend)
Edit Customer
Admin Panel > Customers > Customers > EditPassword Tab
- Enter new password
- Confirm password
- Click Save
Notify Customer
- Email customer with new password (manual)
Managing Affiliates
Affiliates earn commission from referred sales.
Enabling Affiliate System
Admin Panel > System > Settings > Edit Store > Option tab
Affiliate: Enable
Affiliate Terms: Select affiliate terms page
Affiliate Commission: Set default commission percentage
Adding Affiliates
Via Admin Panel
Navigate to Affiliates
Admin Panel > Marketing > AffiliatesClick Add New
- Click blue + button
Enter Affiliate Details
General Tab:
- First Name: Affiliate's first name
- Last Name: Affiliate's last name
- E-Mail: Email address
- Telephone: Phone number
- Website: Affiliate's website (optional)
- Commission: Percentage (overrides default)
- Status: Enabled/Disabled
Payment Tab:
- Tax ID: Tax identification
- Payment Method: Cheque, PayPal, Bank Transfer, etc.
- Cheque Payee Name: For cheque payments
- PayPal Email: For PayPal payments
- Bank Account Details: For bank transfers
Save Affiliate
- Click Save
Via Frontend Application
Affiliates can apply themselves:
Navigate to Affiliate Application
https://yourstore.com/index.php?route=affiliate/registerFill Application Form
- Personal information
- Payment details
- Agree to terms
Submit Application
- Admin reviews and approves
- Affiliate receives notification
Approving Affiliate Applications
Admin Panel > Marketing > Affiliates
Find affiliate with Status: Disabled
Edit affiliate
Change Status: Enabled
Save
Deleting Affiliates
Admin Panel > Marketing > Affiliates
Select affiliate(s)
Click Delete button
Confirm deletion
Note: Deleting affiliate removes commission tracking history.
Bulk User Management
Export Users
Customers:
Admin Panel > System > Maintenance > Backup/Restore
Export table: oc_customer
Download SQL file
Via Extension:
Install export extension from OpenCart Marketplace:
- Export Import PRO by iSenseLabs
- Customer Export by Journal3
Import Users
Via SQL:
-- Import customers from CSV
LOAD DATA INFILE '/path/to/customers.csv'
INTO TABLE oc_customer
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS
(firstname, lastname, email, telephone, customer_group_id, status);
Via Extension:
Use import extension to bulk import customers from CSV/Excel.
Bulk Status Change
Via Database:
-- Disable all customers in specific group
UPDATE oc_customer
SET status = 0
WHERE customer_group_id = 3;
-- Enable all customers with specific email domain
UPDATE oc_customer
SET status = 1
WHERE email LIKE '%@example.com';
-- Disable inactive customers (no login in 2 years)
UPDATE oc_customer c
LEFT JOIN oc_customer_activity ca ON c.customer_id = ca.customer_id
SET c.status = 0
WHERE ca.date_added < DATE_SUB(NOW(), INTERVAL 2 YEAR)
OR ca.customer_id IS NULL;
Security Best Practices
Admin Users
Strong Passwords
- Minimum 12 characters
- Mix of uppercase, lowercase, numbers, symbols
- Avoid dictionary words
Unique Usernames
- Don't use "admin" (common target)
- Use unique, non-obvious usernames
Limit Admin Accounts
- Create only necessary admin users
- Delete/disable unused accounts
Use User Groups
- Assign minimum required permissions
- Don't give Administrator access unless necessary
-
- Install 2FA extension
- Recommended: Google Authenticator extension
Monitor Login Attempts
Admin Panel > System > Users > User LoginReview failed login attempts regularly.
Customers
Approval Process
- Enable manual approval for high-risk stores
- Review new registrations
Fraud Detection
- Monitor customer activity
- Flag suspicious accounts
- Use fraud detection extensions
GDPR Compliance
- Collect only necessary data
- Provide data export/deletion
- Enable consent checkboxes
Troubleshooting
Can't Log In to Admin
Solutions:
- Clear browser cache and cookies
- Try different browser/incognito mode
- Check username/password (case-sensitive)
- Reset password via database (see Password Reset section)
- Check user status in database:
Status should beSELECT username, email, status FROM oc_user;1(enabled)
Customer Can't Register
Check:
Registration enabled:
System > Settings > Edit > Option tab Account: Enable registrationEmail configuration:
System > Settings > Edit > Mail tab Verify mail settings correctCheck for JavaScript errors (F12 console)
Disable required fields temporarily to test
Affiliate Commission Not Tracking
Solutions:
Verify affiliate enabled:
System > Settings > Edit > Option tab Affiliate: EnableCheck affiliate status: Must be "Enabled"
Verify tracking code:
Affiliate > Tracking Add tracking code to affiliate linksCheck commission settings:
Marketing > Affiliates > Edit > Commission Set percentage > 0