CSV を使用して製品をインポートしようとすると、コンソールに次のエラーが表示されます。magento コアのインポート機能を使用しています。
<b>Fatal error</b>: Call to a member function getName() on a non-object in <b>/home/magentosite/public_html/store/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php</b> on line <b>377</b><br />
377行目のproduct.phpファイルの関数は、コアファイルを変更していません
/**
* Initialize categories text-path to ID hash.
*
* @return Mage_ImportExport_Model_Import_Entity_Product
*/
protected function _initCategories()
{
$collection = Mage::getResourceModel('catalog/category_collection')->addNameToResult();
/* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection */
foreach ($collection as $category) {
$structure = explode('/', $category->getPath());
$pathSize = count($structure);
if ($pathSize > 2) {
$path = array();
for ($i = 2; $i < $pathSize; $i++) {
$path[] = $collection->getItemById($structure[$i])->getName(); ---> **This is line no 377**
}
$this->_categories[implode('/', $path)] = $category->getId();
}
}
return $this;
}
誰でもこれの解決策を知っていますか?私はmagento 1.6.2を使用しています
:(