LemonStand Forum: Facebook Like/Recommends - LemonStand Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Facebook Like/Recommends

#1 User is offline   NickToye 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 484
  • Joined: 09-July 10

Posted 26 February 2011 - 02:31 AM

As much as I hate to admit it, Facebook is a great tool for spreading the word.

I am hearing all kinds of things about Social Commerce, and so on.

I know I can add a Like or Recommend button to any page in Lemonstand - but what I really want to do is recommend a product, so is there a way of referencing the page you are on dynamically in Facebook plugin code?
0

#2 User is offline   Florinel Chis 

  • Member
  • Group: Members
  • Posts: 1
  • Joined: 26-February 11

Posted 26 February 2011 - 12:39 PM

View PostNickToye, on 26 February 2011 - 02:31 AM, said:

As much as I hate to admit it, Facebook is a great tool for spreading the word.

I am hearing all kinds of things about Social Commerce, and so on.

I know I can add a Like or Recommend button to any page in Lemonstand - but what I really want to do is recommend a product, so is there a way of referencing the page you are on dynamically in Facebook plugin code?

You cand add in any partial you like the following code for a facebook like button:

<iframe src="http://www.facebook.com/plugins/like.php?href=<? echo urlencode($_SERVER['REQUEST_URI']); ?>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>


0

#3 User is offline   NickToye 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 484
  • Joined: 09-July 10

Posted 26 February 2011 - 12:44 PM

Yeah I've done that but does that like the product page you are on?
0

#4 User is offline   Eric 

  • Developer
  • PipPipPip
  • Group: Members
  • Posts: 1,290
  • Joined: 04-August 10
  • LocationVancouver, Canada

Posted 27 February 2011 - 01:19 AM

Since it's passing the REQUEST_URI, it should, but who knows with Facebook's sometimes seemingly useless params.

http://www.walkernew...ress-post-page/

This can be done for sure. Just like Digg. Infact, this topic has a share button on the bottom-left which redirects to:
http://www.facebook....kerecommends%2F
0

#5 User is offline   NickToye 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 484
  • Joined: 09-July 10

Posted 27 February 2011 - 03:41 AM

ah, I was reading this on my iPhone and didn't get that full address.
0

#6 User is offline   NickToye 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 484
  • Joined: 09-July 10

Posted 27 February 2011 - 10:24 AM

Ok guys, this doesn't work,

That code throw an error, because the page I was liking didn't exist on Facebook.
0

#7 User is offline   Danny 

  • Co-Founder
  • Group: +Administrators
  • Posts: 295
  • Joined: 30-October 09
  • LocationVancouver, BC

Posted 28 February 2011 - 10:24 AM

Nick: The "Like" button just passes a URL to Facebook. You can output the current page URL via LemonStand, so yes, the button should work if implemented correctly.

Quote

That code throw an error, because the page I was liking didn't exist on Facebook.

I don't understand what you mean here. The page doesn't "exist" on Facebook. When you "like" a page, it just passes the URL to FB and lists it as something you liked on your FB wall.

#8 User is offline   Danny 

  • Co-Founder
  • Group: +Administrators
  • Posts: 295
  • Joined: 30-October 09
  • LocationVancouver, BC

Posted 28 February 2011 - 10:39 AM

Nick: I just threw this in the product_partial of the demo. It's quick and dirty, but works:

<iframe src="http://www.facebook.com/plugins/like.php?href=http://demo.lemonstandapp.com<?=  $product->page_url('/product') ?>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>


The demo refreshes itself every hour, but if you catch it in time you can see it working here: http://demo.lemonsta...duct/appletree/

If you're having problems, inspect the like button and see if the URL is outputting correctly. If you're getting an error its probably because the URL is not formatted correctly.

#9 User is offline   NickToye 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 484
  • Joined: 09-July 10

Posted 28 February 2011 - 01:34 PM

thanks Danny, works perfectly.
0

#10 User is offline   kaykills 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 34
  • Joined: 26-October 10

Posted 01 December 2011 - 10:50 AM

I was using the code above that Danny threw up. I tested that code on my product partial page and it was working. Now for some reason it has stopped working. The like button still appears on all my product pages however the full link to the product doesn't work anymore. It only likes the root url for some reason. Is anyone else experiencing this?

Cheers,
Michael
0

#11 User is offline   Eric 

  • Developer
  • PipPipPip
  • Group: Members
  • Posts: 1,290
  • Joined: 04-August 10
  • LocationVancouver, Canada

Posted 06 December 2011 - 10:05 AM

View Postkaykills, on 01 December 2011 - 10:50 AM, said:

I was using the code above that Danny threw up. I tested that code on my product partial page and it was working. Now for some reason it has stopped working. The like button still appears on all my product pages however the full link to the product doesn't work anymore. It only likes the root url for some reason. Is anyone else experiencing this?


Michael,

Can you post a link please?
0

#12 User is offline   kaykills 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 34
  • Joined: 26-October 10

Posted 06 December 2011 - 10:06 AM

View PostEric, on 06 December 2011 - 10:05 AM, said:

Michael,

Can you post a link please?



Eric I got this working. I should have posted that. Basically it was my Open Graph meta data that had changed and caused my output to break.

Cheers,
Michael
0

Share this topic:


Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users