我在Adminhtml_Sales_Order_View文件上创建了一个按钮,我希望它指向我的管理员html控制器,但由于未知原因,当我点击按钮时,前端有404页错误。
这是我的/etc/config.xml
<?xml version="1.0"?>
<config>
<modules>
<PixelPlusOne_DragonPay>
<version>1.0.0</version>
</PixelPlusOne_DragonPay>>
</modules>
<global>
<models>
<dragonpay>
<class>PixelPlusOne_DragonPay_Model</class>
</dragonpay>
</models>
<helpers>
<dragonpay>
<class>PixelPlusOne_DragonPay_Helper</class>
</dragonpay>
</helpers>
<blocks>
<dragonpay>
<class>PixelPlusOne_DragonPay_Block</class>
</dragonpay>
</blocks>
</global>
<default>
<payment>
<dragonpay>
<model>dragonpay/standard</model>
<active>1</active>
<order_status>pending</order_status>
<title>Dragon Pay</title>
<payment_action>sale</payment_action>
<allowspecific>0</allowspecific>
<sort_order>1</sort_order>
</dragonpay>
</payment>
</default>
<admin>
<routers>
<adminhtml>
<use>admin</use>
<args>
<modules>
<PixelPlusOne_DragonPay before="Mage_Adminhtml">PixelPlusOne_DragonPay_Adminhtml</PixelPlusOne_DragonPay>
</modules>
</args>
</adminhtml>
</routers>
</admin>
<frontend>
<routers>
<dragonpay>
<use>standard</use>
<args>
<module>PixelPlusOne_DragonPay</module>
</args>
</dragonpay>
</routers>
</frontend>
</config>
这是我添加到Sales_Order_View
的按钮 /* UPDATE INCLUDED BY DRAGONPAY PAYMENT MODULE - START */
/**
* This button is added for DragonPay for QUERY API button for manual checking of payment result
*/
if($order->getPayment()->getMethodInstance()->getCode() == 'dragonpay'){
$message = 'Query the Payment Gateway To Check If Any Payments Made?';
$url = Mage::helper('adminhtml')->getUrl('dragonpay/adminhtml_admindragonpay/query/',array('order_id'=>$order->getId()));
$this->addButton('dragonpayapi_query', array(
'label' => '[--DRAGONPAY:Get payment status--]',
'onclick' => "confirmSetLocation('{$message}', '{$url}')",
));
}
/* UPDATE INCLUDED BY DRAGONPAY PAYMENT MODULE - END *
最后是我的Adminhtml控制器
<?php
class PixelPlusOne_DragonPay_Adminhtml_AdmindragonpayController extends Mage_Adminhtml_Controller_Action
{
public function queryAction(){
echo "hi";
}
}
?>
希望有人能帮助我,我真的很感激帮助。提前谢谢。