Activate SSL in OpenCart

This guide explains how to activate an SSL (TLS) certificate on an OpenCart store so that your shop runs over HTTPS (secure HTTP) and visitors see the padlock (lock icon) in their browser.

The guide assumes that you already have an SSL certificate for your domain. See our guide on SSL with Loopia if you need to obtain a certificate first.

Edit the OpenCart configuration files

To activate SSL you need to make changes in your config files. Each OpenCart installation has two files that must be updated. Use FTP to download the files, edit them locally on your PC and upload them again.

The two files you need to change are:

OpenCart config.php and admin/config.php files

Open both files and edit the following lines:

HTTP and HTTPS configuration lines in OpenCart config files

Note that the lines may differ slightly in your installation.

Change all occurrences of “http” to “https“. If you only want the cart and checkout secured with SSL, change only the lines under “//HTTPS” to “https“. We recommend, however, that all links be changed to “https“.

You may also see links that end in “loopiasecure.com”. These should be replaced with your own domain name, as shown below:

Replacing loopiasecure.com links with your own domain in OpenCart config

When you have made the changes, save the files and upload them back to their original locations.

Enable SSL in the OpenCart admin

Log in to your OpenCart admin. Under “Settings”, choose to edit your store and go to the section called “Server”.

OpenCart Server settings with Use SSL option

Set the option that says the site should use SSL and save the settings.

Verify the padlock in your browser

OpenCart store overview with SSL enabled

After saving the settings, log out and reload your website once or twice in your browser.

You should now see HTTPS and a padlock (lock icon) next to your domain name in the browser’s address bar.

Browser showing green padlock and HTTPS for the domain

If the padlock does not yet appear, the platform change may not have taken effect. Wait one to two hours and try visiting the website again.

Was this article helpful?

Related Articles