Post by beeman » Wed Feb 22, 2017 10:49 am

After changing to https, when I view new orders an undefined error window pops up and I can't update the status of the order. Orders made prior to ssl are fine with no errors. I'm using Opencart 2.2.0, hope someone can help.

Newbie

Posts

Joined
Tue Nov 13, 2012 11:12 pm

Post by beeman » Fri Feb 24, 2017 4:44 am

A temporary solution is to go into the database and change each order's "store_url" back to "http://www.storeurl.com" from "https://www.storeurl.com"

Not sure why when store_url is https it causes the error.

Newbie

Posts

Joined
Tue Nov 13, 2012 11:12 pm

Post by victorj » Sun Feb 26, 2017 6:06 am

oc version 2.2 has a bug regarding ssl.
You just need to fix a couple off files to make it work.

find:
system/library/url.php
open in editor

search

Code: Select all

public function link($route, $args = '', $secure = false) {
        if ($this->ssl && $secure) {
            $url = 'https://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route;
        } else {
            $url = 'http://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route;
        }
change to

Code: Select all

public function link($route, $args = '', $secure = false) {
        if ($this->ssl && $secure) {
            $url = 'https://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route;
        } else {
            $url = 'https://' . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['SCRIPT_NAME']), '/.\\') . '/index.php?route=' . $route;
        
}

find admin/controller/sale/order.php

around line 850

Code: Select all

$data['store_url'] = $this->request->server['HTTPS'] ? str_replace("http", "https", $order_info['store_url']) : $order_info['store_url'];
change to

Code: Select all

$data['store_url'] = $this->request->server['HTTPS'] ? preg_replace("/^http:\/\//", "https://", $order_info['store_url']) : $order_info['store_url'];

Koeltechnische deurrubbers eenvoudig online op maat bestellen.
Alle niet stekplichtige onderdelen zoals scharnieren, sloten, randverwarming en verlichting voor alle typen koelingen en vriezers.
https://koelcel-onderdelen.com


User avatar
Expert Member

Posts

Joined
Sat Jun 25, 2011 4:09 am
Location - Alkmaar Holland

Post by knowband.plugins » Wed Mar 01, 2017 8:20 pm

This may be because you have not made changes to all files.

Have you changed the SSL variable as true in opencart/system/config/admin.php ?

You have to check if all pages in your admin panel are having SSL URL.

Regards,
Knowband Team

Opencart Plugins: Knowband Store
Email: support@knowband.com


User avatar
Active Member

Posts

Joined
Thu Aug 04, 2016 2:56 pm

Post by floatleft » Mon Mar 06, 2017 6:54 am

@victorj, this was exactly what I've been seeking! I followed the textbook changes for SSL implementation and after numerous htaccess mods I had to step away from resolving this. I found your post today and am happy to report our SSL resolves on the front side and on the admin. Thank you.

Newbie

Posts

Joined
Fri Jun 05, 2015 4:10 pm
Who is online

Users browsing this forum: No registered users and 12 guests