Post by pamamolf » Tue Jun 20, 2017 3:47 am

Hello

When i try to use share on facebook the image is broken :(

Facebook debugging point to:

The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags.

Any ideas how can i fix it?

I am on 1.5..6.4

Thank you

Newbie

Posts

Joined
Thu May 12, 2016 8:43 am

Post by IP_CAM » Tue Jun 20, 2017 4:55 am


Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by pamamolf » Tue Jun 20, 2017 5:18 am

I did and found this one from you and a few others:

viewtopic.php?t=168903

as the file paths was not exact i search for the header.tpl and the header.php and found them at:

/admin/view/template/common/header.tpl
/catalog/view/theme/theme477/template/common/header.tpl


/admin/controller/common/header.php
/public/catalog/controller/common/header.php

/public/catalog/language/greek/common/header.php
/public/admin/language/greek/common/header.php

So i go ahead and try your edits at:

/catalog/view/theme/theme477/template/common/header.tpl
and
/public/catalog/controller/common/header.php

Then i try again and i got one more time the broken image on share....

Did i edit the wrong files?

Newbie

Posts

Joined
Thu May 12, 2016 8:43 am

Post by IP_CAM » Tue Jun 20, 2017 7:10 am

well, this Mod was not complete, I just placed it to let people know, how it looks like.
But I made it (only partly) work, until HARDCODING this:
<meta property="og:url" content="http://www.bigmax.ch/shop/" />
because by use of this:
<meta property="og:url" content="<?php echo $og_url; ?>" />
it displayed a double /shop/ link like:
http:// www. bigmax. ch/shop/shop/
for some unknown to me reason ! :'(
---
By doing the following:
---
catalog/view/theme/YOUR_THEME_NAME/template/common/header.tpl

Code: Select all

<meta name="keywords" content="<?php echo $keywords; ?>">
<?php } ?>
ADD FROM HERE:
<meta property="og:title" content="<?php echo $title; ?>" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.YOURSHOP.NAME/SHOPSUB/" />
<?php if ($og_image) { ?>
<meta property="og:image" content="<?php echo $og_image; ?>" />
<?php } else { ?>
<meta property="og:image" content="<?php echo $logo; ?>" />
<?php } ?>
<meta property="og:site_name" content="<?php echo $name; ?>" />
TO HERE !
<?php if ($icon) { ?>
Change this, to match your Site URL:
content="http://www.YOURSHOP.NAME/SHOPSUB/"
---
catalog/controller/common/header.php

Code: Select all

			$this->data['logo'] = '';
		}
ADD FROM HERE:
		$this->data['og_url'] = (isset($this->request->server['HTTPS']) ? HTTPS_SERVER : HTTP_SERVER) . ltrim ($this->request->server['REQUEST_URI'],'/');
		$this->data['og_image'] = $this->document->getOgImage();
TO HERE!

		$this->language->load('common/header');
whereby this $this->data['og_url'] Line would probably no longer be required to be there,
since it seems not doing it's Job, as it should anyway. ???
---
system/library/document.php

Code: Select all

	public function getTitle() {
		return $this->title;
	}
ADD FROM HERE:
	public function setOgImage($image) {
		$this->og_image = $image;
	}

	public function getOgImage() {
		return $this->og_image;
	}
TO HERE!	
	public function setDescription($description) {
		$this->description = $description;
to then get this in my Browser Source View:

Code: Select all

<meta property="og:title" content="the fastest Opencart in the North, South, East &amp; West" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.bigmax.ch/shop/" />
<meta property="og:image" content="http://www.bigmax.ch/shop/image/data/logo2.png" />
<meta property="og:site_name" content="Ernie's OpenCart light" />
And this is probably, what it should look like. But since I don't use Facebook for this, I cannot tell ! :D
Good Luck !
Ernie
---
But some extensions exist as well on this, as I found out, like this:
https://www.opencart.com/index.php?rout ... n_id=19520
and here is a Tool, to test some Things:
Facebook OG and Twitter Cards Validator
https://www.opencart.com/index.php?rout ... n_id=19937
found here:
https://www.opencart.com/index.php?rout ... _license=0
PS: But just don't ask me anything, when it comes to Custom Themes,
exept for those, I use... ! ::)

Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by pamamolf » Wed Jun 21, 2017 3:15 am

i just test the:

https://www.opencart.com/index.php?rout ... n_id=19520

and i am still getting the broken image :(

Newbie

Posts

Joined
Thu May 12, 2016 8:43 am

Post by pamamolf » Wed Jun 21, 2017 3:33 am

After testing your edit the main image is broken but i am getting two arrows on image left/right and when i click on them i am getting 2-3 images from various wrong products !

Wierd

Newbie

Posts

Joined
Thu May 12, 2016 8:43 am

Post by IP_CAM » Wed Jun 21, 2017 4:13 am

then, go BACK to Default Code, and try one of those,
https://www.opencart.com/index.php?rout ... aph%20Tags
this one worked on spot in another one of my Test Shops:
https://www.opencart.com/index.php?rout ... n_id=11541
Or then, you'll need a Pro...
Good Luck! ;)
Ernie
---
Image

Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by pamamolf » Wed Jun 21, 2017 4:42 am

It looks simple but nothing works :(

Can i hire you for this fix?

Thank you

Newbie

Posts

Joined
Thu May 12, 2016 8:43 am

Post by IP_CAM » Wed Jun 21, 2017 6:51 am

negative, but I am sure, you'll find someone here, just check on one
of the fellows, also assisting here on a regular bases ! ;)
Good Luck !
Ernie

Please don't send me OC Forum Personal Messages, just contact: jti@jacob.ch
---
OC 1.5.6.5 LIGHT Test Site: http://www.bigmax.ch/shop/
OC 1.5.6.5 V-PRO Test Site: http://www.openshop.li/shop/
My Github OC Site: https://github.com/IP-CAM
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by pamamolf » Wed Jun 21, 2017 4:50 pm

Thanks for your time :)

Newbie

Posts

Joined
Thu May 12, 2016 8:43 am
Who is online

Users browsing this forum: No registered users and 45 guests