0

私はMagento 1.4.1.1を使用しています。ID番号を使用してプログラムでカテゴリを複製するにはどうすればよいですか?

4

2 に答える 2

0
$category_to_duplicate = Mage::getModel('catalog/category')->load($cat_id);
$category_new = Mage::getModel('catalog/category');
$category_new->setStoreId(0); // 0 = default/all store view. 
$category_new->addData($category_to_duplicate->getData());
try {
$category->save();
    echo "Success! Id: ".$category_new->getId();
}
catch (Exception $e){
    echo $e->getMessage();
}
于 2013-02-28T13:09:28.383 に答える