Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 31
  1. #21
    Join Date
    Oct 2011
    Posts
    5
    Plugin Contributions
    0

    Default Re: Adding Facebook Like Button

    Quote Originally Posted by picaflor-azul View Post
    I just wanted to post a small update. Glen (gjh42) pointed out a small correction in the code and now the like button will post the product image as well as the url to facebook. You can see the updated tutorial here:

    Easy Help Zen Cart Tutorial: How to Add a Facebook Like Button to Your Product Pages

    Thanks so much Glen!

    Thanks,

    Anne
    Hi Anne,
    Thanks for this tutorial.
    It works like a wonder, but the iamge pulled to facebook is the next button instead of the product image....
    Any advise would be very much appreciated.
    MTIA!

  2. #22
    Join Date
    Jun 2008
    Location
    Warrenpoint, United Kingdom
    Posts
    44
    Plugin Contributions
    0

    Default Re: Adding Facebook Like Button

    To make facebook grab the product image for the like button you can follow this tutorial...

    http://pro-webs.net/blog/2011/07/13/...facebook-like/

    Basically after the <?php } //endif FAVICON ?> in your templates html_header.php add this little bit of code...

    <meta property="og:image" content="<?php echo zen_image(DIR_WS_IMAGES . $product_info->fields['products_image'], $product_info->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT) ?>"/>

    Hope it works

  3. #23
    Join Date
    Jun 2008
    Location
    Warrenpoint, United Kingdom
    Posts
    44
    Plugin Contributions
    0

    Default Re: Adding Facebook Like Button

    found a better tutorial... which I have now implemented into my site...
    http://www.kerrinhardy.com/2010/11/2...en-cart-store/

    put the following code into your templates html_header.php....

    <?php
    if (isset($_GET['products_id'])) { // use products_image if products_id exists
    $facebook_image = $db->Execute("select p.products_image from " . TABLE_PRODUCTS . " p where products_id='" . (int)$_GET['products_id'] . "'");
    $fb_image = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $facebook_image->fields['products_image'];
    }
    if ($fb_image == '') { // if no products image, use the default image if enabled
    $fb_image = 'http://www.store.com/includes/templates/template_default/images/logo.gif';
    }
    if ($fb_image != '') {
    ?>
    <meta property="og:image" content="<?php echo $fb_image; ?>" />
    <?php
    }
    ?>

  4. #24
    Join Date
    Oct 2011
    Posts
    5
    Plugin Contributions
    0

    Default Re: Adding Facebook Like Button

    Quote Originally Posted by howb View Post
    To make facebook grab the product image for the like button you can follow this tutorial...

    http://pro-webs.net/blog/2011/07/13/...facebook-like/

    Basically after the <?php } //endif FAVICON ?> in your templates html_header.php add this little bit of code...

    <meta property="og:image" content="<?php echo zen_image(DIR_WS_IMAGES . $product_info->fields['products_image'], $product_info->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT) ?>"/>

    Hope it works
    Thanks for the help It works

    Quote Originally Posted by howb View Post
    found a better tutorial... which I have now implemented into my site...
    http://www.kerrinhardy.com/2010/11/2...en-cart-store/

    put the following code into your templates html_header.php....

    <?php
    if (isset($_GET['products_id'])) { // use products_image if products_id exists
    $facebook_image = $db->Execute("select p.products_image from " . TABLE_PRODUCTS . " p where products_id='" . (int)$_GET['products_id'] . "'");
    $fb_image = HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $facebook_image->fields['products_image'];
    }
    if ($fb_image == '') { // if no products image, use the default image if enabled
    $fb_image = 'http://www.store.com/includes/templates/template_default/images/logo.gif';
    }
    if ($fb_image != '') {
    ?>
    <meta property="og:image" content="<?php echo $fb_image; ?>" />
    <?php
    }
    ?>
    Since the first one works, I will give this a miss....Lazy me
    Is there any difference between the 2 method?

  5. #25
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Adding Facebook Like Button

    The difference between the two is principally the way they account for the product image. The first one uses the products_image already held in the product_info data, while the second one fetches the products_image from the database again, and explicitly accounts for cases of missing images. So it is more flexible and more code execution time.

  6. #26
    Join Date
    Aug 2008
    Location
    Southern California
    Posts
    129
    Plugin Contributions
    0

    Default Re: Adding Facebook Like Button

    Unless I'm missing something, I've been mostly unsuccessful at the different attempts to add the 'Facebook Like' feature to a product page. To be fair — I can get the 'like' box integrated, but in order for the 'like' to show up on someone's wall, they also have to comment on it as well.

    Requiring a 'comment' for a 'like' to appear on a Facebook wall negates the value of this quick-click feature.

    Has anyone encountered the same problem or have a solution I haven't seen online, yet?

  7. #27
    Join Date
    Jan 2006
    Posts
    1,542
    Plugin Contributions
    0

    Default Re: Adding Facebook Like Button

    I just "liked" this product, and it showed up on my facebook automatically:

    http://www.prommart.com/index.php?ma...oducts_id=6820

    I used the Facebook button just above my additional photos.

    My Like button at top of page asks for a comment. But even without a comment it went to my facebook.
    Last edited by SPH; 18 Apr 2012 at 10:12 PM.

  8. #28
    Join Date
    Aug 2008
    Location
    Southern California
    Posts
    129
    Plugin Contributions
    0

    Default Re: Adding Facebook Like Button

    Hmmm.... I'll need to see what's going on. We're not having the same success here. So far in our tests, we've had to add a comment to get the product to show up on Facebook.

    I'm actively on this fix now, so I'll keep this thread updated.

  9. #29
    Join Date
    Jan 2006
    Posts
    1,542
    Plugin Contributions
    0

    Default Re: Adding Facebook Like Button

    Just to clarify, I'm not sure what my top facebook button is. It came with this new template I'm using/testing. I can post by clicking Post to Facebook without entering a comment.

    My bottom social buttons are what Picaflor Azul uses in her nice templates. No comment request, just click and it's done.
    Last edited by SPH; 19 Apr 2012 at 03:11 AM.

  10. #30
    Join Date
    Aug 2008
    Location
    Southern California
    Posts
    129
    Plugin Contributions
    0

    Default Re: Adding Facebook Like Button

    Thanks for chiming in. You got a little more lucky than me. I'm still having issues, though. I've tried the methods suggested in this thread and then I tried the Kerrin Hardy method.

    I can get it working, but the thumbnail showing on Facebook isn't the product thumbnail. For whatever reason, it's grabbing a JPEG in my images folder I use for a button graphic. I can't figure out why it wants to grab that and not the product thumbnail.

 

 
Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Facebook Like Button
    By delia in forum All Other Contributions/Addons
    Replies: 346
    Last Post: 11 Feb 2016, 09:01 PM
  2. Facebook like button
    By petestownrich in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 Feb 2015, 07:02 PM
  3. v151 facebook like button
    By ken1 in forum General Questions
    Replies: 0
    Last Post: 14 May 2014, 07:03 PM
  4. facebook like button and google + button in Header.
    By Horrific_ending in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 4 Jan 2012, 04:46 PM
  5. Facebook like button
    By rdsbaker in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 25 Mar 2011, 07:00 PM

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