1

まず、キャッシュを無効にしてクリアし、ログアウトしてから再度ログインしたとしましょう。ただし、まだこのエラーが発生しています。

次に、私がやろうとしていることを説明しましょう。ところで、これは私の最初の拡張機能のビルドです:)有効にすると、元のcart/shipping.phtmlファイルを独自のテンプレートファイルで上書きする拡張機能をビルドしようとしています。

管理者設定の下の左側のサイドバーに自分の拡張機能が表示されます。ただし、拡張機能をクリックして[一般]タブを表示すると、無効または有効にできますが、恐ろしい404ページが見つかりません。私のコードを見て、私が間違っていることを教えていただけますか?助けてくれたすべての人に感謝します!

これが私のすべてのファイルです:)

etc / config.xml

<?xml version="1.0"?>
<config>    
<modules>
<Beckin_DropDownShipping><version>1.0.0</version></Beckin_DropDownShipping>
    </modules>

<global>
            <blocks>
                 <dropdownshipping>
                      <class>Beckin_DropDownShipping_Block</class>
                 </dropdownshipping>
            </blocks>

    <helpers>
         <dropdownshipping>
          <class>Beckin_DropDownShipping_Helper</class>
         </dropdownshipping>
    </helpers>      
</global>

 <frontend>
    <layout>
        <updates>
            <beckin>
                <file><!-- beckin_dropdownshipping.xml --></file>
            </beckin>
        </updates>
    </layout>
    <routers>
        <dropdownshipping>
            <use>standard</use>
            <args>
                <module>Beckin_DropDownShipping</module>
                <frontName>dropdownshipping</frontName>
            </args>
        </dropdownshipping>
    </routers>  
 </frontend>


 <adminhtml>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <dropdownshipping_options>
                                        <title>Beckin Drop Down Shipping Extension</title>
                                    </dropdownshipping_options>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</adminhtml>

</config>

etc / system.xml

<?xml version="1.0"?>
<config>
<tabs>
    <beckin translate="label">
        <label>Beckin Extensions</label>
        <sort_order>100</sort_order>
    </beckin>
</tabs> 
<sections>  
            <dropdownshipping translate="label">
        <label>Drop Down Shipping</label>
        <tab>beckin</tab>
        <frontend_type>text</frontend_type>
        <sort_order>1000</sort_order>
        <show_in_default>1</show_in_default>
        <show_in_website>1</show_in_website>
        <show_in_store>1</show_in_store>


            <groups>            

                <settings translate="label">
                <label>Settings</label>
                <frontend_type>text</frontend_type>
                <sort_order>1</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>       
            <fields>
                <enable translate="label">
                <label>Enable</label>
                <comment>
                <![CDATA[Enable or Disable this extension.]]>
                </comment>
                <frontend_type>select</frontend_type>
                <source_model>adminhtml/system_config_source_yesno</source_model>
                <sort_order>1</sort_order>
                <show_in_default>1</show_in_default>
                <show_in_website>1</show_in_website>
                <show_in_store>1</show_in_store>                    
                </enable>           
            </fields>

                </settings>
            </groups>
        </dropdownshipping>
</sections>     
</config>

Helper / Data.php

<?php
class Beckin_DropDownShipping_Helper_Data extends Mage_Core_Helper_Abstract
{   

}

Block / Cart / Shipping.php

<?php

class Beckin_DropDownShipping_Block_Cart_Shipping extends Mage_Checkout_Block_Cart_Shipping
{

protected function _construct()       
    if(Mage::getStoreConfig('dropdownshipping/general/enable', Mage::app()->getStore()->getId())
    {
    $this->setTemplate('Beckin/dropdownshipping/drop_down_shipping.phtml');
    }

}
4

2 に答える 2

5

設定ファイルのaclセクション:変更

<dropdownshipping_options>
    <title>Beckin Drop Down Shipping Extension</title>
</dropdownshipping_options>

<dropdownshipping>
    <title>Beckin Drop Down Shipping Extension</title>
</dropdownshipping>
于 2012-12-16T06:41:02.000 に答える
0

また、404エラーの取得に問題があり、最終的にそれを理解するのに役立った答えはここにあります:https ://stackoverflow.com/a/6426041/3424147

ブログ投稿へのリンクをたどり、いくつかのコメントを読んだ後、セッションデータを手動でクリアすることについて話しているものを見つけました。私にとっては、ログアウトして再度ログインするだけではセッションのACLデータを更新できませんでしたがvar/session、新しい管理者設定メニューセクションからセッションファイルを手動で消去した後、動作を開始しました(404エラーは発生しません)。

于 2015-01-31T22:45:20.627 に答える