请告诉我如何在支付成功屏幕上查找支付成功或失败信息。请把代码片段发给我。
他们上面的请求是在完成付款后,我们需要在不更改管理界面中订单状态的情况下向客户提供可下载的链接。
提前感谢
p.Karthikeyan
创建结构和文件:
app/etc/modules/Myproyect_Mymodule.xml
app/code/local/Myproyect/Mymodule
app/code/local/Myproyect/Mymodule/etc/config.xml
app/code/local/Myproyect/Mymodule/Model/Mymodel.php
创建xml文件以设置模块:app/etc/modules/Myproject_Mymodule.xml
<?xml version="1.0"?>
<config>
<modules>
<Myproyect_Mymodule>
<active>true</active>
<codePool>local</codePool>
</Myproyect_Mymodule>
</modules>
</config>
在这里您将看到挂钩配置。在"events"选项卡上,您可以通过设置事件的名称(第21行)、模块(第23行)和类的方法(第26行),将任何观察者添加到任何事件中。
app/code/local/Myproyect/Mymodule/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<Myproyect_Mymodule>
<version>0.0.1</version>
</Myproyect_Mymodule>
</modules>
<global>
<helpers>
<mymodule>
<class>Myproyect_Mymodule_Helper</class>
</mymodule>
</helpers>
<models>
<mymodule>
<class>Myproyect_Mymodule_Mymodel</class>
</mymodule>
</models>
<events>
<!-- here the event to hook: -->
<checkout_onepage_controller_success_action>
<observers>
<mymodule_model_mymodel>
<type>model</type>
<class>Myproyect_Mymodule_Model_Mymodel</class>
<method>myModelMethod</method>
</mymodule_model_mymodel>
</observers>
</checkout_onepage_controller_success_action>
</events>
</global>
</config>
在第6行,您必须创建要为特定事件执行的方法。app/code/local/MyProject/MyModuro/Model/MyModel.php:
class Myproyect_Mymodule_Model_Mymodel extends Mage_Core_Model_Abstract
{
public function myModelMethod()
{
// acciones.
}
}