Hello friends, today I will show you how to enable SSL connection in OpenCart. In my previous blog post I show you the procedure to set cash on delivery process on opencart. Now we have to know about SSL. SSL (Secure Sockets Layer) is a standard security technology for establishing an encrypted link between a server and a client—typically a web server (website) and a browser; or a mail server and a mail client.

SSL allows sensitive information such as credit card numbers, social security numbers, and login credentials to be transmitted securely. Normally, data sent between browsers and web servers is sent in plain text—leaving you vulnerable to eavesdropping. If an attacker is able to intercept all data being sent between a browser and a web server they can see and use that information. More specifically, SSL is a security protocol. Protocols describe how algorithms should be used; in this case, the SSL protocol determines variables of the encryption for both the link and the data being transmitted.



Note:You should make sure your domain must have SSL certificate installed. If you do not have a dedicated SSL installed, this configuration will cause issues with accessing your OpenCart dashboard and the login/checkout pages of your store.

Steps to enable SSL connection in OpenCart

Step 1: Log into the OpenCart Dashboard

At first go to your website admin panel by putting your site name/admin(like www.myonlineshop.com/admin). Now give your admin username and password and click “Login” button. Now you are in website admin panel. Now mouse over “System” menu and click on “settings” sub menu. Please see the below image.

Enable SSL connection in OpenCart

Step2: Go to System > Settings and click on “Server” tab

Now mouse hover “System” menu and click on “Settings”. Now you click on “Edit” link beside your store name. Now you are in site settings page where you see various tabs like “General”, “Store” etc. Click on “Server” tab and check the “Yes” radio button to use SSL.

Enable SSL connection in OpenCart

Then Click “Save” button from right corner. Now you need to open your cPanel.

Step3: Open cPanel and change config.php file on your website root directory

Log into cPanel and go to File Manager. Now navigate to your OpenCart website directory. Open (Edit or Code Editor) the configuration file (config.php). Right click on “config.php” and select “Edit” option. Look for the lines below // HTTPS that looks similar to this:

define(‘HTTPS_SERVER’, ‘http://yourstore.com/’);
define(‘HTTPS_IMAGE’, ‘http://yourstore.com/image/’);

Edit the HTTPS settings to reflect your SSL URL path. For example:

define(‘HTTPS_SERVER’, ‘https://yourstore.com’);
define(‘HTTPS_IMAGE’, ‘https://yourstore.com/image/’);

and finally save changes and close the config.php file

Step4: Go to your website Admin folder config.php file

Go to the “Admin” folder. Open (Edit or Code Editor) the configuration file (config.php). Right click on “config.php” and select “Edit” option. Look for the lines below // HTTPS that looks similar to this:

define(‘HTTPS_SERVER’, ‘http://yourstore.com/admin/’);
define(‘HTTPS_CATALOG’, ‘http://yourstore.com/’);
define(‘HTTPS_IMAGE’, ‘http://yourstore.com/image/’);

Edit the HTTPS settings to reflect your SSL URL path. For example:

define(‘HTTPS_SERVER’, ‘https://yourstore.com/admin/’);
define(‘HTTPS_CATALOG’, ‘https://yourstore.com/’);
define(‘HTTPS_IMAGE’, ‘https://yourstore.com/image/’);

and finally save changes and close the config.php file

Now, you are done. Anytime you login to your dashboard or a visitor purchases a product it will force the SSL for security purposes.

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Enable SSL connection in OpenCart
Tagged on:
  • kapil vyas

    Great content regarding open-cart tutorials, thanks its really help me thanks.