Skip to content

Instantly share code, notes, and snippets.

@kepek
Created July 27, 2011 13:04
Show Gist options
  • Save kepek/1109312 to your computer and use it in GitHub Desktop.
Save kepek/1109312 to your computer and use it in GitHub Desktop.
Quick Social Media for Magento
<!-- SOCIAL NETWORK CODE -->
<script type="text/javascript" src="http://connect.facebook.net/<?php echo Mage::app()->getLocale()->getLocaleCode() ?>/all.js#xfbml=1"></script>
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"></script>
<?php $_product = Mage::registry('current_product'); if($_product): ?>
<?php $_header = new Mage_Page_Block_Html_Header(); ?>
<meta property="og:title" content="<?php echo $this->stripTags($_product->getName(), null, true) ?>"/>
<meta property="og:url" content="<?php echo $this->helper('core/url')->getCurrentUrl();?>"/>
<meta property="og:type" content="product"/>
<meta property="og:image" content="<?php echo $this->helper('catalog/image')->init($_product, 'image') ;?>"/>
<meta property="og:site_name" content="<?php echo $_header->getLogoAlt() ?>" />
<?php endif ?>
<!-- END SOCIAL NETWORK CODE -->
<fb:fan profile_id="76925706435" stream="false" connections="5" width="313" height="160" css="http://example.com/fb-home.css?v=111"></fb:fan>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment