Results 1 to 10 of 16

Hybrid View

  1. #1

    Default Facebook LIKE button adds wrong picture

    I just added this small edit to my cart and it works great except for one minor issue...when you comment on an item, it posts to your facebook page but the image that is automatically attached is not from what you just liked! Is there any known way to fix this?

    Here is a link to the edit I did: http://www.zenflavor.com/add-faceboo...uct-pages.html

    My cart: https://www.bigmacktrucks.com/store/
    Version: 1.38a

    Thanks in advance for any info!

  2. #2
    Join Date
    Mar 2010
    Location
    Canada
    Posts
    46
    Plugin Contributions
    0

    Default Re: Facebook LIKE button adds wrong picture


  3. #3
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

    Default Re: Facebook LIKE button adds wrong picture

    Yes, add this code to your html_header.php

    <meta property="og:title" content="<?php echo META_TAG_TITLE; ?>" />
    <meta property="og:type" content="product" />
    <meta property="og:site_name" content="<?php echo STORE_NAME; ?>" />
    <meta property="og:fb_admin" content="your Facebook admin number if you're using FB insights" />

    <?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 = 'insert a default image url here';
    }
    if ($fb_image != '') {
    ?>
    <meta property="og:image" content="<?php echo $fb_image; ?>" />
    <?php
    }
    ?>

  4. #4

    Default Re: Facebook LIKE button adds wrong picture

    Quote Originally Posted by dgent View Post
    Yes, add this code to your html_header.php

    <meta property="og:title" content="<?php echo META_TAG_TITLE; ?>" />
    <meta property="og:type" content="product" />
    <meta property="og:site_name" content="<?php echo STORE_NAME; ?>" />
    <meta property="og:fb_admin" content="your Facebook admin number if you're using FB insights" />

    <?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 = 'insert a default image url here';
    }
    if ($fb_image != '') {
    ?>
    <meta property="og:image" content="<?php echo $fb_image; ?>" />
    <?php
    }
    ?>
    What is the path to html_header.php? I can't seem to locate it in my FTP??

  5. #5
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

    Default Re: Facebook LIKE button adds wrong picture

    includes/templates/YOUR_TEMPLATE/common

  6. #6

    Default Re: Facebook LIKE button adds wrong picture

    Quote Originally Posted by dgent View Post
    includes/templates/YOUR_TEMPLATE/common
    OK, found that but now, where do I add your code? I tried adding to the top of the page and it killed the online cart...

 

 

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

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