To enable SSL in OpenCart, there are three areas to edit: The System Settings in the OpenCart Dashboard, the config.php file in the directory where you installed OpenCart, and the config.php file in your OpenCart Admin folder.
Enabling SSL in the OpenCart Dashboard
- Log into the OpenCart Dashboard
- Go to System > Settings
- Click on the Server tab
- Check the radio button to use SSL
Enabling SSL in the OpenCart directory config.php file
- Log into cPanel and go to File Manager
- Navigate to your OpenCart installation directory
- Open (Edit or Code Editor) the configuration file (config.php)
- Look for the lines below // HTTPS that looks similar to this:
define('HTTPS_SERVER', 'http://mydomain.com/');
define('HTTPS_IMAGE', 'http://mydomain/image/'); - Edit the HTTPS settings to reflect your SSL URL path. For example:
define('HTTPS_SERVER', 'https://mydomain.com/');
define('HTTPS_IMAGE', 'https://mydomain/image/'); - Save changes and close the config.php file
Enabling SSL in the OpenCart Admin folder config.php file
- Go to the “Admin” folder
- Open (Edit or Code Editor) the configuration file (config.php)
- Look for the lines below // HTTPS that looks similar to this:
define('HTTPS_SERVER', 'http://mydomain.com/admin/');
define('HTTPS_CATALOG', 'http://mydomain.com/');
define('HTTPS_IMAGE', 'http://mydomain.com/image/'); - Edit the HTTPS settings to reflect your SSL URL path. For example:
define('HTTPS_SERVER', 'https://mydomain.com/admin/');
define('HTTPS_CATALOG', 'https://mydomain.com/');
define('HTTPS_IMAGE', 'https://mydomain.com/image/'); - Save changes and close the config.php file