안녕하세요 저는 magento를 배우기 시작했습니다. 이제 스크립트를 통해 magento로 카테고리를 가져 오려고했습니다. 이 코드는 오류 및이 라인없이 실행 스크립트를 통해 magento로 카테고리 가져 오기
<?php
require_once 'businessclasses.php';
define('MAGENTO', realpath(dirname(__FILE__)));
require_once MAGENTO . '/app/Mage.php';
umask(0);
$count = 0;
echo "<pre>";
$data= new getCSV();
$rows=$data->getRootCategories(); // Gets the list of root categories.
foreach($rows as $row) {
echo $categoryName = $row['d']; // Name of Category
// Create category object
$category = Mage::getModel('catalog/category');
$category->setStoreId(1); // 'US-Store' store is assigned to this category
$rootCategory['name'] = $categoryName;
$rootCategory['path'] = "23/25"; // this is the catgeory path
$rootCategory['display_mode'] = "PRODUCTS";
$rootCategory['is_active'] = 1;
$category->addData($rootCategory);
try {
$category->save();
echo $rootCategoryId = $category->getId();
}
catch (Exception $e){
echo $e->getMessage();
}
}
?>
처럼
내 젠토 코드 보인다
echo $rootCategoryId = $category->getId();
각 카테고리 (루프) 만에
인쇄 고유 ID를 내가 관리자 판넬에서 볼 때 그것은 나에게 아무것도 보여주지 않는다. 가져온 카테고리가 없습니다.
나는 Question.을 언급했지만 도움이되지 않습니다.
어떤 도움을 주시면 감사하겠습니다. 고맙습니다.