2013-09-16 61 views
0

所以我對magento和所有人都很陌生。所以我需要實現功能 - >當用戶購買特定的項目時,用戶會自動移動到另一個組。當我搜索網頁時,我發現我可以爲此定製模塊。magento事件結賬後不會啓動

我創建了/public_html/app/code/local/一個名爲GroupSwitcher與子目錄Switch和本教程提到的,我需要etcModel

,所以我有3個文件 我GroupSwitcher_Switch.xml包含

 <!-- Whether our module is active: true or false --> 
     <active>true</active> 

     <!-- Which code pool to use: core, community or local --> 
     <codePool>local</codePool> 

    </GroupSwitcher_Switch> 
</modules> 

我​​3210包含

<?xml version="1.0" encoding="UTF-8"?> 

<!-- 
    The module's node contains basic 
    information about each Magento module 
--> 
<modules> 

    <!-- 
     This must exactly match the namespace and module's folder 
     names, with directory separators replaced by underscores 
    --> 
    <GroupSwitcher_Switch> 

     <!-- The version of our module, starting at 0.0.1 --> 
     <version>1.0.0</version> 

    </GroupSwitcher_Switch> 

</modules> 

<global> 

    <models> 

     <!-- 
      Unique identifier in the model's node. 
      By convention, we put the module's name in lowercase. 
     --> 
     <groupswitcher_switch> 

      <!-- 
       The path to our models directory, with directory 
       separators replaced by underscores 
      --> 
      <class>GroupSwitcher_Switch_Model</class> 

     </groupswitcher_switch> 

    </models> 

    <!-- Defining an event observer --> 
    <events> 
     <sales_order_place_after> 
      <observers> 
       <groupswitcher_switch> 
        <class>sroupSwitcher_switch/observer</class> 
        <method>moveToGroup</method> 
        <type>singleton</type> 
       </groupswitcher_switch> 
      </observers> 
     </sales_order_place_after> 
    </events> 
</global> 

Observe.php包含

<?php 

class GroupSwitcher_Switch_Model_Observer 
{ 
    public function moveToGroup(Varien_Event_Observer $observer) 
    { 

     var_dump($observer); 
     die(); 
    } 
} 

所以,問題是它不會火的時候用戶完成結賬......能不能請你讓我走向正確的方向?

回答

1

只有我的第一個猜測,但有一個錯字:

<class>groupswitcher_switch/observer</class> 

,而不是

<class>sroupSwitcher_switch/observer</class> 
+0

是它是conected帶班,但我去 GroupSwitcher_Switch_Model_Observer,它運行.....謝謝。! – J1and1