0

顧客/アカウント メニューを置き換える新しいモジュールを作成しました。リンクは www.mysite.com/account です。

ログイン、登録、その他のページを www.mysite.com/account/login などとして表示するように変更したい

顧客/アカウント/ログインなどに戻る代わりに

それを行う最良の方法は何ですか?

これが、これまでに作成したconfig.xmlコードです....

<?xml version="1.0"?>
<config>
  <modules>
    <SquareNetMedia_MyAccount>
      <version>0.1.0</version>
    </SquareNetMedia_MyAccount>
  </modules>
  <frontend>
    <routers>
      <myaccount>
        <use>standard</use>
          <args>
            <module>SquareNetMedia_MyAccount</module>
            <frontName>account</frontName>
          </args>
      </myaccount>
    </routers>
        <layout>
          <updates>
            <myaccount>
              <file>myaccount.xml</file>
            </myaccount>
          </updates>
        </layout>
  </frontend>
  <global>

    <helpers>
      <myaccount>
        <class>SquareNetMedia_MyAccount_Helper</class>
      </myaccount>
    </helpers>
    <blocks>
      <myaccount>
        <class>SquareNetMedia_MyAccount_Block</class>
      </myaccount>
    </blocks>
  </global>
</config> 
4

1 に答える 1

0

ファイルを次のように変更します。

 <frontend>
 <routers>
 <myaccount>
    <use>standard</use>
      <args>
        <module>SquareNetMedia_MyAccount</module>
        <frontName>account</frontName>
      </args>
  </myaccount>
  <customer>
    <args>
      <modules>
        <SquareNetMedia_MyAccount before="Mage_Customer_AccountController">SquareNetMedia_MyAccountr</SquareNetMedia_MyAccount>
      </modules>
    </args>
  </customer>

次に、モジュールのコントローラー フォルダーに AccountController.php という名前の新しいコントローラー ファイルを作成します。

<?php
require_once Mage::getModuleDir('controllers','Mage_Customer').DS.'AccountController.php';
class SquareNetMedia_MyAccount_AccountController extends Mage_Customer_AccountController{
}

関数をオーバーライドできるようになりました

 public function loginAction(){
 #Here you can do what you need I think
 }

それが正しいことを願っています。明確でない場合はお知らせください。平和。

于 2013-03-14T21:16:12.400 に答える