Page 1 of 1

Instruction - How To Enable SSL on Opencart 2.2.0.0

Posted: Wed May 25, 2016 5:49 am
by ojars26
Hi!

Older version Opencart steps 1-3 to enable SSL.
New version Opencart steps 1-5 to enable SSL

Hope it helps! :)

Step 1: Admin panel->System->Settings-(Action)Edit->Server->Use SSL->Yes "Save and Exit"
Step 2: yourshopfolder->config.php->

find line:

Code: Select all

// HTTPS
define('HTTPS_SERVER', 'http://www.yourshop.com/');
change to:

Code: Select all

// HTTPS
define('HTTPS_SERVER', 'https://www.yourshop.com/');
Step 3: yourshopfolder->admin->config.php->

find line:

Code: Select all

// HTTPS
define('HTTPS_SERVER', 'http://www.yourshop.com/admin/');
define('HTTPS_CATALOG', 'http://www.yourshop.com/');
change to:

Code: Select all

// HTTPS
define('HTTPS_SERVER', 'https://www.yourshop.com/admin/');
define('HTTPS_CATALOG', 'https://www.yourshop.com/');
Step 4: yourshopfolder->system->config->admin.php

find line:

Code: Select all

$_['site_ssl']          = false;
change to:

Code: Select all

$_['site_ssl']          = true;
Step 5: yourshopfolder->system->config->catalog.php

find line:

Code: Select all

$_['site_ssl']          = false;
change to:

Code: Select all

$_['site_ssl']          = true;
All Done! Ctrl+F5 refresh page if need!

Re: Instruction - How To Enable SSL on Opencart 2.2.0.0

Posted: Tue May 31, 2016 11:03 pm
by readconsult
It seems that this latest version of OpenCart (2.2.0.0) has many bugs related to the admin settings pages not actually changing system settings in the required files. This is my first version of OC and it has been like this for months, it was probably really easy to patch... why is an update taking so long?

Re: Instruction - How To Enable SSL on Opencart 2.2.0.0

Posted: Wed Jun 01, 2016 3:58 am
by pm-netti
readconsult wrote:It seems that this latest version of OpenCart (2.2.0.0) has many bugs related to the admin settings pages not actually changing system settings in the required files. This is my first version of OC and it has been like this for months, it was probably really easy to patch... why is an update taking so long?
Substantive SSL issue in 2.2.0.0 is replace 'http' to 'https'.
This file fix it:
https://github.com/pekka2/OpenCart-Migr ... .ocmod.xml

to this way:

Code: Select all

<file path="admin/controller/sale/order.php">
<operation>
<search><![CDATA[$this->request->server['HTTPS'] ? str_replace("http", "https", $order_info['store_url']) : $order_info['store_url'];]]></search>
<add position="replace"><![CDATA[$this->request->server['HTTPS'] ? str_replace("http://", "https://", $order_info['store_url']) : $order_info['store_url'];]]></add>
</operation>
</file>
This is fixed to Opencart next version.

Re: Instruction - How To Enable SSL on Opencart 2.2.0.0

Posted: Fri Jun 03, 2016 12:55 am
by nootkan
pm-netti wrote:
readconsult wrote:It seems that this latest version of OpenCart (2.2.0.0) has many bugs related to the admin settings pages not actually changing system settings in the required files. This is my first version of OC and it has been like this for months, it was probably really easy to patch... why is an update taking so long?
Substantive SSL issue in 2.2.0.0 is replace 'http' to 'https'.
This file fix it:
https://github.com/pekka2/OpenCart-Migr ... .ocmod.xml

to this way:

Code: Select all

<file path="admin/controller/sale/order.php">
<operation>
<search><![CDATA[$this->request->server['HTTPS'] ? str_replace("http", "https", $order_info['store_url']) : $order_info['store_url'];]]></search>
<add position="replace"><![CDATA[$this->request->server['HTTPS'] ? str_replace("http://", "https://", $order_info['store_url']) : $order_info['store_url'];]]></add>
</operation>
</file>
This is fixed to Opencart next version.
What file do we make the above changes to? Do I need to ignore the previous 5 steps and just follow the last post? I am also starting a new project using a ssl certificate and wish to nip the ssl issues in the bud before I start creating products etc.

Re: Instruction - How To Enable SSL on Opencart 2.2.0.0

Posted: Fri Jun 03, 2016 8:11 pm
by pm-netti
nootkan wrote:
pm-netti wrote:
readconsult wrote:It seems that this latest version of OpenCart (2.2.0.0) has many bugs related to the admin settings pages not actually changing system settings in the required files. This is my first version of OC and it has been like this for months, it was probably really easy to patch... why is an update taking so long?
Substantive SSL issue in 2.2.0.0 is replace 'http' to 'https'.
This file fix it:
https://github.com/pekka2/OpenCart-Migr ... .ocmod.xml

to this way:

Code: Select all

<file path="admin/controller/sale/order.php">
<operation>
<search><![CDATA[$this->request->server['HTTPS'] ? str_replace("http", "https", $order_info['store_url']) : $order_info['store_url'];]]></search>
<add position="replace"><![CDATA[$this->request->server['HTTPS'] ? str_replace("http://", "https://", $order_info['store_url']) : $order_info['store_url'];]]></add>
</operation>
</file>
This is fixed to Opencart next version.
What file do we make the above changes to? Do I need to ignore the previous 5 steps and just follow the last post? I am also starting a new project using a ssl certificate and wish to nip the ssl issues in the bud before I start creating products etc.
If some did this change:
find line:

Code: Select all

// HTTPS
define('HTTPS_CATALOG', 'http://www.yourshop.com/');
change to:

Code: Select all

// HTTPS
define('HTTPS_CATALOG', 'https://www.yourshop.com/');
Then inevitably collides with this, when SSL is 'yes':
In admin page sale/order javascript try open page 'httpss://www.yourshop.com/...'.
Recommed install bugs fix file.

Re: Instruction - How To Enable SSL on Opencart 2.2.0.0

Posted: Fri Jun 10, 2016 10:13 pm
by i2Paq

Re: Instruction - How To Enable SSL on Opencart 2.2.0.0

Posted: Sat Apr 28, 2018 2:46 pm
by bappidasgupta
Implementing SSL using Opencart 2.2.0.0 and Free CloudFlare Account

1. Register a CloudFlare account.

2. Add your domain with free plan.

3. Change domain nameserver with the ones provided by CloudFlare.

4. Click on Crypto menu option and do the following
  • Order SSL certificate.
  • Set Always use HTTPS to ON.
  • Set Require Modern TLS to ON.
  • Set Automatic HTTPS Rewrites to ON.
5. On OpenCart 2.2.0.0 admin panel, browse to System/Settings/Server option and set Use SSL to Yes.

6. On CPanel/Webmin
1. Edit .htaccess file in root folder

Code: Select all

   RewriteCond %{HTTP_HOST} ^domain.com$
   RewriteRule ^/?$ "http\:\/\/www\.domain\.com" [R=301,L]
with

Code: Select all

RewriteCond %{HTTPS_HOST} ^domain.com$
   RewriteRule ^/?$ "https\:\/\/www\.domain\.com" [R=301,L]
2. Edit config.php in root folder

Code: Select all

define('HTTPS_SERVER', 'http://www.domain.com/');
with

Code: Select all

define('HTTPS_SERVER', 'https://www.domain.com/');
3. Edit config.php in root/admin folder

Code: Select all

define('HTTPS_SERVER', 'http://www.domain.com/admin/');
   define('HTTPS_CATALOG', 'http://www.domain.com/');
with

Code: Select all

   define('HTTPS_SERVER', 'https://www.domain.com/admin/');
   define('HTTPS_CATALOG', 'https://www.domain.com/');

4. Edit admin.php, catalog.php, default.php and install.php in root/system/config folder

Code: Select all

   $_['site_ssl']          = false;
with

Code: Select all

  $_['site_ssl']          = true;

5. Edit catalog/controller/common/header.php and replace

Code: Select all

   $server = $this->config->get('config_ssl');
with

Code: Select all

$server = str_replace('http:', 'https:', $this->config->get('config_url'));