class Mage_Shell_ExportCategory extends Mage_Shell_Abstract { /** * Run script * */ public function run() { ini_set("memory_limit","1000M"); umask(0); $category = Mage::getModel ('catalog/category'); $tree = $category->getTreeModel(); $tree->load(); $ids = $tree->getCollection()->getAllIds(); $timestamp = time(); $file_path = BP.DS.'media'.DS.'export'.DS.'cate_' . $timestamp . '.csv'; $fp = fopen($file_path, 'w'); if ($ids) { $string=''; $heading = fputcsv($fp,array("store","categories","cat_id","is_active","meta_title","meta_keywords","meta_description","include_in_menu","is_anchor","description")); foreach ($ids as $id) { if($id>0)//start if removeroot category and default category . { $cate_cre = Mage::getModel('catalog/category'); $cate_cre->load($id); $treeurl=''; $cate_cre1=Mage::getModel('catalog/category')->load($id); $treeurl=$cate_cre->getName(); if($cate_cre1->getParentId()>0) { for($i=0; ;$i++) { if($cate_cre1->getParentId()>0) { $abc=Mage::getModel('catalog/category')->load($cate_cre1->getParentId()); $pCat=$abc->getName(); if($abc->getId()>1){ $treeurl=$pCat.'/'.$treeurl; } $cate_cre1=$abc; } else{ break; } } } $store = "default"; $array_cate =array($store,$treeurl,$id,$cate_cre->getIsActive(),$cate_cre->getMetaTitle(),$cate_cre->getMetaKeywords(),$cate_cre->getMetaDescription(),$cate_cre->getIncludeInMenu(),$cate_cre->getIsAnchor(),$cate_cre->getDescription()); var_dump($array_cate); fputcsv($fp,$array_cate); }//endof if removeroot category and default category . } fclose($fp); } } } $shell = new Mage_Shell_ExportCategory(); $shell->run();
相关推荐
46. Show single category view, the next stage 107 47. Checkboxes in a list box 108 48. Formatting a Notes view in HTML table for WEB 109 49. Jump to the end of a view (web agent) 111 50. Disabling ...
46. Show single category view, the next stage 107 47. Checkboxes in a list box 108 48. Formatting a Notes view in HTML table for WEB 109 49. Jump to the end of a view (web agent) 111 50. Disabling ...
46. Show single category view, the next stage 107 47. Checkboxes in a list box 108 48. Formatting a Notes view in HTML table for WEB 109 49. Jump to the end of a view (web agent) 111 50. Disabling ...
46. Show single category view, the next stage 107 47. Checkboxes in a list box 108 48. Formatting a Notes view in HTML table for WEB 109 49. Jump to the end of a view (web agent) 111 50. ...
+ improved XML import/export (unit WPIOXML1.PAS) - some smaller bugs fixed 3.11.2011 - WPTools 6.21.2 - fix problem with TWPToolButton - improved HTML writer to write parameters in "" - improved ...
By supplying a DSN entry, it will attempt to connect to that database and list all the tables in it. When you click on a table, it lists all <END><br>38,3a.zip An Inventory System, you can add, ...
Importing and exporting content with the Import and Export tool 14 Getting ready 14 How to do it 14 Importing content 15 Exporting content 17 How it works 18 This material is copyright and is ...
export "SUNXI_MODE=ota_test" fi make ${PLATFORM}_config make -j16 #make spl #make fes if [ ${PLATFORM} = "sun8iw11p1" ]; then make distclean make ${PLATFORM}_nor_config make -j16 #make ...
13)..Added: "User" and "Session" columns to processes list, processes list is also sorted by session first 14)..Added: Support for showing current user processes only 15)..Added: Expanding environment...