Version Notes
Added paging for product.list API call.
Download this release
Release Info
Developer | FarApp |
Extension | FarApp_Connector |
Version | 1.5.1 |
Comparing to | |
See all releases |
Code changes from version 1.5.0 to 1.5.1
app/code/community/FarApp/Connector/Model/Product/Api.php
CHANGED
@@ -2,11 +2,12 @@
|
|
2 |
|
3 |
class FarApp_Connector_Model_Product_Api extends Mage_Catalog_Model_Product_Api
|
4 |
{
|
5 |
-
public function items($filters = null, $store = null, $detailed = false)
|
6 |
{
|
7 |
$collection = Mage::getModel('catalog/product')->getCollection()
|
8 |
->addStoreFilter($this->_getStoreId($store))
|
9 |
-
->addAttributeToSelect('name')
|
|
|
10 |
|
11 |
/** @var $apiHelper Mage_Api_Helper_Data */
|
12 |
$apiHelper = Mage::helper('api');
|
@@ -22,7 +23,20 @@ class FarApp_Connector_Model_Product_Api extends Mage_Catalog_Model_Product_Api
|
|
22 |
$this->_fault('filters_invalid', $e->getMessage());
|
23 |
}
|
24 |
$result = array();
|
|
|
25 |
foreach ($collection as $product) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
if (!$detailed) {
|
27 |
$result[] = array(
|
28 |
'product_id' => $product->getId(),
|
@@ -35,7 +49,7 @@ class FarApp_Connector_Model_Product_Api extends Mage_Catalog_Model_Product_Api
|
|
35 |
);
|
36 |
}
|
37 |
else {
|
38 |
-
Mage::log('HI1 '.$product->getId());
|
39 |
$productDetails = $this->info($product->getId(), null, null, null, true);
|
40 |
$mediaApi = new Mage_Catalog_Model_Product_Attribute_Media_Api();
|
41 |
$mediaList = $mediaApi->items($product->getId());
|
2 |
|
3 |
class FarApp_Connector_Model_Product_Api extends Mage_Catalog_Model_Product_Api
|
4 |
{
|
5 |
+
public function items($filters = null, $store = null, $detailed = false, $start = null, $limit = null)
|
6 |
{
|
7 |
$collection = Mage::getModel('catalog/product')->getCollection()
|
8 |
->addStoreFilter($this->_getStoreId($store))
|
9 |
+
->addAttributeToSelect('name')
|
10 |
+
->setOrder('updated_at', 'asc');
|
11 |
|
12 |
/** @var $apiHelper Mage_Api_Helper_Data */
|
13 |
$apiHelper = Mage::helper('api');
|
23 |
$this->_fault('filters_invalid', $e->getMessage());
|
24 |
}
|
25 |
$result = array();
|
26 |
+
$productIdx = 0;
|
27 |
foreach ($collection as $product) {
|
28 |
+
if (!is_null($start)) {
|
29 |
+
if ($productIdx < $start) {
|
30 |
+
++$productIdx;
|
31 |
+
continue;
|
32 |
+
}
|
33 |
+
}
|
34 |
+
if (!is_null($limit)) {
|
35 |
+
if (count($result) == $limit) {
|
36 |
+
break;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
++$productIdx;
|
40 |
if (!$detailed) {
|
41 |
$result[] = array(
|
42 |
'product_id' => $product->getId(),
|
49 |
);
|
50 |
}
|
51 |
else {
|
52 |
+
//Mage::log('HI1 '.$product->getId());
|
53 |
$productDetails = $this->info($product->getId(), null, null, null, true);
|
54 |
$mediaApi = new Mage_Catalog_Model_Product_Attribute_Media_Api();
|
55 |
$mediaList = $mediaApi->items($product->getId());
|
app/code/community/FarApp/Connector/etc/config.xml
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
<config>
|
10 |
<modules>
|
11 |
<FarApp_Connector>
|
12 |
-
<version>1.5.
|
13 |
</FarApp_Connector>
|
14 |
</modules>
|
15 |
<global>
|
9 |
<config>
|
10 |
<modules>
|
11 |
<FarApp_Connector>
|
12 |
+
<version>1.5.1</version>
|
13 |
</FarApp_Connector>
|
14 |
</modules>
|
15 |
<global>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>FarApp_Connector</name>
|
4 |
-
<version>1.5.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://www.farapp.com/signup/">Commercial</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Connector to sync product data from FarApp to Magento. FarApp currently supports NetSuite and other backends.</summary>
|
10 |
<description>FarApp is a cloud-based solution for posting product data to storefronts, retrieving orders from storefront and posting fulfillments to storefronts. We support various backends including NetSuite, X-Cart, 3D-Cart, and more. This connector allows full product data posting to Magento from FarApp. It has the the extra benefits of allowing FarApp to dynamically push new product data, automatically creating new attribute options and importing external images (features not provided by Magento).</description>
|
11 |
-
<notes>Added
|
12 |
<authors><author><name>FarApp</name><user>FarApp</user><email>support@farapp.com</email></author></authors>
|
13 |
<date>2016-08-21</date>
|
14 |
-
<time>00:
|
15 |
-
<contents><target name="magecommunity"><dir name="FarApp"><dir name="Connector"><dir name="Helper"><file name="Data.php" hash="60ea63e7acbcdd006c05d3f8528d6b91"/></dir><dir name="Model"><dir name="Export"><dir name="Adapter"><file name="Abstract.php" hash="765dc8fbab996f17b9f049cc8aa906a0"/><file name="Array.php" hash="6ca62c702dcb9512ec429563ac1ce1a2"/></dir><dir name="Entity"><file name="Order.php" hash="14a2f735cf8fc5e8f2bcd6682a1e56b1"/></dir></dir><file name="Export.php" hash="01643ef101731c6d98bbc523642f95a0"/><dir name="Import"><dir name="Entity"><file name="Customer.php" hash="376978f635c73605d428037cca8cf594"/><file name="Order.php" hash="38579396825a1bd3ad59de84278085f6"/><file name="Product.php" hash="61fb4cfe7c47ba3f99dec526cc534ada"/><file name="minVersion2.php" hash="8df670fd68516ba1629304ae8ab6c812"/></dir></dir><file name="Import.php" hash="deb96f4867780788413d96be1c2b9ff9"/><file name="Observer.php" hash="855bf20a8667fc0e70b0ec75fd230a50"/><dir name="Order"><dir name="Creditmemo"><file name="Api.php" hash="edb85d34679eab92e8990a0dd065632e"/></dir><dir name="Invoice"><file name="Api.php" hash="f133255dae51ab9c44c71ca9cc702d0a"/></dir></dir><dir name="Product"><file name="Api.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>5.7.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>FarApp_Connector</name>
|
4 |
+
<version>1.5.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://www.farapp.com/signup/">Commercial</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Connector to sync product data from FarApp to Magento. FarApp currently supports NetSuite and other backends.</summary>
|
10 |
<description>FarApp is a cloud-based solution for posting product data to storefronts, retrieving orders from storefront and posting fulfillments to storefronts. We support various backends including NetSuite, X-Cart, 3D-Cart, and more. This connector allows full product data posting to Magento from FarApp. It has the the extra benefits of allowing FarApp to dynamically push new product data, automatically creating new attribute options and importing external images (features not provided by Magento).</description>
|
11 |
+
<notes>Added paging for product.list API call.</notes>
|
12 |
<authors><author><name>FarApp</name><user>FarApp</user><email>support@farapp.com</email></author></authors>
|
13 |
<date>2016-08-21</date>
|
14 |
+
<time>00:49:30</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="FarApp"><dir name="Connector"><dir name="Helper"><file name="Data.php" hash="60ea63e7acbcdd006c05d3f8528d6b91"/></dir><dir name="Model"><dir name="Export"><dir name="Adapter"><file name="Abstract.php" hash="765dc8fbab996f17b9f049cc8aa906a0"/><file name="Array.php" hash="6ca62c702dcb9512ec429563ac1ce1a2"/></dir><dir name="Entity"><file name="Order.php" hash="14a2f735cf8fc5e8f2bcd6682a1e56b1"/></dir></dir><file name="Export.php" hash="01643ef101731c6d98bbc523642f95a0"/><dir name="Import"><dir name="Entity"><file name="Customer.php" hash="376978f635c73605d428037cca8cf594"/><file name="Order.php" hash="38579396825a1bd3ad59de84278085f6"/><file name="Product.php" hash="61fb4cfe7c47ba3f99dec526cc534ada"/><file name="minVersion2.php" hash="8df670fd68516ba1629304ae8ab6c812"/></dir></dir><file name="Import.php" hash="deb96f4867780788413d96be1c2b9ff9"/><file name="Observer.php" hash="855bf20a8667fc0e70b0ec75fd230a50"/><dir name="Order"><dir name="Creditmemo"><file name="Api.php" hash="edb85d34679eab92e8990a0dd065632e"/></dir><dir name="Invoice"><file name="Api.php" hash="f133255dae51ab9c44c71ca9cc702d0a"/></dir></dir><dir name="Product"><file name="Api.php" hash="60539725273ed3ce03adef8e90198cc3"/></dir></dir><dir name="controllers"><file name="ExportController.php" hash="83a48feea4dc3d601b2cef7df2d27110"/><file name="ImportController.php" hash="7a12bac2eb701f3664c5b542778342cc"/><file name="IndexController.php" hash="93918848d3ce7f6ad05688f89a730e75"/></dir><dir name="etc"><file name="api.xml" hash="6178269d7dc6cb7aa1188f059e75a4fc"/><file name="config.xml" hash="2c90cdaa34e99144ce5157d1d9bbb005"/><file name="system.xml" hash="395c2670f5132a4e617310345185c200"/><file name="wsdl.xml" hash="53aac63b4e1503137d9280b374d51b03"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="FarApp_Connector.xml" hash="ff3fe315c70239229cb5ff3a49d40967"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>5.7.0</max></php></required></dependencies>
|
18 |
</package>
|