我在Magento Admin Customer Edit中成功开发了一个Customer Notes选项卡,所有功能都正常运行。但是,CSR会保存客户注意,选项卡magento将更新表并返回“客户视图”的默认顶部选项卡我希望客户备注部分上的操作保存以返回到客户备注选项卡。 这是我的控制器
<?php class Mycompany_Customernotes_CustomernotesController extends Mage_Adminhtml_Controller_Action
{
public function saveAction()
{
$resource = Mage::getSingleton('core/resource');
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$returnnotes[] = $this->getRequest()->getPost();
foreach ($returnnotes as $returnnote) {
$notes = $returnnote['customer_notes'];
$customer_id = $returnnote['customer_id'];
$user_id = $returnnote['userId'];
$username = $returnnote['username'];
$timestamp = $returnnote['timestamp'];
$write->query("INSERT into Blah Blah Blah
}
$this->_redirectReferer();
}
}
这是Magento EE 1.12
提前感谢任何人。
UPDATE显示config.xml
<admin>
<routers>
<customernotes>
<use>admin</use>
<args>
<module>Mycompany_Customernotes</module>
<frontName>customernotes</frontName>
</args>
</customernotes>
</routers>
</admin>
答案 0 :(得分:1)
尝试
$this->_redirect('*/*/', array('active_tab' => 'list_untranslated'));
答案 1 :(得分:0)
类Mage_Adminhtml_Block_Customer_Edit_Tabs似乎处理在以下函数中设置活动选项卡。
protected function _updateActiveTab()
{
$tabId = $this->getRequest()->getParam('tab');
if( $tabId ) {
$tabId = preg_replace("#{$this->getId()}_#", '', $tabId);
if($tabId) {
$this->setActiveTab($tabId);
}
}
}
在重定向之前尝试设置“tab”参数,看看会发生什么。对于示例id,地址选项卡是“customer_info_tabs_addresses”