【发布时间】:2013-11-27 21:59:24
【问题描述】:
我有一个自定义模块,它将根据有限的条件生成优惠券代码。现在优惠券代码完美保存在 salesrule 中,现在如果我点击模块页面中的编辑,应该重定向到默认的销售优惠券编辑页面。
示例:
我目前的网址:http://localhost/magento2/index.php/customcoupons/adminhtml_customcoupons/edit/id/44/key/af601cf21208c082e697be71620f2e88/
我想重定向到-> http://localhost/magento2/index.php/admin/promo_quote/edit/id/44/key/af601cf21208c082e697be71620f2e88/
我已经尝试在 Grid.php 中更改 getRowUrl() 如下所示
public function getRowUrl($row)
{
return $this->getUrl('admin/promo_code/edit', array('id' => $row->getId()));
}
但在这种情况下,它将 url 显示为 http://localhost/magento2/index.php//promo_quote/edit/id/44/key/2afbac6ee9b3321206fa18a9fc1f949c/ 即,它忽略管理员。
它还会重定向回仪表板页面。
有没有办法重定向到自定义控制器?
【问题讨论】: