Dov'è la posizione della funzione che viene chiamata da questo link "admin / catalog_category / tree / store / 17 / ID / 588 /? Isajax= true"
-
13-12-2019 - |
Domanda
Sto lavorando su Multi Sito Web Sub Admin funzionalità. Quando vado a gestire la pagina delle categorie e passare tra i siti Web Una chiamata AJAX funziona per lo stesso. Che è chiamata lime questo collegamento
admin/catalog_category/tree/store/17/id/588/?isAjax=true
Voglio ottenere dove viene scritta la funzione per questo.
Soluzione
Questa funzione è scritta in
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()
))));
}
. Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange