Facebookstore2 - Version 2.0.3

Version Notes

FacebookStore version 2.0.3

Download this release

Release Info

Developer Ali Halabyah
Extension Facebookstore2
Version 2.0.3
Comparing to
See all releases


Code changes from version 2.0.2 to 2.0.3

app/code/local/Shopgo/FacebookStore/Model/Product/Api.php CHANGED
@@ -60,8 +60,10 @@ class Shopgo_FacebookStore_Model_Product_Api extends Mage_Catalog_Model_Product_
60
  false
61
  );
62
 
63
- $final_price = Mage::helper('core')->currency($product->getFinalPrice(),true,false);
64
-
 
 
65
  $result[] = array(
66
  'product_id' => $product->getId(),
67
  'sku' => $product->getSku(),
@@ -82,7 +84,8 @@ class Shopgo_FacebookStore_Model_Product_Api extends Mage_Catalog_Model_Product_
82
  'type' => $product->getTypeId(),
83
  'category_ids' => $product->getCategoryIds(),
84
  'website_ids' => $product->getWebsiteIds(),
85
- 'cart_url' => Mage::getUrl('checkout/cart/add', array('product' => $product->getId()))
 
86
  );
87
  }
88
  return $result;
60
  false
61
  );
62
 
63
+ $final_price = Mage::helper('core')->currency($product->getFinalPrice(), true, false);
64
+ // $qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
65
+ $inStock = $product->getStockItem()->getIsInStock();
66
+
67
  $result[] = array(
68
  'product_id' => $product->getId(),
69
  'sku' => $product->getSku(),
84
  'type' => $product->getTypeId(),
85
  'category_ids' => $product->getCategoryIds(),
86
  'website_ids' => $product->getWebsiteIds(),
87
+ 'cart_url' => Mage::getUrl('checkout/cart/add', array('product' => $product->getId())),
88
+ 'in_stock' => $inStock
89
  );
90
  }
91
  return $result;
app/code/local/Shopgo/FacebookStore/Model/Store/Api.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @category Shopgo
4
+ * @package Shopgo_FacebookStore
5
+ * @author ali@shopgo.me
6
+ * @see Mage_Core_Model_Store_Api::info
7
+ */
8
+ class Shopgo_FacebookStore_Model_Store_Api extends Mage_Core_Model_Store_Api
9
+ {
10
+
11
+ // function Shopgo_FacebookStore_Model_Store_Api() {
12
+ // parent::__construct();
13
+ // }
14
+
15
+ /**
16
+ * Retrieve stores list
17
+ *
18
+ * @return array
19
+ */
20
+ public function items()
21
+ {
22
+ // Retrieve stores
23
+ $stores = Mage::app()->getStores();
24
+
25
+ // Make result array
26
+ $result = array();
27
+ foreach ($stores as $store) {
28
+ $store = Mage::getModel('core/store')->load($store->getId());
29
+ $result[] = array(
30
+ 'store_id' => $store->getId(),
31
+ 'code' => $store->getCode(),
32
+ 'website_id' => $store->getWebsiteId(),
33
+ 'group_id' => $store->getGroupId(),
34
+ 'name' => $store->getName(),
35
+ 'sort_order' => $store->getSortOrder(),
36
+ 'is_active' => $store->getIsActive(),
37
+ 'locale' => Mage::getStoreConfig('general/locale/code', $store->getId())
38
+ );
39
+ }
40
+
41
+ return $result;
42
+ }
43
+
44
+
45
+ /**
46
+ * Retrieve store data
47
+ *
48
+ * @param string|int $storeId
49
+ * @return array
50
+ */
51
+ public function info($storeId)
52
+ {
53
+ // Retrieve store info
54
+ try {
55
+ $store = Mage::app()->getStore($storeId);
56
+ } catch (Mage_Core_Model_Store_Exception $e) {
57
+ $this->_fault('store_not_exists');
58
+ }
59
+
60
+ if (!$store->getId()) {
61
+ $this->_fault('store_not_exists');
62
+ }
63
+
64
+ // Basic store data
65
+ $result = array();
66
+ $result['store_id'] = $store->getId();
67
+ $result['code'] = $store->getCode();
68
+ $result['website_id'] = $store->getWebsiteId();
69
+ $result['group_id'] = $store->getGroupId();
70
+ $result['name'] = $store->getName();
71
+ $result['sort_order'] = $store->getSortOrder();
72
+ $result['is_active'] = $store->getIsActive();
73
+ $result['locale'] = Mage::getStoreConfig('general/locale/code', $store->getId());
74
+
75
+ return $result;
76
+ }
77
+ }
app/code/local/Shopgo/FacebookStore/etc/config.xml CHANGED
@@ -9,20 +9,25 @@
9
  <config>
10
  <modules>
11
  <Shopgo_FacebookStore>
12
- <version>2.0.2</version>
13
  </Shopgo_FacebookStore>
14
  </modules>
15
  <global>
16
  <models>
17
- <facebookstore>
18
- <class>Shopgo_FacebookStore_Model</class>
19
- </facebookstore>
20
- <catalog>
21
- <rewrite>
22
- <product_api>Shopgo_FacebookStore_Model_Product_Api</product_api>
23
- <category_api>Shopgo_FacebookStore_Model_Category_Api</category_api>
24
- </rewrite>
25
- </catalog>
 
 
 
 
 
26
  </models>
27
  <blocks>
28
  <facebookstore>
@@ -42,28 +47,28 @@
42
  </facebookstore_setup>
43
  </resources>
44
  </global>
45
- <frontend>
46
- <routers>
47
- <facebookstore>
48
- <use>standard</use>
49
- <args>
50
- <module>Shopgo_FacebookStore</module>
51
- <frontName>facebookstore</frontName>
52
- </args>
53
- </facebookstore>
54
- </routers>
55
- <layout>
56
- <updates>
 
 
 
 
 
 
 
57
  <facebookstore>
58
- <file>shopgo/facebookstore.xml</file>
 
59
  </facebookstore>
60
- </updates>
61
- </layout>
62
- </frontend>
63
- <default>
64
- <facebookstore>
65
- <general>
66
- </general>
67
- </facebookstore>
68
- </default>
69
  </config>
9
  <config>
10
  <modules>
11
  <Shopgo_FacebookStore>
12
+ <version>2.0.3</version>
13
  </Shopgo_FacebookStore>
14
  </modules>
15
  <global>
16
  <models>
17
+ <facebookstore>
18
+ <class>Shopgo_FacebookStore_Model</class>
19
+ </facebookstore>
20
+ <catalog>
21
+ <rewrite>
22
+ <product_api>Shopgo_FacebookStore_Model_Product_Api</product_api>
23
+ <category_api>Shopgo_FacebookStore_Model_Category_Api</category_api>
24
+ </rewrite>
25
+ </catalog>
26
+ <core>
27
+ <rewrite>
28
+ <store_api>Shopgo_FacebookStore_Model_Store_Api</store_api>
29
+ </rewrite>
30
+ </core>
31
  </models>
32
  <blocks>
33
  <facebookstore>
47
  </facebookstore_setup>
48
  </resources>
49
  </global>
50
+ <frontend>
51
+ <routers>
52
+ <facebookstore>
53
+ <use>standard</use>
54
+ <args>
55
+ <module>Shopgo_FacebookStore</module>
56
+ <frontName>facebookstore</frontName>
57
+ </args>
58
+ </facebookstore>
59
+ </routers>
60
+ <layout>
61
+ <updates>
62
+ <facebookstore>
63
+ <file>shopgo/facebookstore.xml</file>
64
+ </facebookstore>
65
+ </updates>
66
+ </layout>
67
+ </frontend>
68
+ <default>
69
  <facebookstore>
70
+ <general>
71
+ </general>
72
  </facebookstore>
73
+ </default>
 
 
 
 
 
 
 
 
74
  </config>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Facebookstore2</name>
4
- <version>2.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>ShopGo FacebookStore2</summary>
10
  <description>ShopGo Facebook store Magento module to sync catalog data with the application.</description>
11
- <notes>FacebookStore version 2.0.2</notes>
12
  <authors><author><name>Ali Halabyah</name><user>alihalabyah</user><email>ali@shopgo.me</email></author><author><name>ShopGo</name><user>shopgo</user><email>support@shopgo.me</email></author></authors>
13
- <date>2015-01-16</date>
14
- <time>19:36:32</time>
15
- <contents><target name="magelocal"><dir name="Shopgo"><dir name="FacebookStore"><dir name="Block"><dir name="Adminhtml"><file name="Version.php" hash="5d45a46004b7b89a51daa405b06e1f6d"/></dir></dir><dir name="Helper"><file name="Data.php" hash="7af4fe501d57fe60c1ada3fa56b50ff6"/></dir><dir name="Model"><dir name="Category"><file name="Api.php" hash="b8ce09cad9cded03dc01a996c6448c7c"/></dir><dir name="Product"><file name="Api.php" hash="0e6c3dfba4ae300fa1b20c7d231bc615"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="fb3ab939afb40fda6cc825a6409f4eb4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="91ef226efdbaa62a01b7f7f89c88ff85"/><file name="config.xml" hash="a35adb0aa15afd7b7db45c44a4071bd0"/><file name="system.xml" hash="4df51c5bcbcc090955680b2ab9204e47"/></dir><dir name="sql"><dir name="facebookstore_setup"><file name="mysql4-install-2.0.1.php" hash="e0286f6318cdc76b1383e465166bd43e"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopgo_FacebookStore.xml" hash="748a6208e76ed323e9fa8981cdcac38d"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Facebookstore2</name>
4
+ <version>2.0.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/MIT">MIT</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>ShopGo FacebookStore2</summary>
10
  <description>ShopGo Facebook store Magento module to sync catalog data with the application.</description>
11
+ <notes>FacebookStore version 2.0.3</notes>
12
  <authors><author><name>Ali Halabyah</name><user>alihalabyah</user><email>ali@shopgo.me</email></author><author><name>ShopGo</name><user>shopgo</user><email>support@shopgo.me</email></author></authors>
13
+ <date>2015-02-04</date>
14
+ <time>11:35:18</time>
15
+ <contents><target name="magelocal"><dir name="Shopgo"><dir name="FacebookStore"><dir name="Block"><dir name="Adminhtml"><file name="Version.php" hash="5d45a46004b7b89a51daa405b06e1f6d"/></dir></dir><dir name="Helper"><file name="Data.php" hash="7af4fe501d57fe60c1ada3fa56b50ff6"/></dir><dir name="Model"><dir name="Category"><file name="Api.php" hash="b8ce09cad9cded03dc01a996c6448c7c"/></dir><dir name="Product"><file name="Api.php" hash="0c280eaaa5923579703869fcdacc3b1f"/></dir><dir name="Store"><file name="Api.php" hash="0a40191fb668bbd40a2bd819bf52c2b9"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="fb3ab939afb40fda6cc825a6409f4eb4"/></dir><dir name="etc"><file name="adminhtml.xml" hash="91ef226efdbaa62a01b7f7f89c88ff85"/><file name="config.xml" hash="1df182f606bec23a74ae840ab46d0d88"/><file name="system.xml" hash="4df51c5bcbcc090955680b2ab9204e47"/></dir><dir name="sql"><dir name="facebookstore_setup"><file name="mysql4-install-2.0.1.php" hash="e0286f6318cdc76b1383e465166bd43e"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Shopgo_FacebookStore.xml" hash="748a6208e76ed323e9fa8981cdcac38d"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>