2014-09-03 51 views
-1

請讓我知道如何在付款成功屏幕上找到付款成功或失敗的信息。請向我發送代碼段。Magento檢查付款是否付清成功頁面

以上要求是在完成付款後,我們需要提供可下載的鏈接給客戶,而不必更改管理界面中的訂單狀態。

由於提前,

P.Karthikeyan

回答

0

創建的結構和文件:

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文件來設置模塊:應用程序的/ etc /模塊/ Myproyect_Mymodule。 xml

<?xml version="1.0"?> 
<config> 
    <modules> 
     <Myproyect_Mymodule> 
      <active>true</active> 
      <codePool>local</codePool> 
     </Myproyect_Mymodule> 
    </modules> 
</config> 

在這裏您將看到掛鉤配置。在「事件」選項卡中,您可以通過設置事件的名稱(第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行,您必須創建針對especified事件執行的方法。 app/code/local/MyProject/MyModulo/Model/MyModel.php:

class Myproyect_Mymodule_Model_Mymodel extends Mage_Core_Model_Abstract 
{ 

    public function myModelMethod() 
    { 
     // acciones. 
    } 

}