Page 1 of 1

Facebook Like Issue

Posted: Thu Apr 21, 2011 9:30 am
by SamsSteins
I have noticed when liking a product, via able 7.0.7, it is not selecting the product image, but an image from the MORE ITEMS section of the page. Is there a way to have it use the actual product image?

Re: Facebook Like Issue

Posted: Thu Apr 21, 2011 10:34 am
by JaminLeather
You can force Facebook to use a specific image, as well as specify other pertinent information about the page by using the Facebook Open Graph Tags. Use the following link for more information. http://developers.facebook.com/docs/ref ... gins/like/

You can include these Tags in the header of your project page with a simple modification to your Products.aspx file.

Code: Select all

    protected void Page_Load(object sender, EventArgs e)
    {
        if (_Product != null)
        {
            if (!Page.IsPostBack)
                //REGISTER THE PAGEVIEW
                CommerceBuilder.Reporting.PageView.RegisterCatalogNode(_Product.ProductId, CatalogNodeType.Product);
            PageHelper.BindMetaTags(this, _Product);
            Page.Title = _Product.Name;
            //BEGIN Add Facebook Open Graph Tags to Page Header
            string facebookTitle = _Product.Name;
            string facebookType = "product";
            string facebookImage = _Product.ThumbnailUrl.Replace("~", "http://www.yoursite.com");
            string facebookUrl = _Product.NavigateUrl.Replace("~", "http://www.yoursite.com");
            string facebookSiteName = "YourSiteName";
            string facebookAdmin = "FacebookPageAdministratorName";
            Page.Header.Controls.Add(new LiteralControl("\r\r<meta property=\"og:title\" content=\"" + facebookTitle + "\"/>\r"));
            Page.Header.Controls.Add(new LiteralControl("<meta property=\"og:type\" content=\"" + facebookType + "\"/>\r"));
            Page.Header.Controls.Add(new LiteralControl("<meta property=\"og:image\" content=\"" + facebookImage + "\"/>\r"));
            Page.Header.Controls.Add(new LiteralControl("<meta property=\"og:url\" content=\"" + facebookUrl + "\"/>\r"));
            Page.Header.Controls.Add(new LiteralControl("<meta property=\"og:site_name\" content=\"" + facebookSiteName + "\"/>\r"));
            Page.Header.Controls.Add(new LiteralControl("<meta property=\"fb:admins\" content=\"" + facebookAdmin + "\"/>\r\r"));
            //END Add Facebook Open Graph Tags to Page Header
        }
    }
This is just an example of how I set mine up.

Re: Facebook Like Issue

Posted: Fri May 13, 2011 7:17 am
by plugables
You will need to use the open graph protocol for this. Default 7.0.7 implementation does not do that. You can use the alternate free implementation of FaceBook like widget that takes care of this and more.
http://blog.plugables.com/featured/2202 ... ecommerce/
http://www.plugables.com/Facebook-Like-Widget-P21.aspx

Re: Facebook Like Issue

Posted: Fri May 13, 2011 1:00 pm
by dduchene
how do i add the send button the the plubables "like" button plugin? tried adding "&send=true" after the {0}, but to no avail. thanks in advance.

Re: Facebook Like Issue

Posted: Mon May 16, 2011 11:02 am
by plugables
dduchene wrote:how do i add the send button the the plubables "like" button plugin? tried adding "&send=true" after the {0}, but to no avail. thanks in advance.
send button ???

Re: Facebook Like Issue

Posted: Fri May 20, 2011 10:53 am
by jasonhendee
Integrated this today - Thank you!!

Question - I have been testing with the facebook url linter (http://developers.facebook.com/tools/lint), and for the description of the product, it doesn't seem to be pulling any text from the description field of the current product, but rather it's pulling the name and price from the first product in the 'Top Sellers' control which I have in the right sidebar. Any thoughts regarding this? Again, thanks for providing this control for free!