Page 3 of 12 FirstFirst 12345 ... LastLast
Results 21 to 30 of 115
  1. #21
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

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

    This and some of the rest of the thread is getting into issues with the facebook end of the thing. And I have to say that I know diddly squat about facebook....

    But maybe someone else has better knowledge than I

  2. #22
    Join Date
    Sep 2009
    Posts
    49
    Plugin Contributions
    0

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

    You have to edit the sizing of the Like box so that you don't see a big white space...

    Code:
    <iframe src="http://www.facebook.com/widgets/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']); ?>"
            scrolling="no" frameborder="0"
            style="border:none; width:450px; height:80px"></iframe>
    As for sending an image and title to Facebook, yes it can be done, but requires the addition of Meta Tags. This requires some core file editing!

    As an FYI, you can customize the look of the button (somewhat) - here's a link to the Facebook page.
    http://developers.facebook.com/docs/...e/plugins/like

  3. #23
    Join Date
    Apr 2009
    Posts
    57
    Plugin Contributions
    0

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

    Awesome mod thanks for sharing this.

    hey-you I would be interested in know what core files are to be changed to include images and titles on facebook if you would be so kind to point me in the direction :-)
    Melanie
    beehavendesignz DOT com

  4. #24
    Join Date
    Jun 2008
    Posts
    61
    Plugin Contributions
    1

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

    Quote Originally Posted by niccol View Post

    ...

    What you actually want to do is this:

    Code:
    <iframe src="http://www.facebook.com/widgets/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']); ?>"
            scrolling="no" frameborder="0"
            style="border:none; width:450px; height:80px"></iframe>
    But looking at it again I am not sure that the whole plan is going to work in that I am not sure the system will deal with the dynamic URL anyway. What that means is that I am not sure how the system will deal with the bit after the question mark. It might or it might not.
    Yup, seems to work only if the site is using SEF urls.

    The default URLs with the character "&" in the url will cause error on the Facebook side.

    Any idea how to overcome this (without installing the SEF add-on)? Thanks.

  5. #25
    Join Date
    Jun 2008
    Posts
    61
    Plugin Contributions
    1

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

    Replacing all the & amp; with % 26 seems to work.

    Using the urlencode() function.

  6. #26
    Join Date
    Oct 2006
    Posts
    25
    Plugin Contributions
    0

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

    Quote Originally Posted by yonghs View Post
    Replacing all the & amp; with % 26 seems to work.

    Using the urlencode() function.
    Could you please put the whole code here, would clarify a lot. This is nice function!

  7. #27
    Join Date
    Jun 2008
    Posts
    61
    Plugin Contributions
    1

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

    Here it is (this is found from a website... uses urlencode function):


    Code:
    <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'])); ?>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:px"></iframe>

    Change the height to something you prefer

    PS:
    Or you can use strreplace function to just replace "& amp;" with "% 26"

  8. #28
    Join Date
    Nov 2009
    Location
    Aurora, IN
    Posts
    37
    Plugin Contributions
    0

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


    I changed my coding on the header page so that now the Like button works without giving me that error message. Go to this page, download the file, and then copy the facebook section to your header page, and it should work:

    http://www.zenflavor.com/add-faceboo...uct-pages.html

    Quote Originally Posted by myzcpt View Post
    It puts the Like button there fine, and says that I "Like" it when I click it, but then it gives me an error message, and when I click on it, it says, "The page at http://mysite.com/index.php?main_page=product_info could not be reached."

    Any ideas how to fix that?

  9. #29
    Join Date
    Sep 2009
    Posts
    49
    Plugin Contributions
    0

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

    Here's what I did...I'm not sure if it's the best way, but it works!

    Do this at your own risk!!! Back-up all files first!

    in "includes\templates\YOUR_TEMPLATE\common\html_header.php"

    I placed this below the meta tag for "generator":
    Code:
    <?php if(strstr($_GET['main_page'], 'product_')) { ?>
        <meta property="og:title" content="<?php echo META_TAG_FBTITLE; ?>"/>
        <meta property="og:site_name" content="<?php echo TITLE; ?>"/>
        <meta property="og:image" content="<?php echo META_TAG_FBIMG; ?>"/>
        <meta property="og:type" content="product"/>
        <meta property="og:phone_number" content="ENTER PHONE NUMBER"/>
        <meta property="og:region" content="ENTER STATE CODE"/>
        <meta property="og:country-name" content="ENTER Country"/>
        <meta property="fb:admins" content="ENTER FB USERID"/>
    <?php } ?>
    Note that the above only works on product pages not document pages.

    There's also many more meta tags that FB recognizes it. Take a look at their developer resources for me info...
    http://developers.facebook.com/docs/opengraph

    in "includes\modules\meta_tags.php"

    Add the change in red to the query on (or around) line 200:

    Code:
    $sql= "select pd.products_name, p.products_model, p.products_price_sorter, p.products_tax_class_id, p.products_image,
                                          p.metatags_title_status, p.metatags_products_name_status, p.metatags_model_status,
                                          p.products_id, p.metatags_price_status, p.metatags_title_tagline_status,
                                          pd.products_description, p.product_is_free, p.product_is_call,
                                          mtpd.metatags_title, mtpd.metatags_keywords, mtpd.metatags_description
    I've inserted the following code at line 284 (for me), between the following lines in blue:

    Code:
        } // CUSTOM META TAGS
        if($product_info_metatags->fields['products_image']!='') {
            $FBimgURL = (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ) . DIR_WS_IMAGES . $product_info_metatags->fields['products_image'];
            define('META_TAG_FBIMG', $FBimgURL); 
        } else {
            define('META_TAG_FBIMG', '');
        }
        define('META_TAG_FBTITLE', str_replace('"','',zen_clean_html($product_info_metatags->fields['products_name'])));
      } // EOF
      break;
    And than follow the other instructions in this thread for editing tpl_product_info_display

    I hope this helps.

  10. #30
    Join Date
    May 2010
    Posts
    72
    Plugin Contributions
    0

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

    I've tried changing my tpl_product_info_display.php file, as instructed, but nothing changed on my page. Why not?

 

 
Page 3 of 12 FirstFirst 12345 ... LastLast

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