0
我想在PHP腳本中創建Magento中的類別。一切工作正常,但該類別不設置頁面佈局:無法以編程方式爲Magento 1.7.0.2中的類別設置「頁面佈局」
$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();
你有試過我的解決方案嗎?它爲我工作,所以我敢肯定它會爲你工作 –
對不起,這是我的錯。它已經工作。我沒有在後端選擇正確的storeview來查看結果:-( – user3305080