You should make sure you have a SSL certificate installed for your domain. 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.

Most payment processors such as Authorize.net will require you to purchase a SSL. You may want to purchase and install one prior to fully setting up your shopping cart.

Please see our tutorials if you need more information on what a SSL is and how to purchase one. Please keep in mind OpenCart does not support the use of the shared SSL certificate.

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

  1. Log into the OpenCart Dashboard
  2. Go to System > Settings
  3. Click on the Server tab
  4. Check the radio button to use SSL

Enabling SSL in the OpenCart directory config.php file

  1. Log into cPanel and go to File Manager
  2. Navigate to your OpenCart installation directory
  3. Open (Edit or Code Editor) the configuration file (config.php)
  4. Look for the lines below // HTTPS that looks similar to this:

    define('HTTPS_SERVER', 'http://opencart.inmotiontesting.com/');
    define('HTTPS_IMAGE', 'http://opencart.inmotiontesting.com/image/');

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

    define('HTTPS_SERVER', 'https://opencart.inmotiontesting.com/');
    define('HTTPS_IMAGE', 'https://opencart.inmotiontesting.com/image/');

  6. Save changes and close the config.php file

Enabling SSL in the OpenCart Admin folder config.php file

  1. Go to the “Admin” folder
  2. Open (Edit or Code Editor) the configuration file (config.php)
  3. Look for the lines below // HTTPS that looks similar to this:

    define('HTTPS_SERVER', 'http://opencart.inmotiontesting.com/admin/');
    define('HTTPS_CATALOG', 'http://opencart.inmotiontesting.com/');
    define('HTTPS_IMAGE', 'http://opencart.inmotiontesting.com/image/');

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

    define('HTTPS_SERVER', 'https://opencart.inmotiontesting.com/admin/');
    define('HTTPS_CATALOG', 'https://opencart.inmotiontesting.com/');
    define('HTTPS_IMAGE', 'https://opencart.inmotiontesting.com/image/');

  5. Save changes and close the config.php file

Now, anytime you login to your dashboard or a visitor purchases a product it will force the SSL for security purposes. If you need further assistance please feel free to ask a question on our support center.

Continued Education in Course 103: Setting up a Payment Gateway
You are viewing Section 3: How to enable SSL connection in OpenCart
Section 2: Setting up Payment Modules in OpenCart

Support Center Login


Social Media Login

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2014-04-23 3:07 am

Hello,

Thank you for sharing the detailed steps.

However, ever since my host has installed SSL on the server, except for home page no images are loading on the website..none on category page and none on product page.

 

Furthermore, when i followed your instructions to enable SSL on the website, on checkout page and in admin CSS & JS do not load and no images are getting loaded on the webpage!

 

What could be the problem here?? 

Staff
11,156 Points
2014-04-23 8:11 am
There could be multiple reasons as to why you are seeing this. Could you provide the URL where you are seeing this to investigate?
2015-01-30 2:33 am
Hi, thx for veery helpful post! I have same problem too. I did everything according to instructions but https is only in admin area and during the order phase. In main page https is no full (with yellow triangle), google chrome blocks some scripts from untrusted sources. Need a help! Here is my files:

config.php:
// HTTP
define('HTTP_SERVER', 'http://24slim.biz/');

// HTTPS
define('HTTPS_SERVER', 'https://24slim.biz/');

// DIR
define('DIR_APPLICATION', '/xxx/xxx/xxx/htdocs/www/catalog/');
define('DIR_SYSTEM', '/xxx/xxx/xxx/htdocs/www/system/');
define('DIR_DATABASE', '/xxx/xxx/xxx/htdocs/www/system/database/');
define('DIR_LANGUAGE', '/xxx/xxx/xxx/htdocs/www/catalog/language/');
define('DIR_TEMPLATE', '/xxx/xxx/xxx/htdocs/www/catalog/view/theme/');
define('DIR_CONFIG', '/xxx/xxx/xxx/htdocs/www/system/config/');
define('DIR_IMAGE', '/xxx/xxx/xxx/htdocs/www/image/');
define('DIR_CACHE', '/xxx/xxx/xxx/htdocs/www/system/cache/');
define('DIR_DOWNLOAD', '/xxx/xxx/xxx/htdocs/www/download/');
define('DIR_LOGS', '/xxx/xxx/xxx/htdocs/www/system/logs/');

admin/config.php:
// HTTP
define('HTTP_SERVER', 'http://24slim.biz/admin/');
define('HTTP_CATALOG', 'http://24slim.biz/');

// HTTPS
define('HTTPS_SERVER', 'https://24slim.biz/admin/');
define('HTTPS_CATALOG', 'https://24slim.biz/');

// DIR
define('DIR_APPLICATION', '/xxx/xxx/xxx/htdocs/www/admin/');
define('DIR_SYSTEM', '/xxx/xxx/xxx/htdocs/www/system/');
define('DIR_DATABASE', '/xxx/xxx/xxx/htdocs/www/system/database/');
define('DIR_LANGUAGE', '/xxx/xxx/xxx/htdocs/www/admin/language/');
define('DIR_TEMPLATE', '/xxx/xxx/xxx/htdocs/www/admin/view/template/');
define('DIR_CONFIG', '/xxx/xxx/xxx/htdocs/www/system/config/');
define('DIR_IMAGE', '/xxx/xxx/xxx/htdocs/www/image/');
define('DIR_CACHE', '/xxx/xxx/xxx/htdocs/www/system/cache/');
define('DIR_DOWNLOAD', '/xxx/xxx/xxx/htdocs/www/download/');
define('DIR_LOGS', '/xxx/xxx/xxx/htdocs/www/system/logs/');
define('DIR_CATALOG', '/xxx/xxx/xxx/htdocs/www/catalog/');

.htaccess:
RewriteCond %{HTTP_HOST} ^www.24slim.biz$ [NC]
RewriteRule ^(.*)$ http://24slim.biz/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\ HTTP/
RewriteRule ^index\.html$ / [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ / [R=301,L]
RewriteCond %{QUERY_STRING} ^route=common/home$
RewriteCond %{REQUEST_METHOD} !^POST$
RewriteRule ^index\.php$ http://%{HTTP_HOST}? [R=301,L]
RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]



n/a Points
2014-07-10 7:09 pm

Thank you soooo much for posting this information... I broke my website several times and had to restore it whilst trying to get ssl up and running...  you're my hero !

n/a Points
2014-07-14 10:32 am

Thanks for this!

I have a problem though.  The homepage and non of the category or product pages are pointing to HTTPS, just a few other pages such as account, logic, etc are working.

Staff
14,278 Points
2014-07-14 11:06 am
Hello Mark,

Thank you for your question. After enabling your SSL in the 3 locations, have you tried clearing your browser cache, or testing on a different computer?

If you have any further questions, feel free to post them below.
Thank you,

-John-Paul
n/a Points
2014-08-02 1:40 pm

Hi dear, 

I followed all the instruction above but my store front is not pointing to https only my website admin area is pointing to https.

my website is scarletlove.com  please check and help me.

Staff
24,690 Points
2014-08-04 10:20 am
Hello Ashish,

I checked and your site displays fine using the https version. This article describes how to enable it, which it appears you did. It does not, however, force https when the user arrives on the site.

Kindest Regards,
Scott M
n/a Points
2014-09-03 4:36 am

Hi Im trying to get the Facebook store basic module to work and it requires ssl.

ive followed the instructions, no https happens and I cant login to the admin any more if the config.php in the admin folder is set to https://.

www.thesleepingcloud.co.uk

any ideas?

many thanks

Dave :)

Staff
14,278 Points
2014-09-03 12:55 pm
Hello Dave,

Thank you for your question. We are happy to help, but will need some additional information. Did you change the URL in all 3 areas?

When i go to your site, it forces me to go to:
http://thesleepingcloud.co.uk/

This usually means that the url is set as:
http://thesleepingcloud.co.uk/

If you have any further questions, feel free to post them below.

Thank you,
John-paul
n/a Points
2014-09-03 6:27 pm

Hi,

Thanks for sharing this but I'm still experiencing some major issues with my SSL configuration.

Can anyone please get in touch to help me reslove my SSL issues. I configured the SSL and now I've lost images on my homepage and three other pages - also SSL doesn't seem to have worked on everypage! I'm so desperate to reslove this.

Staff
22,245 Points
2014-09-03 6:41 pm
Hello Leo,

Our apologies for the problems you're having with SSL in your OpenCart installation. Unfortunately, the support we provide here is done in replies to posts here within the Support Center. If you wish for us to help you, then please provide specific information on the problem you're having (URL and or steps to duplicate a specific problem) and we can investigate it further.

Lost images are typically the result of broken links. You need to look at the paths for those images and determine WHY they aren't working. SSL is generally based on a particular domain. If you are inspecting to see why a page is not being entirely secured, then it's generally because some link or graphic or element on your website is not using the SSL in the URL.

I hope this helps provide some insight for the issue. Our apologies that we cannot provide private support for the issue. If you are a customer with InMotion Hosting, then you can submit a support ticket or contact our technical support department for support without having to post any information in our support center.

Kindest regards,
Arnel C.
n/a Points
2014-09-06 1:17 pm

What about this case, i have got a working cert for www.example.com , now i want to add opencart to www.example.com/shop , do i need to buy a new certificate ? or it should work with the example.com cert ? so far ssl is on but i get "server address does not match the certificate url.any idea ? thanksKarl

Staff
14,278 Points
2014-09-08 9:16 am
Hello Karl,

Thank you for your SSL question. Since /shop is just a folder (within www.example.com), your SSL will still work for it.

Since the SSL must match the domain exactly, I recommend checking your SSL for spelling mistakes.

You can use a tool such as the SSL Checker to review your SSL information.

If you have any further questions, feel free to post them below.

Thank you,
John-Paul
n/a Points
2014-11-04 4:57 pm

Thank you very much for this article. I have a problem with open cart. After the implementation of SSL on my website (marceloflondon.com), the add to cart button no longer works, the login (after valid username and password) doesn't do anything, the register field no longer function. What do you think has gone wrong? Helppppp.

Staff
11,156 Points
2014-11-04 5:30 pm
Could you provide me a link to your site so that I may replicate the issue?
n/a Points
2014-11-24 11:15 am
I don't think this needs any improvement. This article solved all the problems I had with my store not displaying properly when I used https://. I was getting frustrated so I'm glad I was referred to this article. It did the trick!
n/a Points
2014-12-12 5:12 am

Hello,

I just want to know,How much to buy a SSL from Inmotionhosting?

Of course ,if I buy a Inmotionhosting host.

Best

Staff
11,156 Points
2014-12-12 10:12 am
SSL certificates are currently $99 per year with a one-time $25 installation fee. You can find more information within our article on purchasing an SSL certificate.
n/a Points
2015-01-26 3:55 pm
None of what is on here worked for me i tried everything recommended here to no avail, and no help from tech support,other than read this article
Staff
14,278 Points
2015-01-30 11:13 am
Hello dale,

Thank you for contacting us. We are happy to help you, but will need some additional information.

What happens when you follow the guide above? Were you able to update the URL in all 3 places (Enabling SSL in the OpenCart Dashboard, Enabling SSL in the OpenCart directory config.php file, )?

Do you get any errors? What are they?

Have you tried Clearing your Browser cache before testing?

If you have any further questions, feel free to post them below.

Thank you,
John-Paul
n/a Points
2015-02-03 1:47 am

The instruction works perfectly for me and it solve the issue of Certificate exception error i do see on my web browser. Thanks man

Staff
11,156 Points
2015-02-03 9:58 am
Have you purchased and installed an SSL certificate? If not, you may review our article on purchasing SSL certificates.
n/a Points
2015-02-23 3:47 pm

Hello, i have an issue.

When an user logs in my site it points to https, but when the logged user clicks on a category, it points to www, so the user status is lost, how can i solve this?

Staff
22,245 Points
2015-02-23 4:12 pm
Hello Pier,

If keeping the user within https will keep the status, then you can use this article: How to force a dedicated SSL using the .htaccess file. Bear in mind that this is for keeping a specific URL within "https". If you have a link in your website that goes elsewhere, then it will not be in HTTP, unless it is specified for that path.

I hope this helps to answer your question, please let us know if you require any further assistance.

Regards,
Arnel C.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

25 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!