だから私はmagentoとすべてに本当に慣れていません。したがって、次のような機能を実装する必要があります->ユーザーが特定のアイテムを購入すると、ユーザーは自動的に別のグループに移動します。Webを検索したところ、そのためのカスタムモジュールを作成できることがわかりました。
/public_html/app/code/local/
名前GroupSwitcher
付きでサブディレクトリを使用してディレクトリを作成しましSwitch
た。チュートリアルで述べたように、必要etc
であり、Model
だから私は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>
私のconfig.xml
含む
<?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();
}
}
問題は、ユーザーがチェックアウトを終了したときに起動しないことです...正しい方向に私をピントしてもらえますか?