Post by Chrissy Poo » Sun Jul 11, 2010 4:43 am

I am trying to add the Facebook Like Button to my product page as you can see here:

Image

In the code I need to add the page URL, but what do I put?

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com

Discount Code: DISCOUNT10


Active Member

Posts

Joined
Mon Jun 29, 2009 8:48 am
Location - UK

Post by JAY6390 » Sun Jul 11, 2010 10:09 am

Code: Select all

<?php echo $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id='.$this->request->get['product_id']); ?>
That should do it

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Chrissy Poo » Mon Jul 12, 2010 12:12 am

Thanks works perfect :)

If anyone else wants to add the Facebook Like Button to their Opencart Store Follow the Following Instructions:

Requirements:
- SEO URLs Must be Enabled

Instructions:

Edit the file: catalog/view/theme/default/template/product/product.tpl

Find this piece of code:

Code: Select all

</table>
            <br />
            <?php if ($display_price) { ?>
Replace the <br /> with the following:

Code: Select all

<div style="width: 100%; padding-top:10px;">
            <table>
               <tr>
              <td><iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $this->model_tool_seo_url->rewrite(HTTP_SERVER . 'index.php?route=product/product&product_id='.$this->request->get['product_id']); ?>&layout=standard&show_faces=false&width=280&action=like&colorscheme=light&height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:270px; height:35px;" allowTransparency="true"></iframe>
              </td>
              </tr>
            </table>
            </div>
I have tested this on OpenCart 1.4.8b in IE6, IE7, IE8, FF 3.6.6

Let me know if you find any problems :)

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com

Discount Code: DISCOUNT10


Active Member

Posts

Joined
Mon Jun 29, 2009 8:48 am
Location - UK

Post by SteveSherry » Mon Jul 12, 2010 3:37 am

Great work,
This also works in Google Chrome

My Website ¦ Summer Madness Special Offer ¦


Active Member

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by Chrissy Poo » Mon Jul 12, 2010 3:50 am

No Problems and thanks for testing in Google Chrome :)

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com

Discount Code: DISCOUNT10


Active Member

Posts

Joined
Mon Jun 29, 2009 8:48 am
Location - UK

Post by stonehinged » Sat Sep 04, 2010 10:52 am

Nice work! Thanks for the instructions. I've tested on OC 1.4.7. in Safari 5.0.1. All looks great!

STONEHINGED
Handcrafted, Semi-Precious Jewelry
http://www.stonehinged.com/


User avatar
Active Member

Posts

Joined
Wed Aug 18, 2010 9:10 am
Location - US

Post by InfiniteDezigns » Wed Sep 08, 2010 6:22 am

This did not work for me. It won't show up. I'm using OC 1.4.9. Here's the URL:

http://www.dyelyfe.com/Store

New member

Posts

Joined
Mon Jun 21, 2010 5:18 am

Post by Chrissy Poo » Wed Sep 08, 2010 6:36 am

InfiniteDezigns wrote:This did not work for me. It won't show up. I'm using OC 1.4.9. Here's the URL:

http://www.dyelyfe.com/Store
Are you sure you are editing the right file?

Also you site seems really really slow to me, might want to work on the speed.

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com

Discount Code: DISCOUNT10


Active Member

Posts

Joined
Mon Jun 29, 2009 8:48 am
Location - UK

Post by InfiniteDezigns » Wed Sep 08, 2010 6:45 am

Yeah I'm sure. The directions are to edit this page:

Edit the file: catalog/view/theme/default/template/product/product.tpl

I pasted the code above and it won't show up. This site is a work in progress so speed is not a siiue now. Just trying to get the kinks out first.

New member

Posts

Joined
Mon Jun 21, 2010 5:18 am

Post by Chrissy Poo » Wed Sep 08, 2010 6:56 am

InfiniteDezigns wrote:Yeah I'm sure. The directions are to edit this page:

Edit the file: catalog/view/theme/default/template/product/product.tpl

I pasted the code above and it won't show up. This site is a work in progress so speed is not a siiue now. Just trying to get the kinks out first.
Just searched your source code and its not even showing there so you must be doing something wrong.

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com

Discount Code: DISCOUNT10


Active Member

Posts

Joined
Mon Jun 29, 2009 8:48 am
Location - UK

Post by SteveSherry » Wed Sep 08, 2010 6:57 am

The instructions above are based upon your using the default store.
If you have a custom theme (as you do) you need to change :
catalog/view/theme/default/template/product/product.tpl
into
catalog/view/theme/YOURTHEME/template/product/product.tpl
(i.e - catalog/view/theme/dyelyfe/template/product/product.tpl)

Once this is done it should then show.

My Website ¦ Summer Madness Special Offer ¦


Active Member

Posts

Joined
Thu Apr 08, 2010 7:47 am
Location - Wirral, UK

Post by InfiniteDezigns » Wed Sep 08, 2010 7:13 am

Ok I got it to show up. But now it doesn't show or calculate how many people like the product. It also doesn't show up on facebook newsfeed or profile page at all.

New member

Posts

Joined
Mon Jun 21, 2010 5:18 am

Post by Chrissy Poo » Wed Sep 08, 2010 7:26 am

InfiniteDezigns wrote:Ok I got it to show up. But now it doesn't show or calculate how many people like the product. It also doesn't show up on facebook newsfeed or profile page at all.
You need to enable SEO Urls and also give the products keywords.

To show faces you need to edit the facebook code, look for show_faces=false and change to show_faces=true

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com

Discount Code: DISCOUNT10


Active Member

Posts

Joined
Mon Jun 29, 2009 8:48 am
Location - UK

Post by InfiniteDezigns » Wed Sep 08, 2010 12:34 pm

Nope. still doesn't show how many people like nor does it post to their page. and everything has keywords and the seo urls is active.

New member

Posts

Joined
Mon Jun 21, 2010 5:18 am

Post by Chrissy Poo » Wed Sep 08, 2010 7:06 pm

InfiniteDezigns wrote:Nope. still doesn't show how many people like nor does it post to their page. and everything has keywords and the seo urls is active.
Your products to not have SEO urls, look at this url:

http://dyelyfe.com/Store/index.php?rout ... uct_id=102

then compare to this one:

http://www.stylemyapple.co.uk/ipad-acce ... pad-itouch

That is your problem.

10% Discount on all Shared and Reseller Hosting Packages at Vidahost.com

Discount Code: DISCOUNT10


Active Member

Posts

Joined
Mon Jun 29, 2009 8:48 am
Location - UK

Post by Incan11 » Wed Sep 15, 2010 5:38 pm

I have my store located at www.one.com is it possible to make this facebook like button work?

Enabled the SEO kewords but then the products are not showing.

Newbie

Posts

Joined
Wed Sep 01, 2010 4:13 am

Post by naz_eg » Sat Sep 18, 2010 2:36 pm

Works perfect ;) Thank you..

New member

Posts

Joined
Sat May 29, 2010 6:25 pm

Post by anmgra » Sun Oct 10, 2010 1:55 am

Everything works fine expect that the title is not returned correct at facebook. I only get the title I have on my maintenance site. Has anyone experienced this? Or do someone know if there is a solution?
v.1.4.9.1
Last edited by anmgra on Mon Oct 11, 2010 6:12 am, edited 1 time in total.

Newbie

Posts

Joined
Fri Sep 03, 2010 4:13 pm

Post by Twist » Mon Oct 11, 2010 12:44 am

Does this work in version: v1.4.9.1?

I have put the code in and the facebook like button shows up fine. but when I press the like button I get the following appear on Facebook: Mark likes Product not found! on party-kits.com. I have tried putting an SEO keyword in but it is not making any difference. any ideas what could be wrong?

New member

Posts

Joined
Wed Sep 09, 2009 7:02 am

Post by Twist » Wed Oct 13, 2010 4:18 pm

Well I have tried everything I can think of now and still no luck ??? It seems that when I put an SEO keyword onto a product then the product will not show when I click on it on my website hence why it will not show up on Facebook. What a bummer! Is there any other alternative ways of doing this at all?

Thank You :-)

New member

Posts

Joined
Wed Sep 09, 2009 7:02 am
Who is online

Users browsing this forum: No registered users and 29 guests