shoppingfeeder - Version 1.4.8

Version Notes

Added stock quantity lookup endpoint

Download this release

Release Info

Developer ShoppingFeeder
Extension shoppingfeeder
Version 1.4.8
Comparing to
See all releases


Code changes from version 1.4.7 to 1.4.8

app/code/community/ShoppingFeeder/Service/Model/Offers.php CHANGED
@@ -481,4 +481,14 @@ class ShoppingFeeder_Service_Model_Offers extends Mage_Core_Model_Abstract
481
 
482
  return $products;
483
  }
 
 
 
 
 
 
 
 
 
 
484
  }
481
 
482
  return $products;
483
  }
484
+
485
+ public function getStockQuantity($itemId, $store = null)
486
+ {
487
+ $product = Mage::getModel('catalog/product')->load($itemId);
488
+
489
+ /* @var Mage_CatalogInventory_Model_Stock_Item $stockItem */
490
+ $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product);
491
+
492
+ return $stockItem->getQty();
493
+ }
494
  }
app/code/community/ShoppingFeeder/Service/controllers/StockController.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ //IMPORTANT - "Controller" directory is not autoloaded
4
+ require_once(Mage::getModuleDir('Controller','ShoppingFeeder_Service').DS.'Controller'.DS.'FrontAuth.php');
5
+
6
+ class ShoppingFeeder_Service_StockController extends ShoppingFeeder_Service_Controller_FrontAuth
7
+ {
8
+ public function indexAction()
9
+ {
10
+ set_time_limit(0);
11
+
12
+ $offerId = $this->getRequest()->getParam('offer_id', null);
13
+ $store = $this->getRequest()->getParam('store', null);
14
+
15
+ /** @var ShoppingFeeder_Service_Model_Offers $offersModel */
16
+ $offersModel = Mage::getSingleton('shoppingfeeder_service/offers');
17
+
18
+ $stockQuantity = $offersModel->getStockQuantity($offerId, $store);
19
+
20
+ $responseData = array(
21
+ 'status' => 'success',
22
+ 'data' => array(
23
+ 'stock_quantity' => (int)$stockQuantity
24
+ )
25
+ );
26
+
27
+ header('Content-type: application/json; charset=UTF-8');
28
+ echo json_encode($responseData);
29
+ exit();
30
+ }
31
+ }
app/code/community/ShoppingFeeder/Service/controllers/VersionController.php CHANGED
@@ -5,7 +5,7 @@ require_once(Mage::getModuleDir('Controller','ShoppingFeeder_Service').DS.'Contr
5
 
6
  class ShoppingFeeder_Service_VersionController extends Mage_Core_Controller_Front_Action
7
  {
8
- protected static $_version = '1.4.7';
9
 
10
  public function indexAction()
11
  {
5
 
6
  class ShoppingFeeder_Service_VersionController extends Mage_Core_Controller_Front_Action
7
  {
8
+ protected static $_version = '1.4.8';
9
 
10
  public function indexAction()
11
  {
app/code/community/ShoppingFeeder/Service/etc/config.xml CHANGED
@@ -9,7 +9,7 @@
9
  <config>
10
  <modules>
11
  <ShoppingFeeder_Service>
12
- <version>1.4.7</version>
13
  </ShoppingFeeder_Service>
14
  </modules>
15
  <global>
9
  <config>
10
  <modules>
11
  <ShoppingFeeder_Service>
12
+ <version>1.4.8</version>
13
  </ShoppingFeeder_Service>
14
  </modules>
15
  <global>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>shoppingfeeder</name>
4
- <version>1.4.7</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
@@ -16,11 +16,11 @@ Use ShoppingFeeder to import your Shopify product catalogue, export it to numero
16
  Export to Google, Shopping.com, Nextag, kelkoo, PriceCheck, Shopmania, Fruugo and more!&#xD;
17
  &#xD;
18
  To set up your ShoppingFeeder account and install this extension seamlessly, create an account at: &lt;a href="http://www.shoppingfeeder.com/register"&gt;http://www.shoppingfeeder.com/register&lt;/a&gt;</description>
19
- <notes>Added category URL links for future proofing</notes>
20
  <authors><author><name>ShoppingFeeder</name><user>shoppingfeeder</user><email>support@shoppingfeeder.com</email></author></authors>
21
- <date>2015-11-19</date>
22
- <time>21:32:39</time>
23
- <contents><target name="mageetc"><dir name="modules"><file name="ShoppingFeeder_Service.xml" hash="90b374109c2d1281ddf527f24fa7d914"/></dir></target><target name="magecommunity"><dir name="ShoppingFeeder"><dir name="Fbtrack"><dir name="Block"><dir name="Adminhtml"><file name="Service.php" hash="2c0bb6d0c7f965c9583cfaae4890d053"/></dir><file name="Service.php" hash="56cd6921b7bda27e2ed66b80af1d927f"/><dir name="Tracking"><file name="Fb.php" hash="1926b36b1d6092b7566e2688559fa895"/></dir></dir><dir name="Helper"><file name="Data.php" hash="87df6b00fcfb2008697cf46d6d18cf75"/></dir><dir name="Model"><file name="Observer.php" hash="dc3282bb0795790a95abd781e9394ece"/></dir><dir name="etc"><file name="config.xml" hash="2cbb1a1b1f6f9ecc77bf0eb406941a17"/><file name="system.xml" hash="227c0ffc63ff10b814d42cd9a8f8bad4"/></dir></dir><dir name="Service"><dir name="Block"><dir name="Adminhtml"><file name="Service.php" hash="8feb1712d6aa6a6897be8f80ba5d3f0b"/></dir><file name="Service.php" hash="48874f0e80ce70686b81eb5380e9f498"/><dir name="Tracking"><file name="Fb.php" hash="060687f842c896df73feb233b68b069b"/></dir></dir><dir name="Controller"><file name="FrontAuth.php" hash="28ed32e1bf3250362911a26869f0e6d7"/></dir><dir name="Helper"><file name="Data.php" hash="17589bd08352e497806bef9884972300"/></dir><dir name="Model"><file name="Auth.php" hash="2cff17b0750ff70695b32524627b2aaf"/><file name="Observer.php" hash="eb7443554b58eeeb4687ebc2ee6db5ff"/><file name="Offers.php" hash="bcbb9a00cf3be2c2a4b73b091d1483e5"/><file name="Orders.php" hash="cc3c9f38ae41c11ab7dda0bcb8dd001f"/></dir><dir name="controllers"><file name="AttributesController.php" hash="e937c492f770bc8381a003a080cf878b"/><file name="FeedController.php" hash="92b70af3a048ece99d262480c51aa862"/><file name="OrdersController.php" hash="e0dcf407e15ca212b43ee0015c918675"/><file name="StoresController.php" hash="a29fa0e97299ce764fd66360cbf6632a"/><file name="TestController.php" hash="5138a844cb7cbc8e792df664057bdf9b"/><file name="VersionController.php" hash="36d7e2d396db068e8621164623ec57f8"/></dir><dir name="data"><file name="cacert.pem" hash="380df856e8f789c1af97d0da9a243769"/></dir><dir name="etc"><file name="config.xml" hash="c911bfc4134dce89af76e4ed8ba210c9"/><file name="system.xml" hash="e358d831424ccacdd393dfac49b8a994"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="shoppingfeeder_service.xml" hash="4f3a5b5018c0328da4f9490d4c6042fd"/></dir><dir name="template"><dir name="shoppingfeeder"><file name="fbtrack.phtml" hash="d7b78bc15e750d570f06e06facd721bb"/><file name="fbtrack_standalone.phtml" hash="d7b78bc15e750d570f06e06facd721bb"/></dir></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
26
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>shoppingfeeder</name>
4
+ <version>1.4.8</version>
5
  <stability>stable</stability>
6
  <license>GNU General Public License (GPL)</license>
7
  <channel>community</channel>
16
  Export to Google, Shopping.com, Nextag, kelkoo, PriceCheck, Shopmania, Fruugo and more!&#xD;
17
  &#xD;
18
  To set up your ShoppingFeeder account and install this extension seamlessly, create an account at: &lt;a href="http://www.shoppingfeeder.com/register"&gt;http://www.shoppingfeeder.com/register&lt;/a&gt;</description>
19
+ <notes>Added stock quantity lookup endpoint</notes>
20
  <authors><author><name>ShoppingFeeder</name><user>shoppingfeeder</user><email>support@shoppingfeeder.com</email></author></authors>
21
+ <date>2016-09-14</date>
22
+ <time>15:05:21</time>
23
+ <contents><target name="mageetc"><dir name="modules"><file name="ShoppingFeeder_Service.xml" hash="90b374109c2d1281ddf527f24fa7d914"/></dir></target><target name="magecommunity"><dir name="ShoppingFeeder"><dir name="Fbtrack"><dir name="Block"><dir name="Adminhtml"><file name="Service.php" hash="2c0bb6d0c7f965c9583cfaae4890d053"/></dir><file name="Service.php" hash="56cd6921b7bda27e2ed66b80af1d927f"/><dir name="Tracking"><file name="Fb.php" hash="1926b36b1d6092b7566e2688559fa895"/></dir></dir><dir name="Helper"><file name="Data.php" hash="87df6b00fcfb2008697cf46d6d18cf75"/></dir><dir name="Model"><file name="Observer.php" hash="dc3282bb0795790a95abd781e9394ece"/></dir><dir name="etc"><file name="config.xml" hash="2cbb1a1b1f6f9ecc77bf0eb406941a17"/><file name="system.xml" hash="227c0ffc63ff10b814d42cd9a8f8bad4"/></dir></dir><dir name="Service"><dir name="Block"><dir name="Adminhtml"><file name="Service.php" hash="8feb1712d6aa6a6897be8f80ba5d3f0b"/></dir><file name="Service.php" hash="48874f0e80ce70686b81eb5380e9f498"/><dir name="Tracking"><file name="Fb.php" hash="060687f842c896df73feb233b68b069b"/></dir></dir><dir name="Controller"><file name="FrontAuth.php" hash="28ed32e1bf3250362911a26869f0e6d7"/></dir><dir name="Helper"><file name="Data.php" hash="17589bd08352e497806bef9884972300"/></dir><dir name="Model"><file name="Auth.php" hash="2cff17b0750ff70695b32524627b2aaf"/><file name="Observer.php" hash="eb7443554b58eeeb4687ebc2ee6db5ff"/><file name="Offers.php" hash="d5fd6a4af6d448120c213405e2e35d7c"/><file name="Orders.php" hash="cc3c9f38ae41c11ab7dda0bcb8dd001f"/></dir><dir name="controllers"><file name="AttributesController.php" hash="e937c492f770bc8381a003a080cf878b"/><file name="FeedController.php" hash="92b70af3a048ece99d262480c51aa862"/><file name="OrdersController.php" hash="e0dcf407e15ca212b43ee0015c918675"/><file name="StockController.php" hash="1bd761514eb385776dc41476300f88c4"/><file name="StoresController.php" hash="a29fa0e97299ce764fd66360cbf6632a"/><file name="TestController.php" hash="5138a844cb7cbc8e792df664057bdf9b"/><file name="VersionController.php" hash="523e1ab5a5659b35f96714cbfc602cff"/></dir><dir name="data"><file name="cacert.pem" hash="380df856e8f789c1af97d0da9a243769"/></dir><dir name="etc"><file name="config.xml" hash="5a6df9f263d2d208dcfc3939fcf21a3e"/><file name="system.xml" hash="e358d831424ccacdd393dfac49b8a994"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="shoppingfeeder_service.xml" hash="4f3a5b5018c0328da4f9490d4c6042fd"/></dir><dir name="template"><dir name="shoppingfeeder"><file name="fbtrack.phtml" hash="d7b78bc15e750d570f06e06facd721bb"/><file name="fbtrack_standalone.phtml" hash="d7b78bc15e750d570f06e06facd721bb"/></dir></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
26
  </package>