Page 1 of 3 123 LastLast
Results 1 to 10 of 26
  1. #1
    Join Date
    Dec 2008
    Posts
    38
    Plugin Contributions
    0

    Default Facebook comment box on product pages

    Hi all.
    I tried searching for a way to add Facebook comment box to the product pages, but I couldn't find anyone that had come up with a way to do this.
    After a quick look, I came up with this, which seems to work:

    <!--bof Facebook comments-->
    <div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=APP_ID&amp;xfbml=1"></script><fb:comments href="<?php
    echo zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath= '.(int)$_GET['cPath'].' &products_id=' . (int)$_GET['products_id']);
    ?>" num_posts="5" width="600"></fb:comments>
    <!--eof Facebook comments-->

    Paste the code where you want the comment box to appear on your /includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php

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

    Default Re: Facebook comment box on product pages

    PHP Code:
    'cPath= '.(int)$_GET['cPath'
    This will return only the top category, not necessarily the entire cPath. It likely works because you have tested it in a top-level category. The (int) should not be in this section.
    PHP Code:
    'cPath='.$_GET['cPath'
    Also, remove the space after =.

  3. #3
    Join Date
    Dec 2008
    Posts
    38
    Plugin Contributions
    0

    Default Re: Facebook comment box on product pages

    Hi gjh42.
    Thanks for the heads up on the top level issue.
    I only have two levels of categories, and I tried it on products in both top and 2nd level category.

    I'll leave it to people with more than two category levels to test your suggestion.

    Cheers

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

    Default Re: Facebook comment box on product pages

    It may still basically function while using an incomplete cPath. Can you see the cPath that is used in the comment process/link?
    This is the way it is used in /includes/modules/pages/index/header_php.php
    Line #57 :
    zen_redirect(zen_href_link(zen_get_info_page($listing->fields['products_id']), ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing->fields['products_id']));

    which, assuming there is a cPath, can be simplified to

    zen_redirect(zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . $cPath . '&' . 'products_id=' . $listing->fields['products_id']));


    (int) forces a string value to be an integer, and has the effect of discarding any characters after initial numerals.
    '3_57' would become 3.
    Last edited by gjh42; 16 Apr 2011 at 04:51 PM.

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

    Default Re: Facebook comment box on product pages

    I had recently put a fb like button on my product pages using similar code from picaflor-azul's tutorial, and when I checked the result on fb just now, the backlink led to the product info page, but with the wrong cPath (top cat only, not subcat). This affected the categories sidebox display, and would most likely affect the breadcrumbs.

    When I uploaded a version with the (int) removed and rechecked, it led to the correct info page with the correct cPath. Also, the product image showed on fb where it didn't before.

  6. #6
    Join Date
    Dec 2008
    Posts
    38
    Plugin Contributions
    0

    Default Re: Facebook comment box on product pages

    Hi.
    Yes, you are correct.
    The incomplete cPath was corrected with removal of (int).

    Cheers
    Endre

  7. #7
    Join Date
    Dec 2008
    Posts
    38
    Plugin Contributions
    0

    Default Re: Facebook comment box on product pages

    Quote Originally Posted by Endre View Post
    Hi all.
    I tried searching for a way to add Facebook comment box to the product pages, but I couldn't find anyone that had come up with a way to do this.
    After a quick look, I came up with this, which seems to work:

    <!--bof Facebook comments-->
    <div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=APP_ID&amp;xfbml=1"></script><fb:comments href="<?php
    echo zen_href_link(zen_get_info_page((int)$_GET['products_id']),'cPath= '.(int)$_GET['cPath'].' &products_id=' . (int)$_GET['products_id']);
    ?>" num_posts="5" width="600"></fb:comments>
    <!--eof Facebook comments-->

    Paste the code where you want the comment box to appear on your /includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php
    I'm trying to add admin moderation capabilities to the code, but no luck so far.
    This is what it says on Facebook: "To moderate, you need to list yourself as an admin. To do this, simply include open graph meta tags on the URL specified as the href parameter of the plugin. Include:<meta property="fb:admins" content="YOUR_FACEBOOK_USER_ID}"/>
    I can't seem to find the right place to put this piece of code.
    Any ideas?

    Cheers
    Endre

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

    Default Re: Facebook comment box on product pages

    Have you looked at numinix' tutorial on the subject? That describes adding a bunch of fb og meta properties, so would probably be a good guide.

  9. #9
    Join Date
    Dec 2008
    Posts
    38
    Plugin Contributions
    0

    Default Re: Facebook comment box on product pages

    Hi.
    I can't find this tutorial.
    Have looked at his website, searched toe forum on his website and here.
    Do you have a link to where I can find it?
    I'm very interested in adding moderation capabilities to the FB comments plugin.

    Cheers
    Endre

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

    Default Re: Facebook comment box on product pages

    I saw it a few days ago, but don't have a link to it.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. is there a facebook comment plugins?
    By gavgav in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 9 May 2012, 09:34 PM
  2. adding product specific info into <head> tags on product pages for facebook
    By donplay in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 17 Feb 2010, 01:34 PM
  3. How to add another comment like box on the checkout pages?
    By hc1501 in forum Managing Customers and Orders
    Replies: 3
    Last Post: 10 Oct 2009, 02:31 AM
  4. Add another comment like box on the checkout pages?
    By hc1501 in forum General Questions
    Replies: 0
    Last Post: 9 Oct 2009, 09:58 PM
  5. Comment Box
    By phil8340 in forum General Questions
    Replies: 0
    Last Post: 16 Apr 2009, 06:28 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