我想在PHP脚本中在Magento中创建类别。一切正常,但没有为该类别设置页面布局:
$category = Mage::getModel('catalog/category');
// <MyProblem>
$category->setData('page_layout', 'two_columns_left');
// </MyProblem>
$category->setStoreId($storeViewId);
$category->setName($name);
$category->setIsActive('1');
$category->setIncludeInMenu('1');
$category->setDescription($description);
$category->setDisplayMode('PRODUCTS');
$category->setPageLayout('two_columns_left');
$category->setIsAnchor('0');
$category->setParentId($parentId);
$parentCategory = Mage::getModel('catalog/category')->load($parentId);
$category->setPath($parentCategory->getPath());
$category->save();
答案 0 :(得分:0)
您可以通过这种方式设置类别布局
$category->setPageLayout('three_columns');
three_columns
是您的自定义布局,您可以在
- empty
- one_column
- two_columns_left
- two_columns_right
- three_columns