To enable SSL in your OpenCart v.2, follow these simple steps
Step1. Activate HTTPS in config files
Edit files /confgi.php
and /admin/config.php
and ensure the HTTPS_SERVER
constant is defined and begins with https://
// HTTPS define('HTTPS_SERVER', 'http://yourdomain.com/');
in the example above the HTTPS_SERVER variable is set to http, which needs to be corrected as below:
// HTTPS define('HTTPS_SERVER', 'https://yourdomain.com/');
Step 2. Enable HTTPS via OpenCart admin console
Login to your OpenCart admin
and select the Use SSL radio button:
Save the configuration.
Set OpenCart to load over SSL
To make your entire website loading over SSL, update the HTTP_SERVER constant in your config.php and admin/config.php files. Change it from
// HTTP define('HTTP_SERVER', 'http://yourdomain.com/');
to
// HTTP define('HTTP_SERVER', 'https://yourdomain.com/');
Test your website still loading.