Post by karak » Thu Jul 28, 2016 12:43 pm

OC version 2.2.0.0

I just did a new install of opencart and wanted to run-through the process of ordering an item, processing that order, etc - to familiarize myself with the application. Placing the order went easily enough, but when I tried to update the status of that order I got an error - a pop up window that said 'error undefined'. The developer tools console shows mixed content errors:

Code: Select all

jquery-2.1.1.min.js:4 Mixed Content: The page at 'https://www.example.com/store/admin/index.php?route=extension/installer&token=cGp1sGTV0LcBnj8q4bvMHOgNaYKIz5pg' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.example.com/store/admin/index.php?route=extension/installer/unzip&token=cGp1sGTV0LcBnj8q4bvMHOgNaYKIz5pg'. This request has been blocked; the content must be served over HTTPS.

Code: Select all

XMLHttpRequest cannot load http://www.example.com/store/admin/index.php?route=extension/installer/unzip&token=cGp1sGTV0LcBnj8q4bvMHOgNaYKIz5pg. Failed to start loading.
I'm running this on apache2 and I have an ssl redirect on the :80 vhost to force everything to https, and I'm hoping someone can tell me how to fix these calls so that the endpoints reference https instead as I think that would resolve these errors and maybe my issues with installing extensions and updating orders.

Like I said this is a brand new install so if it's easiest to start over that's not an issue.
Last edited by karak on Thu Jul 28, 2016 1:52 pm, edited 1 time in total.

Newbie

Posts

Joined
Thu Jul 28, 2016 12:24 pm

Post by Qphoria » Thu Jul 28, 2016 12:59 pm

This means you are forcing your htaccess to load "https" but your config.php file for HTTP_SERVER and/or HTTPS_SERVER is set to "http"

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by karak » Thu Jul 28, 2016 1:13 pm

Qphoria wrote:This means you are forcing your htaccess to load "https" but your config.php file for HTTP_SERVER and/or HTTPS_SERVER is set to "http"
First off thanks for the very quick response!

I looked in my config.php and see these lines:

Code: Select all

// HTTP
define('HTTP_SERVER', 'https://www.example.com/store/');

// HTTPS
define('HTTPS_SERVER', 'https://www.example.com/store/');

Newbie

Posts

Joined
Thu Jul 28, 2016 12:24 pm

Post by karak » Thu Jul 28, 2016 1:33 pm

I found this snippet in another thread:
Re: Https Mixed content error
If this is 2.2.0.0:
Look in upload/system/config/catalog.php and upload/system/config/admin.php.
Set
$_['site_ssl'] = false;
to
$_['site_ssl'] = true;
by budgetneon
Thu Mar 17, 2016 5:53 am
and that resolved my extension installation issue, but the order update still seems to be busted... I did notice this error:

Code: Select all

jquery-2.1.1.min.js:4 XMLHttpRequest cannot load httpss://www.thehoneystraw.com/store/index.php?route=api/login. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.k.cors.a.crossDomain.send @ jquery-2.1.1.min.js:4n.extend.ajax @ jquery-2.1.1.min.js:4(anonymous function) @ index.php?route=sale/order/info&token=iONFFrxf86qwp7neArj2MpvpRTPgtDiz&order_id=1:672
Any idea why the protocol identifier is 'httpss' ?

Newbie

Posts

Joined
Thu Jul 28, 2016 12:24 pm

Post by karak » Thu Jul 28, 2016 1:51 pm


Newbie

Posts

Joined
Thu Jul 28, 2016 12:24 pm

Post by labeshops » Thu Jul 28, 2016 7:54 pm

Thank you!! That also fixed my problem with the permission denied on the api!!

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by straightlight » Thu Jul 28, 2016 9:15 pm

Thank you all for your feedbacks. I wlll add this to the docs.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by straightlight » Thu Jul 28, 2016 9:18 pm

A sticky topic has now been created in the Bug Reports section of the forum: http://forum.opencart.com/viewtopic.php?f=191&t=165865 so for all users to notice the current fix.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by karak » Thu Jul 28, 2016 10:40 pm

labeshops wrote:
Thank you!! That also fixed my problem with the permission denied on the api!!
Good stuff!

Newbie

Posts

Joined
Thu Jul 28, 2016 12:24 pm

Post by samsotiriadis » Sat Jul 30, 2016 1:56 am


Finally some excellent progress!
Is there any chance this could work / adjusted for 2.0.1.1 version too?

New member

Posts

Joined
Fri Sep 12, 2014 6:20 pm

Post by straightlight » Sat Jul 30, 2016 2:04 am

samsotiriadis wrote:

Finally some excellent progress!
Is there any chance this could work / adjusted for 2.0.1.1 version too?
Simply look for the mentioned lines on the same source files mentioned from the GitHub link and see if you can replace the entries accordingly. ;)

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by samsotiriadis » Sat Jul 30, 2016 2:52 am

Have done and the file structure is rather different.

New member

Posts

Joined
Fri Sep 12, 2014 6:20 pm

Post by straightlight » Sat Jul 30, 2016 3:39 am

samsotiriadis wrote:Have done and the file structure is rather different.
It would, then, be suggested to upgrade to the latest version of Opencart before applying these changes.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by samsotiriadis » Mon Aug 01, 2016 9:20 pm

No need. Thanks to some chaps here that fixed this and working on 2.0.1.1
Cheerio

New member

Posts

Joined
Fri Sep 12, 2014 6:20 pm

Post by EvolveWebHosting » Sat Aug 20, 2016 5:59 am

Thanks for the fix. That was annoying!

2 Week FREE Trial of our Shared Hosting plans (DIrectAdmin or cPanel) for new customers
2 Week FREE Trial of Astra Firewall and Malware Scanner
Visit our website for full details and to start your trial today - www.evolvewebhost.com


User avatar
Active Member

Posts

Joined
Fri Mar 27, 2015 11:13 pm
Location - Denver, Colorado, USA

Post by 19ninety » Thu Oct 06, 2016 6:05 pm

What do I need to replace, I've looked through orders.php and can't find the line I'm supposed to remove as highlighted on github:

Code: Select all

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

Code: Select all

$data['store_url'] = $this->request->server['HTTPS'] ? HTTPS_CATALOG : HTTP_CATALOG;
at line 851, uploaded, refreshed but still get the API error when I try to change the order status. Using Version 2.1.0.1

New member

Posts

Joined
Wed Sep 26, 2012 1:51 am

Post by 19ninety » Fri Oct 07, 2016 3:00 pm

Any ideas anyone?

New member

Posts

Joined
Wed Sep 26, 2012 1:51 am

Post by 19ninety » Sun Oct 30, 2016 5:47 pm

Installing Prestashop fixed this for me. Cya OpenCart, it's been ..... "educational".

New member

Posts

Joined
Wed Sep 26, 2012 1:51 am

Post by cyclops12 » Sun Oct 30, 2016 6:46 pm

19ninety wrote:Installing Prestashop fixed this for me. Cya OpenCart, it's been ..... "educational".
Good luck with prestashop.....but be aware you will still have problems when you come to upgrade......just read ps forums :)

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am
Who is online

Users browsing this forum: No registered users and 61 guests