이 링크에 의해 호출되는 함수의 위치는 여기서 "admin / catalog_category / tree / store / 17 / ID / 588 / Store / 17 / ID / 588 /? isajax= true"
-
13-12-2019 - |
문제
멀티 웹 사이트 하위 관리 기능을 수행하고 있습니다. 카테고리 페이지를 관리하고 웹 사이트간에 전환 할 때 AJAX 호출이 동일하게 작동합니다.이 링크
admin/catalog_category/tree/store/17/id/588/?isAjax=true
이 작업을 위해 기능을 작성한 곳을 얻고 싶습니다.
해결책
이 함수는
로 작성되었습니다. app\code\core\Mage\Adminhtml\controllers\Catalog\CategoryController.php
in
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()
))));
}
. 제휴하지 않습니다 magento.stackexchange