Page 12 of 12 FirstFirst ... 2101112
Results 111 to 115 of 115
  1. #111
    Join Date
    Jun 2006
    Posts
    120
    Plugin Contributions
    0

    Default Re: Facebook "Like" button on every product page?

    The website name, and product name were being repeated in the description area of the fb posts, and the fb debug 'Linter' said I should explicitly define 'og:description' so I added the following to Delia's code in meta_tags.php

    Code:
    define('META_TAG_FBDESC', str_replace('"','',zen_clean_html($product_info_metatags->fields['products_description'])));
    then I added the following to Delia's meta properties in html_header.php

    Code:
    <meta property="og:description" content="<?php echo META_TAG_FBDESC; ?>"/>
    I had already loaded up the javascript with my app ID into a .js file in /includes/templates/[custom_name]/jscript/ directory. (I also have the 'FB.init' related javascript loaded there.) I did not need to make any changes to tpl_product_info_display.php to fine tune how the posts look in the timeline, but I did add fb comments at the bottom of the product info, with the following (the href is redundant of course, but will help in more simple installs)

    Code:
    <div id="fb-root"></div>
    <div class="fb-comments" data-href="<?php echo $canonicalLink; ?>" data-width="600" data-num-posts="3" data-colorscheme="dark"></div>
    You can see how it all works here http://rastaheadwraps.com/index.php?...&products_id=3
    I am not a coder, I am a "monkey see monkey do" type, but I thought I would share with other users.

    Thanks for the mod, Delia!

  2. #112
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Facebook "Like" button on every product page?

    Quote Originally Posted by colinS) View Post
    Facebook Like, Share and Add this pop up menu

    I have edited the file slightly and pasted the code into a different location on the product page (My product image would not display if the code was pasted above the image in ie8)


    Used with Zen Cart 1.3.8a.

    Edited and working in heavily customised site http://www.digitaleasy.co.nz/ecommer...oducts_id=5769

    Not tested in 1.3.9 since It may not work with Facebook Like button links.

    If you're using SEO links you'll have to edit the Facebook Like button below to
    Code:
    <iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath= '.(int)$_GET['cPath'].' &products_id=' . (int)$_GET['products_id']); ?>&layout=button_count&show_faces=false&width=80&action=like&font=arial&colorscheme=light&height=35" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:35px"></iframe>

    1. Backup includes\templates\template_default\templates\tpl_product_info_display.php and COPY it to includes\templates\YOUR_TEMPLATE\templates\tpl_product_info_display.php edit the file in YOUR_TEMPLATE and no other, keeping the template_default intact as backup.

    2. Here's the code with comments. Read them and edit as needed. You do NOT need to edit other files.

    Code:
    <!--bof Socialize -->
    <style type="text/css">
    	
    
    div.share {float: right; }
    
    
    	div.share ul {float:right; list-style-type:none; padding:0;} 
    	div.share li {float:left; display:inline; padding:0 5px;} 
    </style>
    
    <div class="share">
    	<ul>
    
    		<li>
    			<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> <!-- seperate Facebook share button -->
    		</li>
    		<li>
    			<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath='.(int)$_GET['cPath'].'&products_id=' . (int)$_GET['products_id'])); ?>&layout=button_count&show_faces=false&width=80&action=like&font=arial&colorscheme=light&height=35" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:80px; height:35px"></iframe> <!-- Facebook button_count Like button using standard Zen Cart product links -->
    		</li>
    		<li>
    			<span class="addthis_toolbox addthis_default_style"> <!-- simple www.addthis.com expandable button. Register to get statistics and edit USERNAME. Remove the img src tag to use addthis standard icon -->
    				<a href="http://www.addthis.com/bookmark.php?v=250&username=USERNAME" class="addthis_button_compact">
    				 More</a>
    			</span>
    			<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=USERNAME"></script>
    		</li>
    	</ul>
    </div>
    <!--eof Socialize -->
    3. Edit includes\templates\YOUR_TEMPLATE\templates\tpl_product_info_display.php
    Copy and paste code after <!--eof Main Product Image-->

    Get a Social Media on!

    Hack by Colin S)
    Original code by scrap
    I have used this share mod, and sometimes it does not pull the image as you click on share. It is not consistent.

    Is this a facebook issue?
    Using Zen Cart 1.5.1

  3. #113
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Facebook "Like" button on every product page?

    Quote Originally Posted by alwaysriding View Post
    Hi All,

    A little clarification is required.

    Magic SEO URLS it turned out was not the issue at all. Jiri from MSU did some debugging for us, and we found it was an issue in our html header.

    FB like, the XFBML method is now working beautifully, and you can see it here as an example.

    I would like to retract my previous comments and say that the MSU system was not in anyway responsible for the issue we had.

    Regarding the SEO URLS, all I can say is that our business increased by 400% the month after we started using them.

    The figures speak for themselves.
    Does anyone know how this Facebook like was implemented?

    here as an example.
    Using Zen Cart 1.5.1

  4. #114
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: Facebook "Like" button on every product page?

    Quote Originally Posted by Kevin205 View Post
    Does anyone know how this Facebook like was implemented?

    here as an example.
    If you look at the view source in the header. They are using the "Open Graph" to set the facebook parameters.

    PHP Code:
    <!-- bof facebook like button -->
    <
    meta property="og:title" content="Poggio di Sanremo Climb T-Shirt - &pound;18.74" />
    <
    meta property="og:site_name" content="Always Riding" />
    <
    meta property="og:url" content="http://www.alwaysriding.co.uk/poggio-di-sanremo-climb-t-shirt-1341.html" />
    <
    meta property="fb:admins" content="514552228" />
    <
    meta property="fb:app_id" content="118760278148014" />
    <
    meta property="og:image" content="http://www.alwaysriding.co.uk/images/alwaysriding/Poggio+di+Sanremo+Climb+T-Shirt.jpg" />
    <
    meta property="og:type" content="company" />
    <!-- 
    eof facebook like button --> 
    This is the most reliable way to setup the correct facebook links

  5. #115
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Facebook "Like" button on every product page?

    Quote Originally Posted by gilby View Post
    If you look at the view source in the header. They are using the "Open Graph" to set the facebook parameters.

    PHP Code:
    <!-- bof facebook like button -->
    <
    meta property="og:title" content="Poggio di Sanremo Climb T-Shirt - £18.74" />
    <
    meta property="og:site_name" content="Always Riding" />
    <
    meta property="og:url" content="http://www.alwaysriding.co.uk/poggio-di-sanremo-climb-t-shirt-1341.html" />
    <
    meta property="fb:admins" content="514552228" />
    <
    meta property="fb:app_id" content="118760278148014" />
    <
    meta property="og:image" content="http://www.alwaysriding.co.uk/images/alwaysriding/Poggio+di+Sanremo+Climb+T-Shirt.jpg" />
    <
    meta property="og:type" content="company" />
    <!-- 
    eof facebook like button --> 
    This is the most reliable way to setup the correct facebook links
    gilby, thanks for the reply.

    I found a link on the net explaining how to add the Open Graph scheme to Zen Cart. As I implemented it. It showed up once, and never did again!

    Sometimes when page is refreshed, it shows up again.

    Is there a more reliable thread on this forum explaining a how to get this to work?

    ps. i can share the link if any one is interested.
    Last edited by Kevin205; 17 Apr 2013 at 04:02 PM.
    Using Zen Cart 1.5.1

 

 
Page 12 of 12 FirstFirst ... 2101112

Similar Threads

  1. Facebook "Like/Share" Plugin - Using OG info for each product?
    By rubiconpeak in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 14 Oct 2012, 12:08 AM
  2. Facebook "Like" Button on each product page - where to add FB details?
    By Yaro in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 6 Jun 2012, 11:26 AM
  3. Facebook "Like" button
    By wilson_li in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 28 Jul 2011, 08:29 PM
  4. Facebook "LIKE" button.
    By Tantirx in forum General Questions
    Replies: 7
    Last Post: 28 Apr 2011, 05:42 AM
  5. Replies: 26
    Last Post: 19 Feb 2010, 02:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR