Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2013
    Posts
    123
    Plugin Contributions
    0

    Default Facebook like button

    ok I got the code, where do I put it !

  2. #2
    Join Date
    Sep 2008
    Posts
    210
    Plugin Contributions
    21

    Default Re: Facebook like button

    Suggestion: addthis.com
    Our Site: http://zucando.com
    Marketing Plugins: Marketing Modules
    Free Response Templates: Responsive Templates

  3. #3
    Join Date
    Aug 2013
    Posts
    123
    Plugin Contributions
    0

    Default Re: Facebook like button

    <div id="fb-root"></div>
    <script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
    fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>


    <div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>


    here is the code, I tried putting it in top nav , define page status, footer, no dice

    cant get it working, anyone got any tips? I tried the app you are talking about, it does work and it installed very easy. But I don't like it

  4. #4
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Facebook like button

    You can add it to your header:
    includes/templates/YOUR_TEMPLATE/common/tpl_header.php

    <!--bof-header logo and navigation display-->

    <div id="headerWrapper">

    <div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>


    </div>

    You'll then need to adjust the CSS class to position it where you'd like it.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  5. #5
    Join Date
    Aug 2013
    Posts
    123
    Plugin Contributions
    0

    Default Re: Facebook like button

    where do I put it? : )

    ?>

    <?php
    // Display all header alerts via messageStack:
    if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
    }
    if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
    echo htmlspecialchars(urldecode($_GET['error_message']));
    }
    if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
    echo htmlspecialchars($_GET['info_message']);
    } else {

    }

    // test if box should display
    $show_languages= true;

    if ($show_languages == true) {
    if (!isset($lng) || (isset($lng) && !is_object($lng))) {
    $lng = new language;
    }

    reset($lng->catalog_languages);
    $languages_array = array();
    $current_language = '';
    while (list($key, $value) = each($lng->catalog_languages)) {
    $languages_array_popup[$key] = $value['name'];
    }

    foreach ($languages_array_popup as $k => $v){
    if ($k == $_SESSION['languages_code']) {
    $current_language = $v;
    }
    }
    }
    ?>


    <!--bof-header logo and navigation display-->
    <?php
    if (!isset($flag_disable_header) || !$flag_disable_header) {
    ?>
    <div id="headerWrapper">

    <!--bof-branding display-->
    <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
    <!--eof-branding display-->


    <div>
    <!--bof-header ezpage links-->
    <div class="topper-menu float-right">
    <?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
    <?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
    <?php } ?>
    </div>
    <!-- Languages/currency -->
    <div class="languages-wrapper">
    <?php
    $languges_object = new language;
    if (count ($languges_object->catalog_languages) > 1){
    ?>
    <div class="languages">
    <?php require($template->get_template_dir('tpl_languages_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_languages_header.php'); ?>

    <div id="langPopup" class="popup popup-win">
    <img class="close-pic float-right" src="<?php echo ($template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images'). '/close_pic.gif'); ?>" alt="close" />
    <?php require(DIR_WS_MODULES . zen_get_module_directory('header_languages.php')); ?>
    </div>
    </div>
    <?php
    }
    ?>

    <?php
    if (isset($currencies) && is_object($currencies) && count ($currencies->currencies) > 1){
    ?>
    <div class="currency">
    <?php require($template->get_template_dir('tpl_currency_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_currency_header.php'); ?>

    <div id="currPopup" class="popup popup-win">
    <img id="close-pic" class="close-pic float-right" src="<?php echo ($template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images'). '/close_pic.gif'); ?>" alt="close" />
    <ul class="list-popup">
    <?php foreach ($currencies_array_popup as $k=>$v) { ?>
    <li><a href="<?php if ((stripos($_SERVER['REQUEST_URI'], '.php')) !== false ) echo $_SERVER['REQUEST_URI']; else echo '?'; ?><?php echo '&amp;currency='.$k; ?>"><?php echo $v; ?></a></li>
    <?php }?>
    </ul>
    </div>
    </div>
    <?php
    }
    ?>
    </div>
    <!--eof-header ezpage links-->


    <div class="clearRight"></div>

    <?php
    require($template->get_template_dir('tpl_top_nav.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_top_nav.php');
    ?>

    <?php
    if ($this_is_home_page) {
    if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
    ?>
    <div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
    <?php
    }
    }
    }
    ?>

    </div>
    <div class="clearBoth"></div>
    <!-- tools section -->
    <div class="tools-wrp">
    <div id="tools_wrapper" class="align-center">
    <div id="search-panel">
    <div class="float-left td-search-header">
    <div class="search-header float-left">
    <?php require($template->get_template_dir('tpl_search_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_search_header.php');?>
    <div class="advanced_search float-left">
    <a href="index.php?main_page=advanced_search"><?php echo HEADER_ADVANCED_SEARCH; ?></a>
    </div>
    </div>
    </div>
    <div align="right" class="cart-header-wrapper">
    <!-- header cart section -->
    <table align="right" class="align-center cart-header">
    <tr>
    <td></td>
    <td class="cart-img-td">
    <?php require($template->get_template_dir('tpl_shopping_cart_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_shopping_cart_header.php');
    echo $content;?>
    </td>
    <td id="delim"></td>
    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <td class="orange-link">
    <a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a>
    </td>
    <?php } else { ?>
    <td class="blue-link">
    <a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a>
    </td>
    <?php } ?>
    </tr>
    </table>
    </div>
    </div>
    </div>

    <!-- mobile header -->
    <div id="top_nav_mobile">
    <div id="tab_nav_mobile">
    <ul class="list-style-none">
    <li class="tm-catalog <?php echo $active;?>">
    <span class="dlm"></span>
    <a id="catalog"><?php echo '<img src="'. $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images') . '/spacer.gif" width="50" height="50" alt="" />'; ?></a>
    </li>

    <?php
    if ($current_page_base == 'account' || $current_page_base == 'login' || $current_page_base == 'account_edit' || $current_page_base == 'address_book' || $current_page_base == 'account_password' || $current_page_base == 'account_newsletters' || $current_page_base == 'account_notifications') { $active = 'tab-active';
    } else { $active = '';
    }?>
    <li class="tm-account <?php echo $active;?>"><span class="dlm"></span><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo '<img src="'. $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images') . '/spacer.gif" width="50" height="50" alt="" />'; ?></a></li>

    <?php
    if ($current_page_base == 'shopping_cart') { $active = 'tab-active'; $item_id = '';
    } else { $active = ''; $item_id = 'cart-icon';
    }?>
    <li class="tm-cart <?php echo $active;?>"><span class="dlm"></span>
    <a class="<?php echo $item_id; ?>" href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo '<img src="'. $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images') . '/spacer.gif" width="50" height="50" alt="" />'; ?>
    <?php if ($product_amount > 0) { ?><span class="cart-amount"><?php echo $product_amount; ?></span><?php } ?>
    </a>
    </li>

    <?php
    if ($current_page_base == 'advanced_search') { $active = 'tab-active';
    } else { $active = '';
    }?>
    <li class="tm-search <?php echo $active;?>"><span class="dlm"></span><a href="index.php?main_page=advanced_search"><?php echo '<img src="'. $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images') . '/spacer.gif" width="50" height="50" alt="" />'; ?></a></li>
    </ul>
    </div>
    <?php require(DIR_WS_MODULES . $template_dir . '/categories_popup.php');
    echo $content; ?>
    </div>
    <!-- /mobile header -->

    <!-- cart popup -->
    <div id="cart_popup" class="cart-dropdown-wrapper popup">
    <div class="cart-tab-wrapper"><img src="<?php echo $template->get_template_dir('', DIR_WS_TEMPLATE, $current_page_base,'images')?>/spacer.gif" width="1" height="1" alt="" /></div>
    <div class="popup-border">
    <div class="content-wrapper">
    <div class="cart-scrolling-wrapper">
    <?php require($template->get_template_dir('tpl_shopping_cart_popup.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_shopping_cart_popup.php');
    echo $content; ?>
    </div>

    <div class="popup-cart-link-box">
    <a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL')?>"><?php echo CART_POPUP_VIEW_CART; ?></a>
    <a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a>
    </div>
    </div>
    </div>
    </div>
    <!-- /cart popup -->

    </div>
    <!-- /tools section -->
    </div>
    <?php } ?>

  6. #6
    Join Date
    Aug 2013
    Posts
    123
    Plugin Contributions
    0

    Default Re: Facebook like button

    if (!isset($flag_disable_header) || !$flag_disable_header) {

    is this blocking it? I put it below and it wont show on page

  7. #7
    Join Date
    Jun 2004
    Location
    Northern Rivers, NSW
    Posts
    159
    Plugin Contributions
    0

    Default Re: Facebook like button

    Include the JavaScript SDK on your page once, ideally right after the opening <body> tag.
    My guess is on includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php
    Code:
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    Place the code for your plugin wherever you want the plugin to appear on your page.
    Code:
    <div class="fb-like" data-href="YOUR_URL" data-width="450" data-layout="standard" data-action="like" data-show-faces="false" data-share="true"></div>
    I'm just guessing here :)

  8. #8
    Join Date
    Jun 2004
    Location
    Northern Rivers, NSW
    Posts
    159
    Plugin Contributions
    0

    Default Re: Facebook like button

    Just wanted to update this for anyone else who might search how to do this....
    It works perfectly if you do as I explain above to add a simple Like & Share button that will link back to your website.

    You can take it one step further if you want your site visitors to like & share individual products.

    What I have done is, in my product description, I include the code
    Code:
    <div class="fb-like" data-href="WHATEVER_ADDRESS_THE_PAGE_IS" data-width="450" data-layout="standard" data-action="like" data-show-faces="false" data-share="true"></div>
    where I'd like the Like and Share buttons to show up.
    Then I add the product to my catalog and go and view it, making sure to select the url from index onwards, then go back to that product description and add the url in the "WHATEVER_ADDRESS_THE_PAGE_IS" section. Make sure to save this out.
    Now when someone clicks on Share, that product, not just your website, will be shared on their Facebook, giving your products individual exposure. It's a bit of extra work, but for someone like me who creates a wide range of different items it's worth it.

 

 

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