Social_Facebook - Version 2.1.1

Version Notes

Facebook Open Graph 2.0 extension is compatible with Magento Enterprise Edition and Professional Edition 1.11 or later, and Magento Community Edition 1.6 or later.

2.1.1: Fixed widget URL failing to recognize secure vs non-secure base URL's, added built-in Like support

Download this release

Release Info

Developer Magento Core Team
Extension Social_Facebook
Version 2.1.1
Comparing to
See all releases


Code changes from version 2.1.0 to 2.1.1

app/code/community/Social/Facebook/Block/Head.php CHANGED
@@ -59,10 +59,14 @@ class Social_Facebook_Block_Head extends Mage_Core_Block_Template
59
  'property' => 'og:image',
60
  'content' => $this->escapeHtml(Mage::helper('catalog/image')->init($product, 'image')->resize(256))
61
  );
62
- $tags[] = array(
63
- 'property' => 'og:description',
64
- 'content' => $this->escapeHtml($product->getShortDescription())
65
- );
 
 
 
 
66
  $tags[] = array(
67
  'property' => $helper->getAppName(). ':price',
68
  'content' => Mage::helper('core')->currency($product->getFinalPrice(), true, false)
59
  'property' => 'og:image',
60
  'content' => $this->escapeHtml(Mage::helper('catalog/image')->init($product, 'image')->resize(256))
61
  );
62
+
63
+ if($product->getShortDescription()!=$product->getName()) {
64
+ $tags[] = array(
65
+ 'property' => 'og:description',
66
+ 'content' => $this->escapeHtml($product->getShortDescription())
67
+ );
68
+ }
69
+
70
  $tags[] = array(
71
  'property' => $helper->getAppName(). ':price',
72
  'content' => Mage::helper('core')->currency($product->getFinalPrice(), true, false)
app/code/community/Social/Facebook/Model/Api.php CHANGED
@@ -328,9 +328,16 @@ class Social_Facebook_Model_Api extends Varien_Object
328
  return false;
329
  }
330
 
 
 
 
 
 
 
 
331
  list($response, $result) = $this->makeFacebookRequest(
332
  array(),
333
- Social_Facebook_Model_Api::URL_GRAPH_FACEBOOK_ABOUT_ME . $appName . ':' . $this->_facebookAction
334
  . '?access_token=' . urlencode($this->_accessToken)
335
  . "&$objectType=". urlencode($this->_productOgUrl),
336
  Zend_Http_Client::POST
328
  return false;
329
  }
330
 
331
+ $url = $appName . ':' . $this->_facebookAction;
332
+
333
+ if(strtolower($this->_facebookAction)=='like') {
334
+ $objectType = 'object';
335
+ $url = 'og.likes';
336
+ }
337
+
338
  list($response, $result) = $this->makeFacebookRequest(
339
  array(),
340
+ Social_Facebook_Model_Api::URL_GRAPH_FACEBOOK_ABOUT_ME . $url
341
  . '?access_token=' . urlencode($this->_accessToken)
342
  . "&$objectType=". urlencode($this->_productOgUrl),
343
  Zend_Http_Client::POST
app/design/frontend/base/default/template/social/facebook/box.phtml CHANGED
@@ -44,7 +44,7 @@ $actions = $this->getAllActions();
44
  <?php foreach($this->getFriendBox($action['action']) as $facebookId => $facebookName): ?>
45
  <div class="facebookUser">
46
  <a href="https://www.facebook.com/<?php echo $facebookId?>" target="_blank">
47
- <img border="0" src="http://graph.facebook.com/<?php echo $facebookId?>/picture" alt="<?php $this->escapeHtml($facebookName)?>" title="<?php $this->escapeHtml($facebookName)?>" class="facebookUserImg">
48
  <span title="<?php echo $this->escapeHtml($facebookName)?>"><?php echo $this->escapeHtml($facebookName)?></span>
49
  </a>
50
  </div>
44
  <?php foreach($this->getFriendBox($action['action']) as $facebookId => $facebookName): ?>
45
  <div class="facebookUser">
46
  <a href="https://www.facebook.com/<?php echo $facebookId?>" target="_blank">
47
+ <img border="0" src="<?php if(Mage::app()->getFrontController()->getRequest()->isSecure()) { echo 'https'; } else { echo 'http'; } ?>://graph.facebook.com/<?php echo $facebookId?>/picture" alt="<?php $this->escapeHtml($facebookName)?>" title="<?php $this->escapeHtml($facebookName)?>" class="facebookUserImg">
48
  <span title="<?php echo $this->escapeHtml($facebookName)?>"><?php echo $this->escapeHtml($facebookName)?></span>
49
  </a>
50
  </div>
app/design/frontend/base/default/template/social/facebook/socialdata.phtml CHANGED
@@ -1,7 +1,7 @@
1
  <div id="social_facebook_block"></div>
2
  <script>
3
  new Ajax.Updater('social_facebook_block', '<?php
4
- echo Mage::getUrl('facebook/index/widget/', array('id' => urlencode((int)$this->getRequest()->getParam('id')),'_secure' => true));
5
  ?>', {
6
  method: 'get'
7
  });
1
  <div id="social_facebook_block"></div>
2
  <script>
3
  new Ajax.Updater('social_facebook_block', '<?php
4
+ echo Mage::getUrl('facebook/index/widget/', array('id' => urlencode((int)$this->getRequest()->getParam('id')), '_secure' => Mage::app()->getFrontController()->getRequest()->isSecure()));
5
  ?>', {
6
  method: 'get'
7
  });
package.xml CHANGED
@@ -1,18 +1,20 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Social_Facebook</name>
4
- <version>2.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Facebook Open Graph Extension for Magento</summary>
10
- <description>Facebook Open Graph 2.0 extension allows merchants to add new social buttons to their store which results in higher click-to-sale, and upsells. The extension uses Facebook Open Graph 2.0 protocol which allows merchants to add Facebook action buttons on product pages.</description>
11
- <notes>Facebook Open Graph 2.0 extension is compatible with Magento Enterprise Edition and Professional Edition 1.11 or later, and Magento Community Edition 1.6 or later.</notes>
12
- <authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
13
- <date>2013-01-02</date>
14
- <time>07:28:47</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="Social_Facebook.xml" hash="b15af76b10945d00b8dbad23aebc0f50"/></dir></target><target name="magecommunity"><dir name="Social"><dir name="Facebook"><dir name="Block"><file name="Action.php" hash="3804657fa2a304d87c51f92e5ae61d27"/><dir><dir name="Adminhtml"><file name="Facebuttons.php" hash="545099576c8530dac2c7d50c49709b10"/><file name="Select.php" hash="0835b7782edfdfa900a65b397acfd7f5"/><dir name="System"><dir name="Form"><dir name="Renderer"><dir name="Config"><file name="AuthButton.php" hash="7a9736e4b09150450a480d1867536d8b"/><file name="RegisterButton.php" hash="f871a32f3f66a6496ea30a7948be2886"/></dir></dir></dir></dir></dir></dir><file name="Box.php" hash="f856c36c36a826fc5848d6a1dc2350c2"/><file name="Head.php" hash="0f03a964f526eacb27877cbf43c31cff"/><file name="Socialdata.php" hash="36466e7a19a065bd0558c21e59b6ab63"/><file name="Start.php" hash="f37f21ecb2990a4b08e27a635a5b577a"/><dir name="Adminhtml"><file name="Facebuttons.php" hash="545099576c8530dac2c7d50c49709b10"/><file name="Select.php" hash="0835b7782edfdfa900a65b397acfd7f5"/><dir name="System"><dir name="Form"><dir name="Renderer"><dir name="Config"><file name="AuthButton.php" hash="7a9736e4b09150450a480d1867536d8b"/><file name="RegisterButton.php" hash="f871a32f3f66a6496ea30a7948be2886"/><file name="AuthButton.php" hash="7a9736e4b09150450a480d1867536d8b"/><file name="RegisterButton.php" hash="f871a32f3f66a6496ea30a7948be2886"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="9d0e16a0366181bcee404a19bbc63b89"/></dir><dir name="Model"><file name="Api.php" hash="b78c21853aafb7d64c017f49046c3c96"/><file name="Facebook.php" hash="b336994417ce896a6bc002c29a6b0140"/><file name="Facebuttons.php" hash="174e8d6bbc004115bfe56b2a3933acc9"/><file name="Observer.php" hash="5d4c49602ffe0e437b73800e7d94e369"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Authorization.php" hash="94043f184d8909f04f93fdb91fc77d9f"/><file name="Authorization.php" hash="94043f184d8909f04f93fdb91fc77d9f"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="b47cf089b908303e72d509f69a6d2ff2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="357bed8aa09d3c21de1e255eeb656bc8"/><file name="cainfo.crt" hash="d71190e16258f8ba11959e711b85a87b"/><file name="config.xml" hash="0ec6e711a3b58ec35eb64823182c27e8"/><file name="social.events.product.fetch.json" hash="6e70834b3deb5a79000c6611c96403cc"/><file name="social.events.product.fetchSucceeded.json" hash="a26bdb243def788240cd74e83eb46944"/><file name="social.events.product.new.json" hash="c54901dccdc338263d2a62ec701ed84c"/><file name="system.tenant.relationship.created.json" hash="a9c359bd51e95fa34727d6c85e8a9aed"/><file name="system.xml" hash="896bbe2934346e1ddd555a7132525fc5"/><file name="xfabric.tenant.updated.json" hash="352322878e26806949308dc98d97538a"/></dir><dir name="locale"><file name="Social_Facebook.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="facebook.css" hash="3640ca91d7edf266c097e5afafe81de9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="social"><dir name="facebook"><file name="action.phtml" hash="3f037aefeb2c1972bae4f9f4bce6db16"/><file name="box.phtml" hash="9ec7546cc97898048712e4e4c106b580"/><file name="empty.phtml" hash="be36fe9381fb91ce85af00a3ae583396"/><file name="page.phtml" hash="81bef9f0829d6b5718f8aecc3dd5a88f"/><file name="socialdata.phtml" hash="55c1a7823c4381b747fd1391d5863f18"/></dir></dir></dir><dir name="layout"><file name="facebook.xml" hash="c18c812d68d18dc40b47f22c456033c5"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="social"><dir name="facebook"><dir name="system"><dir name="config"><file name="button.phtml" hash="f60245da1dfc1d6c8d2dd54f501043cb"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
 
 
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>PDO</name><min>1.0.0</min><max>10.0.0</max></extension></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Social_Facebook</name>
4
+ <version>2.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Facebook Open Graph Extension for Magento</summary>
10
+ <description>Facebook Open Graph 2.0 extension allows merchants to add new social buttons to their store which results in higher click-to-sale and upsells. The extension uses Facebook Open Graph 2.0 protocol which allows merchants to add Facebook action buttons on product pages.</description>
11
+ <notes>Facebook Open Graph 2.0 extension is compatible with Magento Enterprise Edition and Professional Edition 1.11 or later, and Magento Community Edition 1.6 or later.&#xD;
12
+ &#xD;
13
+ 2.1.1: Fixed widget URL failing to recognize secure vs non-secure base URL's, added built-in Like support</notes>
14
+ <authors><author><name>Magento Core Team</name><user>core</user><email>jawed@php.net</email></author></authors>
15
+ <date>2013-01-17</date>
16
+ <time>04:09:22</time>
17
+ <contents><target name="mageetc"><dir name="modules"><file name="Social_Facebook.xml" hash="b15af76b10945d00b8dbad23aebc0f50"/></dir></target><target name="magecommunity"><dir name="Social"><dir name="Facebook"><dir name="Block"><file name="Action.php" hash="3804657fa2a304d87c51f92e5ae61d27"/><dir><dir name="Adminhtml"><file name="Facebuttons.php" hash="545099576c8530dac2c7d50c49709b10"/><file name="Select.php" hash="0835b7782edfdfa900a65b397acfd7f5"/><dir name="System"><dir name="Form"><dir name="Renderer"><dir name="Config"><file name="AuthButton.php" hash="7a9736e4b09150450a480d1867536d8b"/><file name="RegisterButton.php" hash="f871a32f3f66a6496ea30a7948be2886"/></dir></dir></dir></dir></dir></dir><file name="Box.php" hash="f856c36c36a826fc5848d6a1dc2350c2"/><file name="Head.php" hash="34207df310c66ae0eca0a451b357df35"/><file name="Socialdata.php" hash="36466e7a19a065bd0558c21e59b6ab63"/><file name="Start.php" hash="f37f21ecb2990a4b08e27a635a5b577a"/><dir name="Adminhtml"><file name="Facebuttons.php" hash="545099576c8530dac2c7d50c49709b10"/><file name="Select.php" hash="0835b7782edfdfa900a65b397acfd7f5"/><dir name="System"><dir name="Form"><dir name="Renderer"><dir name="Config"><file name="AuthButton.php" hash="7a9736e4b09150450a480d1867536d8b"/><file name="RegisterButton.php" hash="f871a32f3f66a6496ea30a7948be2886"/><file name="AuthButton.php" hash="7a9736e4b09150450a480d1867536d8b"/><file name="RegisterButton.php" hash="f871a32f3f66a6496ea30a7948be2886"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="9d0e16a0366181bcee404a19bbc63b89"/></dir><dir name="Model"><file name="Api.php" hash="bbfeb07bcdbe9e36d154c5d23b944d89"/><file name="Facebook.php" hash="b336994417ce896a6bc002c29a6b0140"/><file name="Facebuttons.php" hash="174e8d6bbc004115bfe56b2a3933acc9"/><file name="Observer.php" hash="5d4c49602ffe0e437b73800e7d94e369"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Authorization.php" hash="94043f184d8909f04f93fdb91fc77d9f"/><file name="Authorization.php" hash="94043f184d8909f04f93fdb91fc77d9f"/></dir></dir></dir></dir><dir name="controllers"><file name="IndexController.php" hash="b47cf089b908303e72d509f69a6d2ff2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="357bed8aa09d3c21de1e255eeb656bc8"/><file name="cainfo.crt" hash="d71190e16258f8ba11959e711b85a87b"/><file name="config.xml" hash="0ec6e711a3b58ec35eb64823182c27e8"/><file name="social.events.product.fetch.json" hash="6e70834b3deb5a79000c6611c96403cc"/><file name="social.events.product.fetchSucceeded.json" hash="a26bdb243def788240cd74e83eb46944"/><file name="social.events.product.new.json" hash="c54901dccdc338263d2a62ec701ed84c"/><file name="system.tenant.relationship.created.json" hash="a9c359bd51e95fa34727d6c85e8a9aed"/><file name="system.xml" hash="896bbe2934346e1ddd555a7132525fc5"/><file name="xfabric.tenant.updated.json" hash="352322878e26806949308dc98d97538a"/></dir><dir name="locale"><file name="Social_Facebook.csv" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="facebook.css" hash="3640ca91d7edf266c097e5afafe81de9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="social"><dir name="facebook"><file name="action.phtml" hash="3f037aefeb2c1972bae4f9f4bce6db16"/><file name="box.phtml" hash="c564bb754f896986576b333a4270679f"/><file name="empty.phtml" hash="be36fe9381fb91ce85af00a3ae583396"/><file name="page.phtml" hash="81bef9f0829d6b5718f8aecc3dd5a88f"/><file name="socialdata.phtml" hash="39635e0dff3cb82c31b70298ba1cf542"/></dir></dir></dir><dir name="layout"><file name="facebook.xml" hash="c18c812d68d18dc40b47f22c456033c5"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="social"><dir name="facebook"><dir name="system"><dir name="config"><file name="button.phtml" hash="f60245da1dfc1d6c8d2dd54f501043cb"/></dir></dir></dir></dir></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>PDO</name><min>1.0.0</min><max>10.0.0</max></extension></required></dependencies>
20
  </package>