Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

FaceBook Friendly
 
Reply
   X-Cart forums > Forum archive > Using X-Cart in my project > Need advice
 
Thread Tools
  #1  
Old 03-20-2013, 08:07 PM
 
elmirage001 elmirage001 is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,590
 

Default FaceBook Friendly

I'm currently building my 4.5.5 site so that all pages are Facebook Open Graph friendly. I do not use Socialize as I use ShareThis. I am using Jon's xCMS and also testing fCommerce. Now Facebook will pull accurate information and images from any links to my site put on Facebook.

I've added the following to my service_head.tpl with Product = Blue, xCMS = Green and all other Pages = Purple. The 2 Red lines are modified x-cart functions to get the page title and page description.

I also had to comment out the fCommerce config.php Open Graph information as it was loading information including a dynamic URL which was causing the debugger to fail.

Facebook debugging tool: http://developers.facebook.com/tools/debug

I welcome Steve and Jon's tweaking of the code below. I'm sure they can make it better! If anyone is interested in this let me know and I'll go into more detail of what I did.

Quote:
{if $main eq "product"}
{assign var="prod_descr" value=$product.descr|default:$product.fulldescr}
<meta property="fb:app_id" content="your_facebook_add_id" />
<meta property="og:type" content="website"/>
<meta property="og:url" content="{$http_location}{$php_url.url}"/>
<meta property="og:title" content="{$product.product|escape}"/>
<meta property="og:description" content="{$prod_descr|truncate:'500':'...':false|s trip_tags}" />
<meta property="og:image" content="{$current_location}/image.php?type={$type|default:'P'}&id={$product.pr oductid}" />
<meta property="og:site_name" content="{$lng.lbl_site_name|default:$config.Compa ny.company_name|amp}" />

{elseif $xcmsEntry.subject}
<meta property="fb:app_id" content="your_facebook_add_id" />
<meta property="og:type" content="website"/>
<meta property="og:url" content="http://{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_ URI}"/>
<meta property="og:title" content="{$xcmsEntry.subject}"/>
<meta property="og:description" content="{$xcmsEntry.synopsis}"/>
<meta property="og:image" content="{$xcmsEntry.icon_url|amp}" />

{else}
<meta property="fb:app_id" content="your_facebook_add_id" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_ URI}" />

{get_title_facebook page_type=$meta_page_type page_id=$meta_page_id}
{meta_facebook type='description' page_type=$meta_page_type page_id=$meta_page_id}
<meta property="og:image" content="{$current_location}/images/default_facebook.jpg" />
{/if}
__________________
X-Cart GoldPlus v4.7.11 | PHP 7.2.22
  • XCARTMODS.CO.UK | reBOOT Template |
  • Smack Digital | CDSEO Pro 2.0 + Custom Replacements | Category SEO Map |
  • Total Server Solutions Hosting | Linux | PHP v7.2 | MySQL v5.6.40 |
Reply With Quote

The following user thanks elmirage001 for this useful post:
a-bomberg (04-28-2014)
  #2  
Old 03-20-2013, 09:01 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 13,586
 

Default Re: FaceBook Friendly

Just out of curiosity what is the benefit of FB and having FB knowing everything about the site? I know my position of disliking all so called social sites (at the end there is nothing social about it) may be too drastic but what is the benefit anyway?
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 03-21-2013, 07:23 AM
 
elmirage001 elmirage001 is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,590
 

Default Re: FaceBook Friendly

Hi Steve! I share your thoughts and concerns and I do not trust Facebook or any other social media outfit. Unfortunately we have way too customers and future customers who spend (waste) way too much time on them. And, Google expects our sites to be socially active and now to show authorship for our content and Google+.

If we had a captive audience I would not have to worry about it but we have a very unique niche (which you'll hopefully see tomorrow) and have to reach people who never knew they could, or thought about, purchasing what we have for sale.

I spend maybe 10 to 15 minutes a week checking out posts on Facebook / Twitter. We use Facebook and Twitter for marketing purposes and all our posts are automatic. I'm currently checking out Google+ & Authorship.

Our Workflow:

1. Write content in xCMS
2. The xCMS RSS feed is read by my http://dlvr.it/ account.
3. dlvr.it sends the new content as posts to Facebook and Twitter.

We need and want the content on our site anyway (especially with Penguin and Panda) and without any extra work we have links to our articles and promotional items automatically on Facebook and Twitter. Once posted, they can be liked, shared and commented on. I hope this better explains what we do and why we are on Facebook
__________________
X-Cart GoldPlus v4.7.11 | PHP 7.2.22
  • XCARTMODS.CO.UK | reBOOT Template |
  • Smack Digital | CDSEO Pro 2.0 + Custom Replacements | Category SEO Map |
  • Total Server Solutions Hosting | Linux | PHP v7.2 | MySQL v5.6.40 |
Reply With Quote
  #4  
Old 03-21-2013, 09:14 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 13,586
 

Default Re: FaceBook Friendly

No I was just curious. For sure there are benefots for some businesses....
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 03-28-2013, 01:01 PM
 
thebluedoorboutique thebluedoorboutique is offline
 

Senior Member
  
Join Date: May 2011
Posts: 131
 

Default Re: FaceBook Friendly

Facebook uses these meta descriptions to pull data when sharing links on Facebook, etc.
__________________
X-Cart Classic 4.4.X
Reply With Quote
  #6  
Old 04-17-2013, 09:56 PM
 
espresso espresso is offline
 

eXpert
  
Join Date: Apr 2007
Location: Ontario, Canada
Posts: 224
 

Default Re: FaceBook Friendly

We use HootSuite to pull xCMS entries and post them instantly to FB and Twitter via the RSS feature of xCMS.
__________________
Rene
End user - merchant
Did the big jump from 4.5.3 to 4.6.6
Testing 5
Mods:
CDSEO-Pro, xCMS, Create-A-Sale, OPC AC, Cash Rewards AC, On-Sale AC, Smart-Search AC, Kit Builder AC, Manufacturer-A-Z, Product-Bundle, Remember-Cart, Testimonials, Customer Quotes, CFL mods and many more.
Reply With Quote
  #7  
Old 04-27-2013, 05:58 PM
 
Danimal Danimal is offline
 

Senior Member
  
Join Date: Sep 2006
Posts: 134
 

Default Re: FaceBook Friendly

Quote:
Originally Posted by cflsystems
Just out of curiosity what is the benefit of FB and having FB knowing everything about the site? I know my position of disliking all so called social sites (at the end there is nothing social about it) may be too drastic but what is the benefit anyway?


I tripped over this looking for something else.

I too am not a fan of social sites. However, I know that our customers are so I make it as social friendly as possible. The OG tags help me know that our information is displayed in a way we want it to be, correctly.
__________________
~Dani

For version & mods installed, see post.
Reply With Quote
  #8  
Old 04-27-2013, 07:07 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 13,586
 

Default Re: FaceBook Friendly

That's the thing right - whatever we do in life we do it because someone else is doing it not because it makes sense Maybe I just still live in the 80's and 90's when everything was simpler...
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #9  
Old 04-27-2013, 08:55 PM
 
elmirage001 elmirage001 is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,590
 

Default Re: FaceBook Friendly

Quote:
Originally Posted by Danimal
I tripped over this looking for something else.

I too am not a fan of social sites. However, I know that our customers are so I make it as social friendly as possible. The OG tags help me know that our information is displayed in a way we want it to be, correctly.
You're absolutely correct! That's exactly why I added the OG tags. Facebook was visiting our site anyway and was pulling incorrect information and incorrect images off the pages. This way I'm in control of what text and images get displayed on Facebook.
__________________
X-Cart GoldPlus v4.7.11 | PHP 7.2.22
  • XCARTMODS.CO.UK | reBOOT Template |
  • Smack Digital | CDSEO Pro 2.0 + Custom Replacements | Category SEO Map |
  • Total Server Solutions Hosting | Linux | PHP v7.2 | MySQL v5.6.40 |
Reply With Quote
  #10  
Old 04-27-2013, 09:08 PM
 
elmirage001 elmirage001 is offline
 

X-Wizard
  
Join Date: Apr 2007
Posts: 1,590
 

Default Re: FaceBook Friendly

Quote:
Originally Posted by cflsystems
That's the thing right - whatever we do in life we do it because someone else is doing it not because it makes sense Maybe I just still live in the 80's and 90's when everything was simpler...
Hi Steve, want to see a really sad statistic? I wanted to check up on the news before going to bed and saw this...
Quote:
A new survey from consumer and business credit reporting company Experian found Americans spend on average, 16 minutes of every hour spent online on social networking sites.
__________________
X-Cart GoldPlus v4.7.11 | PHP 7.2.22
  • XCARTMODS.CO.UK | reBOOT Template |
  • Smack Digital | CDSEO Pro 2.0 + Custom Replacements | Category SEO Map |
  • Total Server Solutions Hosting | Linux | PHP v7.2 | MySQL v5.6.40 |
Reply With Quote
Reply
   X-Cart forums > Forum archive > Using X-Cart in my project > Need advice


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:08 PM.

   

 
X-Cart forums © 2001-2018