Version Notes
Notes in here
Download this release
Release Info
Developer | Volo |
Extension | eSellerProPlugin |
Version | 1.1.2.3 |
Comparing to | |
See all releases |
Code changes from version 1.1.2.2 to 1.1.2.3
app/code/local/Sandbourne/BulkApi/Helper/Category.php
CHANGED
@@ -1,96 +1,96 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Sandbourne_BulkApi_Helper_Category extends Mage_Core_Helper_Abstract
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
//$this->_debug('Category Helper constructed');
|
8 |
-
}
|
9 |
-
|
10 |
-
public function setProductCategories($magentoProduct, $productData)
|
11 |
-
{
|
12 |
-
$categoryTreeModel = Mage::getModel('catalog/category')->getTreeModel();
|
13 |
-
$categoryTreeModel->load();
|
14 |
-
$categoryCache = Mage::helper('bulkapi/categoryCache');
|
15 |
-
$categoryCache->resetCache($categoryTreeModel->getCollection());
|
16 |
-
|
17 |
-
//$rootCategories = $categoryCache->getTopLevelCategories();
|
18 |
-
|
19 |
-
$categoryIds = array();
|
20 |
-
foreach ($productData->ProductCategories->ProductCategory as $productCategory)
|
21 |
-
{
|
22 |
-
//$magentoCategories = $rootCategories;
|
23 |
-
|
24 |
-
//$this->_debug((string)$productCategory);
|
25 |
-
$categoryParts = explode('>', (string)$productCategory);
|
26 |
-
$foundCategory = NULL;
|
27 |
-
$path = '1';
|
28 |
-
$currentParentID = 1;
|
29 |
-
|
30 |
-
$anchorCategory = (trim((String)$productData->GlobalAnchoring));
|
31 |
-
|
32 |
-
foreach($categoryParts as $categoryPart)
|
33 |
-
{
|
34 |
-
$foundCategory = $categoryCache->findCategory($currentParentID, $categoryPart);
|
35 |
-
//$foundCategory = $this->findCategory($magentoCategories, $categoryPart);
|
36 |
-
if (isset($foundCategory))
|
37 |
-
{
|
38 |
-
//$magentoCategories = $foundCategory->getChildrenCategories();
|
39 |
-
|
40 |
-
// Need to load all the EAV's, otherwise some fields like "Include in Navigation Menu", get reset to their defaults.
|
41 |
-
|
42 |
-
|
43 |
-
// Check to see if we are using Category Anchoring
|
44 |
-
$foundCategory->setIsAnchor(0);
|
45 |
-
if ($anchorCategory == 'Y')
|
46 |
-
{
|
47 |
-
$foundCategory->setIsAnchor(1);
|
48 |
-
}
|
49 |
-
$foundCategory->save();
|
50 |
-
}
|
51 |
-
else
|
52 |
-
{
|
53 |
-
$foundCategory = Mage::getModel('catalog/category');
|
54 |
-
$foundCategory->setStoreId(0);
|
55 |
-
$foundCategory->setName($categoryPart);
|
56 |
-
$foundCategory->setPath($path);
|
57 |
-
$foundCategory->setIsActive(1);
|
58 |
-
|
59 |
-
// Check to see if we are using Category Anchoring
|
60 |
-
$foundCategory->setIsAnchor(0);
|
61 |
-
if ($anchorCategory == 'Y')
|
62 |
-
{
|
63 |
-
$foundCategory->setIsAnchor(1);
|
64 |
-
}
|
65 |
-
$foundCategory->save();
|
66 |
-
$categoryCache->addCategory($foundCategory);
|
67 |
-
//$magentoCategories = $foundCategory->getChildrenCategories();
|
68 |
-
}
|
69 |
-
$path = $path.'/'.$foundCategory->getId();
|
70 |
-
$currentParentID = $foundCategory->getId();
|
71 |
-
}
|
72 |
-
if (isset($foundCategory))
|
73 |
-
{
|
74 |
-
//$this->_debug('found:'.$foundCategory->getName());
|
75 |
-
array_push($categoryIds, $foundCategory->getId());
|
76 |
-
}
|
77 |
-
}
|
78 |
-
$magentoProduct->setCategoryIds($categoryIds);
|
79 |
-
}
|
80 |
-
|
81 |
-
private function findCategory($magentoCategories, $categoryName)
|
82 |
-
{
|
83 |
-
foreach($magentoCategories as $magentoCategory)
|
84 |
-
{
|
85 |
-
if (strcmp($magentoCategory->getName(), $categoryName)==0)
|
86 |
-
{
|
87 |
-
return $magentoCategory;
|
88 |
-
}
|
89 |
-
}
|
90 |
-
}
|
91 |
-
|
92 |
-
private function _debug($message)
|
93 |
-
{
|
94 |
-
Mage::log($message);
|
95 |
-
}
|
96 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Sandbourne_BulkApi_Helper_Category extends Mage_Core_Helper_Abstract
|
4 |
+
{
|
5 |
+
public function __construct()
|
6 |
+
{
|
7 |
+
//$this->_debug('Category Helper constructed');
|
8 |
+
}
|
9 |
+
|
10 |
+
public function setProductCategories($magentoProduct, $productData)
|
11 |
+
{
|
12 |
+
$categoryTreeModel = Mage::getModel('catalog/category')->getTreeModel();
|
13 |
+
$categoryTreeModel->load();
|
14 |
+
$categoryCache = Mage::helper('bulkapi/categoryCache');
|
15 |
+
$categoryCache->resetCache($categoryTreeModel->getCollection());
|
16 |
+
|
17 |
+
//$rootCategories = $categoryCache->getTopLevelCategories();
|
18 |
+
|
19 |
+
$categoryIds = array();
|
20 |
+
foreach ($productData->ProductCategories->ProductCategory as $productCategory)
|
21 |
+
{
|
22 |
+
//$magentoCategories = $rootCategories;
|
23 |
+
|
24 |
+
//$this->_debug((string)$productCategory);
|
25 |
+
$categoryParts = explode('>', (string)$productCategory);
|
26 |
+
$foundCategory = NULL;
|
27 |
+
$path = '1';
|
28 |
+
$currentParentID = 1;
|
29 |
+
|
30 |
+
$anchorCategory = (trim((String)$productData->GlobalAnchoring));
|
31 |
+
|
32 |
+
foreach($categoryParts as $categoryPart)
|
33 |
+
{
|
34 |
+
$foundCategory = $categoryCache->findCategory($currentParentID, $categoryPart);
|
35 |
+
//$foundCategory = $this->findCategory($magentoCategories, $categoryPart);
|
36 |
+
if (isset($foundCategory))
|
37 |
+
{
|
38 |
+
//$magentoCategories = $foundCategory->getChildrenCategories();
|
39 |
+
|
40 |
+
// Need to load all the EAV's, otherwise some fields like "Include in Navigation Menu", get reset to their defaults.
|
41 |
+
$foundCategory->load(); // 17/06/2015 - currently causing an error.
|
42 |
+
|
43 |
+
// Check to see if we are using Category Anchoring
|
44 |
+
$foundCategory->setIsAnchor(0);
|
45 |
+
if ($anchorCategory == 'Y')
|
46 |
+
{
|
47 |
+
$foundCategory->setIsAnchor(1);
|
48 |
+
}
|
49 |
+
$foundCategory->save();
|
50 |
+
}
|
51 |
+
else
|
52 |
+
{
|
53 |
+
$foundCategory = Mage::getModel('catalog/category');
|
54 |
+
$foundCategory->setStoreId(0);
|
55 |
+
$foundCategory->setName($categoryPart);
|
56 |
+
$foundCategory->setPath($path);
|
57 |
+
$foundCategory->setIsActive(1);
|
58 |
+
|
59 |
+
// Check to see if we are using Category Anchoring
|
60 |
+
$foundCategory->setIsAnchor(0);
|
61 |
+
if ($anchorCategory == 'Y')
|
62 |
+
{
|
63 |
+
$foundCategory->setIsAnchor(1);
|
64 |
+
}
|
65 |
+
$foundCategory->save();
|
66 |
+
$categoryCache->addCategory($foundCategory);
|
67 |
+
//$magentoCategories = $foundCategory->getChildrenCategories();
|
68 |
+
}
|
69 |
+
$path = $path.'/'.$foundCategory->getId();
|
70 |
+
$currentParentID = $foundCategory->getId();
|
71 |
+
}
|
72 |
+
if (isset($foundCategory))
|
73 |
+
{
|
74 |
+
//$this->_debug('found:'.$foundCategory->getName());
|
75 |
+
array_push($categoryIds, $foundCategory->getId());
|
76 |
+
}
|
77 |
+
}
|
78 |
+
$magentoProduct->setCategoryIds($categoryIds);
|
79 |
+
}
|
80 |
+
|
81 |
+
private function findCategory($magentoCategories, $categoryName)
|
82 |
+
{
|
83 |
+
foreach($magentoCategories as $magentoCategory)
|
84 |
+
{
|
85 |
+
if (strcmp($magentoCategory->getName(), $categoryName)==0)
|
86 |
+
{
|
87 |
+
return $magentoCategory;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
}
|
91 |
+
|
92 |
+
private function _debug($message)
|
93 |
+
{
|
94 |
+
Mage::log($message);
|
95 |
+
}
|
96 |
+
}
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>eSellerProPlugin</name>
|
4 |
-
<version>1.1.2.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Description in here</description>
|
11 |
<notes>Notes in here</notes>
|
12 |
<authors><author><name>Volo</name><user>Volo</user><email>magento@volocommerce.com</email></author></authors>
|
13 |
-
<date>
|
14 |
-
<time>
|
15 |
-
<contents><target name="mage"><dir name="."><dir name="app"><dir name="code"><dir name="local"><dir name="Sandbourne"><dir name="BulkApi"><dir name="Helper"><file name="Array.php" hash="0a04d7af6b6d84fed6d1a0097a558abf"/><file name="Attribute.php" hash="b02d50e3f8a69a90e9d44026febfc4bf"/><file name="AttributeCache.php" hash="258e7fd95a78ff62ff121f4a4776a3a8"/><file name="AttributeOptionCache.php" hash="be30b904d71df0f46f62ed77d6e2fc93"/><file name="Category.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min></min><max></max></package></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>eSellerProPlugin</name>
|
4 |
+
<version>1.1.2.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Description in here</description>
|
11 |
<notes>Notes in here</notes>
|
12 |
<authors><author><name>Volo</name><user>Volo</user><email>magento@volocommerce.com</email></author></authors>
|
13 |
+
<date>2017-02-12</date>
|
14 |
+
<time>17:55:05</time>
|
15 |
+
<contents><target name="mage"><dir name="."><dir name="app"><dir name="code"><dir name="local"><dir name="Sandbourne"><dir name="BulkApi"><dir name="Helper"><file name="Array.php" hash="0a04d7af6b6d84fed6d1a0097a558abf"/><file name="Attribute.php" hash="b02d50e3f8a69a90e9d44026febfc4bf"/><file name="AttributeCache.php" hash="258e7fd95a78ff62ff121f4a4776a3a8"/><file name="AttributeOptionCache.php" hash="be30b904d71df0f46f62ed77d6e2fc93"/><file name="Category.php" hash="98c022113e731c8eda02208aa5611c98"/><file name="CategoryCache.php" hash="9201e35bd5e461e5483ea9b66b1306d0"/><file name="ConfigurableProduct.php" hash="6127acd0c0d96a864ed6294ef5445ebd"/><file name="Data.php" hash="7aa739540136122fdba1fa12c72a9cad"/><file name="Image.php" hash="f349ee75605adb3afdbd1a15eb823f27"/><file name="Prices.php" hash="a1a1772279a05cd7bdfe981439cac7bd"/><file name="RelatedProducts.php" hash="e927612b277080a5c835d0ceebd8598c"/><file name="Utils.php" hash="29beb209f25ab4a462051be7fa6c681b"/><file name="Website.php" hash="0e67b9ba7cd1bbfe8c840991d0aa3079"/></dir><dir name="Model"><dir name="FullImage"><dir name="Api"><file name="V2.php" hash="d998bacd61159399567d1c46e63507a2"/></dir><file name="Api.php" hash="fcff5388032e5cde7485314c6a1d3bf2"/></dir><dir name="FullProduct"><dir name="Api"><file name="V2.php" hash="3cfb906b7c4c72906e3baccb4fdeee40"/></dir><file name="Api.php" hash="3f730da57e4e49e572c07d6ef9db3d98"/></dir><dir name="PartialProduct"><dir name="Api"><file name="V2.php" hash="5e9375e74f6ba74bb79f20cce7574ba7"/></dir><file name="Api.php" hash="7c1e68b4dc0c20b2af212c503c53cea7"/></dir></dir><dir name="etc"><file name="api.xml" hash="ee96f5255bb710f934c2dcef8e35cd89"/><file name="config.xml" hash="5ec4835b59d63ec52206204e81903bb7"/><file name="wsdl.xml" hash="9e291f850362a99b265645a978e45b09"/></dir></dir></dir></dir></dir><dir name="etc"><dir name="modules"><file name="Sandbourne_BulkApi.xml" hash="4418f8514205d4d52a309e83d5050c0d"/></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min></min><max></max></package></required></dependencies>
|
18 |
</package>
|