Wednesday, January 25, 2012

Social media buttons


//linked in like button
http://developer.linkedin.com/plugins/share-button

//twitter tweet button
https://twitter.com/about/resources/buttons#tweet
https://dev.twitter.com/docs/tweet-button

//facebook like button
http://developers.facebook.com/docs/reference/plugins/like/

//google +1 button
http://www.google.com/intl/en/webmasters/+1/button/index.html

Get Current CMS Page : Magento(CMS Pages Data)

// get current cms page from Mage:getSingleton
$cms_id = Mage::getSingleton('cms/page')->getIdentifier();
$cms_title = Mage::getSingleton('cms/page')->getTitle();
$cms_content = Mage::getSingleton('cms/page')->getContent();

Get Current Category : Magento(Category Data)

// get current category from Mage:registry
$currentcategory = Mage::registry('current_category');

// general category data
echo $currentcategory->getName();
echo $currentcategory->getId();
echo $currentcategory->getImageUrl();
echo $currentcategory->getUrl();

Get Current Product : Magento (Product Data)

// get current product from Mage:registry
$currentproduct = Mage::registry('current_product');

// general product data
echo $currentproduct->getName();
echo $currentproduct->getId();
echo $currentproduct->getProductUrl();
echo $currentproduct->getSku();

// get attributes
echo $currentproduct->getAttributeText('attribute_name');

// get image src
echo $this->helper('catalog/image')->init($currentproduct, 'small_image')->resize(100);