How to add a category to Magento via Setup script?

前端 未结 5 1266
长发绾君心
长发绾君心 2021-01-13 05:42

I actually can add a category via setup script, the thing is for some reason some of the fields doesn\'t get set properly. Here\'s is my code

$this->start         


        
5条回答
  •  甜味超标
    2021-01-13 06:15

    Try this

    login($magento_webservices_username,  $magento_webservices_passwd);
    
    $data = array('name'=>'Nokia',
                'description'=>'',
                'meta_description'=>'',
                'meta_keywords'=>'',
                'default_sort_by'=>'price',
                'available_sort_by'=>'price',
                'is_active'=>1
    );
    $newCategoryId = $proxy->call($sessionId, 'category.create', array(3, $data, 1));
    echo "Category ID: ".$newCategoryId;
    
    ?>
    

    And also have a look Magento create category

提交回复
热议问题