Version Notes
DataFeedWatch Release version 0.2.5
Download this release
Release Info
| Developer | DataFeedWatch |
| Extension | DataFeedWatch_Connector |
| Version | 0.2.6 |
| Comparing to | |
| See all releases | |
Code changes from version 0.2.5 to 0.2.6
app/code/local/DataFeedWatch/Connector/Model/Datafeedwatch/Api.php
CHANGED
|
@@ -17,7 +17,7 @@ class DataFeedWatch_Connector_Model_Datafeedwatch_Api extends Mage_Catalog_Model
|
|
| 17 |
}
|
| 18 |
|
| 19 |
public function version() {
|
| 20 |
-
return "0.2.
|
| 21 |
}
|
| 22 |
|
| 23 |
public function product_count($options = array()) {
|
|
@@ -91,11 +91,7 @@ class DataFeedWatch_Connector_Model_Datafeedwatch_Api extends Mage_Catalog_Model
|
|
| 91 |
$price_keys = array('price', 'special_price');
|
| 92 |
|
| 93 |
foreach ($collection as $product) {
|
| 94 |
-
|
| 95 |
-
'product_id' => $product->getId(),
|
| 96 |
-
'sku' => $product->getSku()
|
| 97 |
-
);
|
| 98 |
-
|
| 99 |
$parent_id = '0';
|
| 100 |
$configrable = false;
|
| 101 |
|
|
@@ -108,9 +104,19 @@ class DataFeedWatch_Connector_Model_Datafeedwatch_Api extends Mage_Catalog_Model
|
|
| 108 |
}
|
| 109 |
}
|
| 110 |
if (isset($parentIds[0])) {
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
}
|
| 113 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
$product_result['parent_id'] = $parent_id;
|
| 116 |
|
|
@@ -165,15 +171,11 @@ class DataFeedWatch_Connector_Model_Datafeedwatch_Api extends Mage_Catalog_Model
|
|
| 165 |
}
|
| 166 |
}
|
| 167 |
|
| 168 |
-
|
| 169 |
$inventoryStatus = Mage::getModel(self::STOCK_ITEM_MODEL)->loadByProduct($product);
|
| 170 |
if (!empty($inventoryStatus)) {
|
| 171 |
$product_result['quantity'] = (int) $inventoryStatus->getQty();
|
| 172 |
$product_result['is_in_stock'] = $inventoryStatus->getIsInStock() == '1' ? 1 : 0;
|
| 173 |
}
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
$result[] = $product_result;
|
| 178 |
}
|
| 179 |
return $result;
|
|
@@ -322,9 +324,17 @@ class DataFeedWatch_Connector_Model_Datafeedwatch_Api extends Mage_Catalog_Model
|
|
| 322 |
if (empty($imageUrl) || $imageUrl == '' || !isset($imageUrl) || $countImgArr < 2) {
|
| 323 |
$imageUrl = (string) Mage::helper('catalog/image')->init($product, 'image');
|
| 324 |
}
|
| 325 |
-
|
| 326 |
$prices['image_url'] = $imageUrl;
|
| 327 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 328 |
$specialTmpPrice = $product->getSpecialPrice();
|
| 329 |
|
| 330 |
if ($specialTmpPrice && (strtotime(date('Y-m-d H:i:s')) < strtotime($product['special_to_date'])
|
|
@@ -368,9 +378,9 @@ class DataFeedWatch_Connector_Model_Datafeedwatch_Api extends Mage_Catalog_Model
|
|
| 368 |
// categories
|
| 369 |
$category_id = $product->getCategoryIds();
|
| 370 |
if (empty($category_id)) {
|
| 371 |
-
$prices['category_name']
|
| 372 |
$prices['category_parent_name'] = '';
|
| 373 |
-
$prices['category_path']
|
| 374 |
} else {
|
| 375 |
rsort($category_id);
|
| 376 |
$this->productCategories = array();
|
|
@@ -397,5 +407,5 @@ class DataFeedWatch_Connector_Model_Datafeedwatch_Api extends Mage_Catalog_Model
|
|
| 397 |
|
| 398 |
return $prices;
|
| 399 |
}
|
| 400 |
-
|
| 401 |
}
|
| 17 |
}
|
| 18 |
|
| 19 |
public function version() {
|
| 20 |
+
return "0.2.6"; // this needs to be updated in etc/config.xml as well
|
| 21 |
}
|
| 22 |
|
| 23 |
public function product_count($options = array()) {
|
| 91 |
$price_keys = array('price', 'special_price');
|
| 92 |
|
| 93 |
foreach ($collection as $product) {
|
| 94 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
$parent_id = '0';
|
| 96 |
$configrable = false;
|
| 97 |
|
| 104 |
}
|
| 105 |
}
|
| 106 |
if (isset($parentIds[0])) {
|
| 107 |
+
//$parent_id = Mage::getModel('catalog/product')->load($parentIds[0])->getId();
|
| 108 |
+
$parent_product = Mage::getModel('catalog/product')->load($parentIds[0]);
|
| 109 |
+
if($parent_product->getStatus() == 2 && $product->getVisibility() == 1) {
|
| 110 |
+
continue;
|
| 111 |
+
}
|
| 112 |
+
$parent_id = $parent_product->getId();
|
| 113 |
}
|
| 114 |
}
|
| 115 |
+
|
| 116 |
+
$product_result = array(// Basic product data
|
| 117 |
+
'product_id' => $product->getId(),
|
| 118 |
+
'sku' => $product->getSku()
|
| 119 |
+
);
|
| 120 |
|
| 121 |
$product_result['parent_id'] = $parent_id;
|
| 122 |
|
| 171 |
}
|
| 172 |
}
|
| 173 |
|
|
|
|
| 174 |
$inventoryStatus = Mage::getModel(self::STOCK_ITEM_MODEL)->loadByProduct($product);
|
| 175 |
if (!empty($inventoryStatus)) {
|
| 176 |
$product_result['quantity'] = (int) $inventoryStatus->getQty();
|
| 177 |
$product_result['is_in_stock'] = $inventoryStatus->getIsInStock() == '1' ? 1 : 0;
|
| 178 |
}
|
|
|
|
|
|
|
|
|
|
| 179 |
$result[] = $product_result;
|
| 180 |
}
|
| 181 |
return $result;
|
| 324 |
if (empty($imageUrl) || $imageUrl == '' || !isset($imageUrl) || $countImgArr < 2) {
|
| 325 |
$imageUrl = (string) Mage::helper('catalog/image')->init($product, 'image');
|
| 326 |
}
|
|
|
|
| 327 |
$prices['image_url'] = $imageUrl;
|
| 328 |
+
|
| 329 |
+
$additional_images = $product->getMediaGalleryImages();
|
| 330 |
+
if (count($additional_images) > 0) {
|
| 331 |
+
$i = 1;
|
| 332 |
+
foreach ($additional_images as $images) {
|
| 333 |
+
if($images->getUrl() != $prices['image_url'])
|
| 334 |
+
$prices['additional_image_url'.$i++] = $images->getUrl();
|
| 335 |
+
}
|
| 336 |
+
}
|
| 337 |
+
|
| 338 |
$specialTmpPrice = $product->getSpecialPrice();
|
| 339 |
|
| 340 |
if ($specialTmpPrice && (strtotime(date('Y-m-d H:i:s')) < strtotime($product['special_to_date'])
|
| 378 |
// categories
|
| 379 |
$category_id = $product->getCategoryIds();
|
| 380 |
if (empty($category_id)) {
|
| 381 |
+
$prices['category_name'] = '';
|
| 382 |
$prices['category_parent_name'] = '';
|
| 383 |
+
$prices['category_path'] = '';
|
| 384 |
} else {
|
| 385 |
rsort($category_id);
|
| 386 |
$this->productCategories = array();
|
| 407 |
|
| 408 |
return $prices;
|
| 409 |
}
|
| 410 |
+
|
| 411 |
}
|
app/code/local/DataFeedWatch/Connector/etc/config.xml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<DataFeedWatch_Connector>
|
| 5 |
-
<version>0.2.
|
| 6 |
</DataFeedWatch_Connector>
|
| 7 |
</modules>
|
| 8 |
|
|
@@ -49,7 +49,7 @@
|
|
| 49 |
<children>
|
| 50 |
<connectorbackend translate="title" module="connector">
|
| 51 |
<title>DataFeedWatch</title>
|
| 52 |
-
</connectorbackend>
|
| 53 |
</children>
|
| 54 |
</catalog>
|
| 55 |
</admin>
|
| 2 |
<config>
|
| 3 |
<modules>
|
| 4 |
<DataFeedWatch_Connector>
|
| 5 |
+
<version>0.2.6</version>
|
| 6 |
</DataFeedWatch_Connector>
|
| 7 |
</modules>
|
| 8 |
|
| 49 |
<children>
|
| 50 |
<connectorbackend translate="title" module="connector">
|
| 51 |
<title>DataFeedWatch</title>
|
| 52 |
+
</connectorbackend>
|
| 53 |
</children>
|
| 54 |
</catalog>
|
| 55 |
</admin>
|
package.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>DataFeedWatch_Connector</name>
|
| 4 |
-
<version>0.2.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
| 7 |
<channel>community</channel>
|
|
@@ -11,9 +11,9 @@
|
|
| 11 |
feed for Google Shopping and other channels</description>
|
| 12 |
<notes>DataFeedWatch Release version 0.2.5</notes>
|
| 13 |
<authors><author><name>DataFeedWatch</name><user>Adeel</user><email>adeel.developer@gmail.com</email></author></authors>
|
| 14 |
-
<date>2013-12-
|
| 15 |
-
<time>
|
| 16 |
-
<contents><target name="magelocal"><dir name="DataFeedWatch"><dir name="Connector"><dir name="Block"><dir name="Adminhtml"><file name="Connectorbackend.php" hash="afe5bd4888768229d5b668f466b770b5"/></dir></dir><dir name="Helper"><file name="Data.php" hash="983d7ad023616b365dce180680e4f9f0"/></dir><dir name="Model"><dir name="Datafeedwatch"><file name="Api.php" hash="
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 19 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>DataFeedWatch_Connector</name>
|
| 4 |
+
<version>0.2.6</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
|
| 7 |
<channel>community</channel>
|
| 11 |
feed for Google Shopping and other channels</description>
|
| 12 |
<notes>DataFeedWatch Release version 0.2.5</notes>
|
| 13 |
<authors><author><name>DataFeedWatch</name><user>Adeel</user><email>adeel.developer@gmail.com</email></author></authors>
|
| 14 |
+
<date>2013-12-22</date>
|
| 15 |
+
<time>18:29:16</time>
|
| 16 |
+
<contents><target name="magelocal"><dir name="DataFeedWatch"><dir name="Connector"><dir name="Block"><dir name="Adminhtml"><file name="Connectorbackend.php" hash="afe5bd4888768229d5b668f466b770b5"/></dir></dir><dir name="Helper"><file name="Data.php" hash="983d7ad023616b365dce180680e4f9f0"/></dir><dir name="Model"><dir name="Datafeedwatch"><file name="Api.php" hash="58c839f37da441ced5a49c87f7c42d8e"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ConnectorbackendController.php" hash="dfa561302ef7eebe656b229fe275a2eb"/></dir><file name="TestController.php" hash="c90345d01f53e2a6c84eb29083c4263c"/></dir><dir name="etc"><file name="api.xml" hash="84e8b97ba0dc25154ff62126640de989"/><file name="config.xml" hash="c4ceb8eef23ebf6aea1012a0c9267c5e"/><file name="system.xml" hash="ab5e8d56d032ba69c930ab7879484212"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="connector.xml" hash="14d59b8e9f66fba5d7c1f8d0f62dfc3c"/></dir><dir name="template"><dir name="connector"><file name="connectorbackend.phtml" hash="87fbcd16a96af52ce352bc45d9aeab4a"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="DataFeedWatch_Connector.xml" hash="d4ef6cebcefd37d5f0546eca344941eb"/></dir></target></contents>
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
| 19 |
</package>
|
