Module ECommerce NG (Magento): Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
Line 134: Line 134:
= Development =
= Development =
{{TemplateModTeclibEn}}
{{TemplateModTeclibEn}}
= TroubleShooting =
Due to a problem in Magento, if you have a large number of product categories, you may experience low performance when counting data to synchronize and making a synchronize.
This is how you can fix this:
On magento side, edit the file '''app/code/core/Mage/Catalog/Model/Category/Api.php''' to add the line visible into comment
<source lang="php">
    ...
    /**
    * Convert node to array
    *
    * @param Varien_Data_Tree_Node $node
    * @return array
    */
    protected function _nodeToArray(Varien_Data_Tree_Node $node)
    {
        // Only basic category data
        $result = array();
        $result['category_id'] = $node->getId();
        $result['parent_id']  = $node->getParentId();
        $result['name']        = $node->getName();
        $result['is_active']  = $node->getIsActive();
        $result['position']    = $node->getPosition();
        $result['level']      = $node->getLevel();
/* LDR Add missing property */
$result['updated_at']  = $node->getUpdatedAt();
      $result['children']    = array();
        foreach ($node->getChildren() as $child) {
            $result['children'][] = $this->_nodeToArray($child);
        }
        return $result;
    }
    ...
</lang>

Navigation menu