该链接调用的函数的位置在哪里“admin / catalog_category / tree / store / 17/17 / id / 588 /?isajax= true”
-
13-12-2019 - |
题
我正在使用多网站suber admin功能。当我转到管理类别页面并在网站之间切换时,ajax调用是相同的。这是呼叫石灰此链接
admin/catalog_category/tree/store/17/id/588/?isAjax=true
我想得到为此编写函数的位置。
解决方案
此函数以
编写 app\code\core\Mage\Adminhtml\controllers\Catalog\CategoryController.php
在
中public function treeAction()
{
$storeId = (int) $this->getRequest()->getParam('store');
$categoryId = (int) $this->getRequest()->getParam('id');
if ($storeId) {
if (!$categoryId) {
$store = Mage::app()->getStore($storeId);
$rootId = $store->getRootCategoryId();
$this->getRequest()->setParam('id', $rootId);
}
}
$category = $this->_initCategory(true);
$block = $this->getLayout()->createBlock('adminhtml/catalog_category_tree');
$root = $block->getRoot();
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode(array(
'data' => $block->getTree(),
'parameters' => array(
'text' => $block->buildNodeName($root),
'draggable' => false,
'allowDrop' => ($root->getIsVisible()) ? true : false,
'id' => (int) $root->getId(),
'expanded' => (int) $block->getIsWasExpanded(),
'store_id' => (int) $block->getStore()->getId(),
'category_id' => (int) $category->getId(),
'root_visible'=> (int) $root->getIsVisible()
))));
}
.