Page 1 of 1

SSL web: unable to put home banner images as https

Posted: Fri Feb 22, 2019 1:12 am
by supercoco
Hi,
I installed a SSL certificate and all went ok except 3 images at home page. That images are from the banner: http://prntscr.com/mo9lmj
Images affected: http://prntscr.com/mo9n1j
I tried everything, like upload same images when SSL went on, and desperate because it's impossible to get the green padlock in browers due that 3 banner images...
Web: https://bit.ly/2T6bGoy
So what could i do?
Thanks so much in advance!

Re: SSL web: unable to put home banner images as https

Posted: Fri Feb 22, 2019 7:05 am
by straightlight
Check your Developers Kit by hitting F12 function on your keyboard when uploading those 3 images. In the console tab, notice the appearing error messages.

Re: SSL web: unable to put home banner images as https

Posted: Fri Feb 22, 2019 10:07 pm
by supercoco
Hi,
I didn't got any error, and image still being http instead https (Image attached)

Re: SSL web: unable to put home banner images as https

Posted: Fri Feb 22, 2019 10:22 pm
by straightlight
Ensure your .htaccess, config.php and admin/config.php files are properly configured with the SSL protocol. Just configuring the .htaccess file is insufficient.

Re: SSL web: unable to put home banner images as https

Posted: Sat Feb 23, 2019 1:03 am
by supercoco
Of course i did both well, every content is https but that 3 images...Attaching config.php and admin/config.php files...
What should i try now?

Re: SSL web: unable to put home banner images as https

Posted: Sat Feb 23, 2019 1:05 am
by supercoco
Or may work to change the route manually with https instead http? If yes, where i can find that file to change? (banners)

Thanks in advance

Re: SSL web: unable to put home banner images as https

Posted: Sat Feb 23, 2019 2:09 am
by OSWorX
supercoco wrote:
Sat Feb 23, 2019 1:05 am
Or may work to change the route manually with https instead http? If yes, where i can find that file to change? (banners)

Thanks in advance
Simply edit the URLs inside the slideshow from http to https (or inside the HTML-module if this is used).
While I recommend my clients always not to use any protocol, instead define these URLs like this:

Instead:

Code: Select all

http://www.jflazartigue.es/image/galeria/acondicionador-regenerativo.jpg

Code: Select all

../image/galeria/acondicionador-regenerativo.jpg
or wherever your banner images are stored.

Defining this way will not display the images in the backend, but who needs that?

Re: SSL web: unable to put home banner images as https

Posted: Sat Feb 23, 2019 3:35 pm
by supercoco
Thanks for the reply, but where i can put the image route, if i only can change slideshow banner images uploading an image? (Image attached from banner manage section)

Re: SSL web: unable to put home banner images as https

Posted: Sat Feb 23, 2019 4:11 pm
by OSWorX
First of all, I have no mood to learn another language (screenshot).
Second, as it seems, you are using an older OpenCart version.
And finally, it seems that this is an extra installed extension.

So please, provide all infos needed (e.g. OpenCart Version, installed - and used - Extension) in a readable language.
Then - maybe - someone may help you.

Re: SSL web: unable to put home banner images as https

Posted: Sat Feb 23, 2019 6:04 pm
by supercoco
Hi again,

It's no my intention to ask to learn any languaje lol...i'm newbie here and on Opencart, so i don't know what to do to explain better or what technical details have i to provide.
About the Opencart version: 2.0.3.1
About the banner module, i think it's the default that comes with this Opencart version? (Image attached)
"Gestion de Banners" means "Manage Banners"

Thanks again

Re: SSL web: unable to put home banner images as https

Posted: Sat Feb 23, 2019 8:32 pm
by OSWorX
If it would be the 'normal' standard banner module, it would be not have an extra menu entry.
The standard Banner module is located under Extensions > Module > Banner
And the banner itself are located under System > Design > Banner where you add the route manual (as already described by me earlier).

But youe images are displaying something else - a Banner extension which is not standard.

Re: SSL web: unable to put home banner images as https

Posted: Sun Jun 21, 2020 5:15 pm
by Banastres
I had this problem recently. It's because the catalog/controller/module/banner.php is loading the HTTP_Server inside the PHP file for the URL image. This will cause mixed content errors while using SSL as you mentioned above. Make sure the HTTPS_SERVER is set in the config.php.

Then open catalog/controller/module/banner.php and find: HTTP_SERVER change to HTTPS_SERVER:

Code: Select all

		foreach ($results as $result) {
			if (file_exists(DIR_IMAGE . $result['image'])) {
				$this->data['banners'][] = array(
					'title' => $result['title'],
					'link'  => $result['link'],
					'image' => HTTPS_SERVER . 'image/' . $result['image'],
				);
			}
		}
The mixed content errors for the banners will now be fixed, as they will load over HTTPS.

Re: SSL web: unable to put home banner images as https

Posted: Sun Jun 21, 2020 6:54 pm
by OSWorX
Banastres wrote:
Sun Jun 21, 2020 5:15 pm
I had this problem recently. It's because the catalog/controller/module/banner.php is loading the HTTP_Server inside the PHP file for the URL image. This will cause mixed content errors while using SSL as you mentioned above. Make sure the HTTPS_SERVER is set in the config.php.

Then open catalog/controller/module/banner.php and find: HTTP_SERVER change to HTTPS_SERVER:

Code: Select all

		foreach ($results as $result) {
			if (file_exists(DIR_IMAGE . $result['image'])) {
				$this->data['banners'][] = array(
					'title' => $result['title'],
					'link'  => $result['link'],
					'image' => HTTPS_SERVER . 'image/' . $result['image'],
				);
			}
		}
The mixed content errors for the banners will now be fixed, as they will load over HTTPS.
Don't know from where you have this code, but for sure not from an OpenCart installtion.
Because the code inside this system reads like this:

Code: Select all

foreach ($results as $result) {
	if (is_file(DIR_IMAGE . $result['image'])) {
		$data['banners'][] = array(
			'title' => $result['title'],
			'link'  => $result['link'],
			'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'])
		);
	}
}
And anybody ca see, there is NO HTTP_SERVER
And this is since the 1.5.x releases.

Re: SSL web: unable to put home banner images as https

Posted: Sun Jun 21, 2020 7:42 pm
by Banastres
OSWorX wrote:
Sun Jun 21, 2020 6:54 pm
Banastres wrote:
Sun Jun 21, 2020 5:15 pm
I had this problem recently. It's because the catalog/controller/module/banner.php is loading the HTTP_Server inside the PHP file for the URL image. This will cause mixed content errors while using SSL as you mentioned above. Make sure the HTTPS_SERVER is set in the config.php.

Then open catalog/controller/module/banner.php and find: HTTP_SERVER change to HTTPS_SERVER:

Code: Select all

		foreach ($results as $result) {
			if (file_exists(DIR_IMAGE . $result['image'])) {
				$this->data['banners'][] = array(
					'title' => $result['title'],
					'link'  => $result['link'],
					'image' => HTTPS_SERVER . 'image/' . $result['image'],
				);
			}
		}
The mixed content errors for the banners will now be fixed, as they will load over HTTPS.
Don't know from where you have this code, but for sure not from an OpenCart installtion.
Because the code inside this system reads like this:

Code: Select all

foreach ($results as $result) {
	if (is_file(DIR_IMAGE . $result['image'])) {
		$data['banners'][] = array(
			'title' => $result['title'],
			'link'  => $result['link'],
			'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'])
		);
	}
}
And anybody ca see, there is NO HTTP_SERVER
And this is since the 1.5.x releases.
I didn't realize the OP was referring to 2.0~ until i checked the forum breadcrumb. The problem sound similar to mine, hence me finding the thread. For 1.5.6.4 that is what worked for me. The banner module was using HTTP_SERVER causing mixed content errors while using SSL.

2.0~ could have a similar scenario. I don't know. Because i don't use it.