If this is your first visit, check our documentation. To post, register or login.

Facebook Like Link

Started by stitchnkitty on 5 Jun 2015, 5:27 PM · Views: 3,179

Results 1 to 4 of 4
5 Jun 2015, 5:27 PM
#1
stitchnkitty avatar

stitchnkitty

Totally Zenned

Join Date:
Jun 2009
Location:
Des Moines, Iowa USA
Posts:
618
Plugin Contributions:
0

Facebook Like Link

I have been reading on how to add a link to facebook of products and have gotten confused.
Website :
stitchnframeonline.com
The facebook LINK in the header is working great but I am going to add the Facebook LIKE in the product pages.

Found this tutorial which was quite straight forward and the Like button is there but it does not appear to do anything? Suggestions PLEASE??

I wrote a tutorial about this:

How to Add a Facebook Like Button to Your Zen Cart Product Pages

Thanks,

Anne
5 Jun 2015, 7:22 PM
#3
stitchnkitty avatar

stitchnkitty

Totally Zenned

Join Date:
Jun 2009
Location:
Des Moines, Iowa USA
Posts:
618
Plugin Contributions:
0

Re: Facebook Like Link

This:

http://www.picaflor-azul.com/blog/?p=914/

Add a Facebook Like Button to Your Product Pages

If you are not already aggressively marketing your business on Facebook you should be. According to Digitaltrends.com Facebook has over 25% of internet traffic in the U.S. and is the most downloaded app of all time. In this tutorial, I will show you step by step how to install a Facebook like button into your zen cart product pages so. For demo purposes I will be adding the button to my Andover Modern free zen cart template which you can download here.

  1. In your favorite plain text editor open includes/templates/your-custom-template-directory/templates/tpl_product_info_display.php. If the file is not there, create an override for it by copying includes/templates/template_default/templates/tpl_product_info_display.php to includes/templates/your-custom-template-directory/templates/tpl_product_info_display.php.

  2. Find the place in the file where you want the button to show and add this code:

<iframe src="https://www.facebook.com/plugins/like.php?href=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&layout=standard&show_faces=false&width=450&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:40px"></iframe>

I think that the best place to put it is under the product title. If you want to add your Facebook Like button under the product title, add the like button code directly after this:

<!--bof Product Name--> <h1 id="productName" class="productGeneral"><?php echo $products_name; ?></h1> <!--eof Product Name-->
5 Apr 2023, 6:59 PM
#4
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Facebook Like Link

So, in 2023, there are two methods, Javascript SDK method and iFrame:
https://developers.facebook.com/docs/plugins/like-button

I'm trying to display Like and Share buttons and having a very frustrating experience.

I've concluded that for the buttons to display

  • the user needs to have accepted the Facebook essential cookies
  • the user needs to be logged into Facebook
  • tracking settings in the browser may need to adjusted

And being in europe may also influence it (GDPR) but I find no specific setting to deal with that...I assume it is in the initial cookie acceptance.

PITA#1
I find that with two facebook accounts, logged in from the same browser/pc/country: buttons are displayed for one user but not the other.
Maybe that's related to the previous point, but I can't find anything.
Flaky.

PITA#2, when Like and Share buttons are actually displayed.

  • SHARE works correctly opening a dialogue box with image...yesterday. Today it loaded no images, until the evening, with no code changes in-between. More flaky.

  • LIKE. When clicked, I get a broken image and a console error of

crome-error://chromewebdata/:1 Refused to display 'https://www.facebook.com/' in a frame because it set 'X-Frame-Options' to 'deny'.

in Chrome and Firefox. After a day on Stackoverflow and YouTube, I can't find anything that solves this.

Results are the same with both methods, local or on hosting, with or without an appID, in Zen Cart or on a blank page, using urls of the source page or of the facebook page.

Some idle hands here may go looking for a solution. Don't. Been there, done that.

This is only a last-resort post in case anyone has had this problem and solved it/also given up.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...