Post by electron » Tue Mar 23, 2010 8:37 pm

Ok, fb share button works, although not showing the right product image, but there seems to be a problem with the description if it's left empty for a product.
It throws an error in the catalog/controller/product/product.php

Undefined variable: desc in /home/www/sexon.bg/catalog/controller/product/product.php on line 332

this is exactly where

Code: Select all

if( $desc ) {
starts

and i have followed the instructions by OSWorx exactly as written. I just think this hasn't been tested if there's no description of the product entered.

Will be extremely thankful if anyone has any ideas how to fine tune this to work if there's no desc ?

Newbie

Posts

Joined
Wed Feb 17, 2010 10:01 pm

Post by Cyberdude » Tue Mar 23, 2010 10:10 pm

It has been tested.

Logohunt.Net, Get Amazing custom logo designs for your business in just a few Hours! Start a online logo design contest for only $29 and watch designer logos roll in the same day!


User avatar
Active Member

Posts

Joined
Wed Feb 03, 2010 10:39 pm
Location - Belgium

Post by electron » Tue Mar 23, 2010 10:59 pm

anyway, I solved my problem by just using the separate code someone gave here for displaying the button in the product.tpl without making modifications to 3 files.

Newbie

Posts

Joined
Wed Feb 17, 2010 10:01 pm

Post by OSWorX » Tue Mar 23, 2010 11:26 pm

The facebook modification is tested - and how, and works perfectly.
Another user had also massive problems, while we found that another (additonal) installed module was the one which disturbed the displaying of the correct image.

And about the message in catalog/controller/product/product.php: this is maybe my fault, I have never thought that someone is NOT using a product description! (users!!).

And if you would have contacted me directly, this is a matter of seconds to clarify.

Finally: there are several ways to implement additonal code (like the FB-Button) - correct and wrong methods.
Each have to decide by himself which methode he will use.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by electron » Wed Mar 24, 2010 6:04 am

Hey, thanks for the reply.
i will probably turn off some of the modules and see what happens.
In my case i am able to choose from only the thumbnails that are on the homepage (latest products) only. ???
Can you pass a link to the other user's problem..
thanks again for the tip.

Newbie

Posts

Joined
Wed Feb 17, 2010 10:01 pm

Post by OSWorX » Wed Mar 24, 2010 7:38 pm

As far as I can remember myelf, it was a custom made module which showed only images with a marquee.
This coul be also here the reason.

When I have more time, I will rework that FB code because there is a additional way to define the image.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by migz » Wed Mar 24, 2010 8:00 pm

i have included this on my live site.
and how come FB doesn't recognize title and description? it just shows http://mydomain.com and http://mydomain.com/product

Active Member

Posts

Joined
Mon Feb 01, 2010 2:13 am

Post by MrConn » Fri Mar 26, 2010 8:45 pm

@ OSWorX
Does your mod work on 1.4.4?

Image
Nemmelig.no - Billige Gadgets!


Active Member

Posts

Joined
Tue Mar 23, 2010 8:08 am

Post by OSWorX » Sat Mar 27, 2010 12:09 am

MrConn wrote:@ OSWorX
Does your mod work on 1.4.4?
Of course - why should it not?

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by MrConn » Sat Mar 27, 2010 1:40 am

It did'nt for me... Followed you instructions by the letter! (Then I tried changing this->url->http to "HTTP_SERVER", but still no dice!)

Image
Nemmelig.no - Billige Gadgets!


Active Member

Posts

Joined
Tue Mar 23, 2010 8:08 am

Post by felixsg » Sat Apr 03, 2010 7:12 pm

Appear not work with 1.4.6

Newbie

Posts

Joined
Wed Mar 24, 2010 3:43 am

Post by comiclair » Sun Apr 04, 2010 2:03 am

all I can say is wow. this is nice ....works great

Active Member

Posts

Joined
Sun Jun 07, 2009 5:08 am
Location - Trenton, NJ

Post by sunburn1979 » Mon Apr 12, 2010 3:25 am

I cant get this to work in 1.4.7 error on /controller/product/product.tpl #351 something about image_resize is not defined.

Any help appreciated. Have followed the read me to the letter.

New member

Posts

Joined
Thu Aug 13, 2009 4:36 pm

Post by maxsg » Fri Apr 16, 2010 11:52 am

The image_resize is not defined as there are changes to codings for version 1.4.7

look for the following line in file: ../catalog/controller/product/product.php:
$this->document->header[] = '<link rel="image_src" href="' . image_resize( $image, '110', '130' ) . '" />';

and replace it with these:
$this->document->header[] = '<link rel="image_src" href="' . $this->model_tool_image->resize( $image, '110', '130' ) . '" />';

This should solve the image_resize problem.

Newbie

Posts

Joined
Fri Apr 16, 2010 11:44 am

Post by maxsg » Fri Apr 16, 2010 12:06 pm

@OSWorX

Your coding for the facebook product share link works,
but however FB doesn't shows the correct title and description and images.

I am using version 1.4.6, any idea what has gone wrong.

The title FB is showing is "www.domain.com" instead of the product's name,
and the description FB show is "http://www.domain.com/index..." instead of the product's meta description
and the images is just some other images from the image/data folder instead of the product's image.

Newbie

Posts

Joined
Fri Apr 16, 2010 11:44 am

Post by OSWorX » Fri Apr 16, 2010 1:38 pm

maxsg wrote:@OSWorX

Your coding for the facebook product share link works,
but however FB doesn't shows the correct title and description and images.

I am using version 1.4.6, any idea what has gone wrong.

The title FB is showing is "www.domain.com" instead of the product's name,
and the description FB show is "http://www.domain.com/index..." instead of the product's meta description
and the images is just some other images from the image/data folder instead of the product's image.
We had this behaviour several times in the past.
Every time another, additionally installed module was the 'evil'.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by maxsg » Fri Apr 16, 2010 2:02 pm

OSWorX wrote:
maxsg wrote:@OSWorX

Your coding for the facebook product share link works,
but however FB doesn't shows the correct title and description and images.

I am using version 1.4.6, any idea what has gone wrong.

The title FB is showing is "www.domain.com" instead of the product's name,
and the description FB show is "http://www.domain.com/index..." instead of the product's meta description
and the images is just some other images from the image/data folder instead of the product's image.
We had this behaviour several times in the past.
Every time another, additionally installed module was the 'evil'.
Does the "additionally installed module" means new addtional in different version of the Opencart or modules added on our own?

Newbie

Posts

Joined
Fri Apr 16, 2010 11:44 am

Post by OSWorX » Fri Apr 16, 2010 3:28 pm

Additional means beside the standard installation.
So, modules which are ADDITIONAL installed.
If, disable them all and try the FB again (clean cache before).

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by maxsg » Sat Apr 17, 2010 2:09 pm

OSWorX wrote:Additional means beside the standard installation.
So, modules which are ADDITIONAL installed.
If, disable them all and try the FB again (clean cache before).
I' m using the standard installation for 1.7.6, without any additional modules installed.
Have also try clearing the cache, but somehow it still doesn't work for me.


***** Solved *****
Hey guys, I guess i have figure out how to make the "Title", "Description" and "Image" to show correctly on Facebook after the user click on the share button.

You just have to add <fb:share-button class="meta"> before the meta tag and </fb:share-button> after the meta tags that is needed by Facebook.

For those using "OSWorx" method, look for the following code in the "header.tpl" file:

<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>

<?php
if( isset( $header ) ) {
foreach( $header as $head ) {
echo $head . "\n";
}
} ?>


and replace it with the following:

<fb:share-button class="meta">
<meta name="medium" content="mult"/>
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>

<?php
if( isset( $header ) ) {
foreach( $header as $head ) {
echo $head . "\n";
}
} ?>
</fb:share-button>


It should work correctly for you now.
Last edited by maxsg on Sat Apr 17, 2010 3:50 pm, edited 4 times in total.

Newbie

Posts

Joined
Fri Apr 16, 2010 11:44 am

Post by gavin m » Sat Apr 17, 2010 3:19 pm

Just installed this on a 1.4.7 deployment and don't get anything showing on the product pages.

Is there additional steps after uploading the files? I see nothing on the product page like a button....

Active Member

Posts

Joined
Thu Jun 04, 2009 3:23 pm
Who is online

Users browsing this forum: No registered users and 64 guests