2011-12-23 28 views
0

私がしたいのは、新しいカスタム支払い方法を追加し、それを「販売/支払い方法」ではなく新しい設定タブで利用できるようにすることです。Magentoの新しい設定タブでの新しい支払い方法

たとえば、「Sales/Payment Methods」の下にグループを置く代わりに、管理設定で「CompanyName/Method1」に支払い方法を設定したいとします。

ここで問題が発生します。 system.xmlファイルを設定して、その下に新しいタブとモジュールオプションを追加することができます。しかし、config.xmlを変更すると、私の支払い方法はchekoutページに表示されなくなりました。

カスタムタブ名に変更すると、チェックアウトに表示されません。何か案は?

<default> 
     <payment> 
      <spos> 
       <active>0</active> 
       <model>spos/payment</model> 
       <order_status>1</order_status> 
       <title>SPos</title> 
       <payment_action>authorize</payment_action> 
       <allowspecific>0</allowspecific> 
      </spos> 
     </payment> 
</default> 
+0

なぜ支払い方法タブに支払い方法が表示されないようにしたいですか? – OSdave

+0

の中に他の多くのサブメソッドがあるためです。だから、このメソッドのための別のタブを持っている方が良いはずです – UnfoX

答えて

0

http://alanstorm.com/custom_magento_system_configuration

このような意志はあなたを助けます。

+0

リンクをありがとうございます。しかし、私はもっと支払方法に焦点を当てたものが必要です。あなたが提供したリンクの指示に従っていますが、支払い方法の実装に関しては、チェックアウトに表示されません。 – UnfoX

0

あなたのconfig.xmlとsystem.xmlを表示する必要があると思います。私はこのために試してみましたが、次のように私のXMLSは以下のとおりです。

System.Xmlの

<?xml version="1.0"?> 
<config> 
    <tabs> 
     <newmodule translate="label" module="newmodule"> 
      <label>NewModule</label> 
      <sort_order>200</sort_order> 
     </newmodule> 
    </tabs> 
    <sections> 
     <newmodule translate="label" module="newmodule"> 
      <label>NewModule</label> 
      <tab>newmodule</tab> 
      <frontend_type>text</frontend_type> 
      <sort_order>0</sort_order> 
      <show_in_default>1</show_in_default> 
      <show_in_website>1</show_in_website> 
      <show_in_store>1</show_in_store> 
      <groups> 
       <newmodule translate="label" module="paygate"> 
        <label>NewModule Payment</label> 
        <sort_order>670</sort_order> 
        <show_in_default>1</show_in_default> 
        <show_in_website>1</show_in_website> 
        <show_in_store>0</show_in_store> 
        <fields> 
         <active translate="label"> 
          <label>Enabled</label> 
          <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>0</show_in_store> 
         </active> 
         <order_status translate="label"> 
          <label>New order status</label> 
          <frontend_type>select</frontend_type> 
          <source_model>adminhtml/system_config_source_order_status_processing</source_model> 
          <sort_order>4</sort_order> 
          <show_in_default>1</show_in_default> 
          <show_in_website>1</show_in_website> 
          <show_in_store>0</show_in_store> 
         </order_status> 
         <title translate="label"> 
          <label>Title</label> 
          <frontend_type>text</frontend_type> 
          <sort_order>2</sort_order> 
          <show_in_default>1</show_in_default> 
          <show_in_website>1</show_in_website> 
          <show_in_store>0</show_in_store> 
         </title> 
        </fields> 
       </newmodule> 
      </groups> 
     </newmodule> 
    </sections> 
</config> 

のConfig.xmlこれはあなたを助けるかもしれ

<?xml version="1.0"?> 
<config> 
    <modules> 
     <NameSpace_NewModule> 
      <version>0.1.0</version> 
     </NameSpace_NewModule> 
    </modules> 
    <frontend> 
     <routers> 
      <newmodule> 
       <use>standard</use> 
       <args> 
        <module>NameSpace_NewModule</module> 
        <frontName>newmodule</frontName> 
       </args> 
      </newmodule> 
     </routers> 
     <layout> 
      <updates> 
       <newmodule> 
        <file>newmodule.xml</file> 
       </newmodule> 
      </updates> 
     </layout> 
    </frontend> 
    <admin> 
     <routers> 
      <newmodule> 
       <use>admin</use> 
       <args> 
        <module>NameSpace_NewModule</module> 
        <frontName>newmodule</frontName> 
       </args> 
      </newmodule> 
     </routers> 
    </admin> 
    <adminhtml> 
     <menu> 
      <newmodule module="newmodule"> 
       <title>NewModule</title> 
       <sort_order>71</sort_order> 
       <action>newmodule/adminhtml_newmodule</action> 
       <children> 
        <marketing module="newmodule"> 
         <title>Marketing</title> 
         <sort_order>0</sort_order> 
         <action>newmodule/adminhtml_newmodule</action> 
        </marketing>      
       </children> 
      </newmodule> 
     </menu> 
     <acl> 
      <resources> 
       <all> 
        <title>Allow Everything</title> 
       </all> 
       <admin> 
        <children> 
         <newmodule> 
          <title>NewModule</title> 
          <sort_order>1</sort_order> 
          <action>newmodule/adminhtml_newmodule</action> 
          <children> 
          <marketing module="newmodule"> 
           <title>Marketing</title> 
           <sort_order>0</sort_order> 
           <action>newmodule/adminhtml_newmodule</action> 
          </marketing>       
          </children> 
         </newmodule> 
        </children> 
       </admin> 
      </resources> 
     </acl> 
     <layout> 
      <updates> 
       <newmodule> 
        <file>newmodule.xml</file> 
       </newmodule> 
      </updates> 
     </layout> 
    </adminhtml> 
    <global> 
     <fieldsets> 
      <sales_convert_quote_payment> 
       <newmodule_id> 
        <to_order_payment>*</to_order_payment> 
       </newmodule_id>    
       <order_cash_value> 
        <to_order_payment>*</to_order_payment> 
       </order_cash_value> 
      </sales_convert_quote_payment> 
      <sales_convert_order_payment> 
       <budget_id> 
        <to_quote_payment>*</to_quote_payment> 
       </budget_id>     
       <order_cash_value> 
        <to_quote_payment>*</to_quote_payment> 
       </order_cash_value> 
      </sales_convert_order_payment> 
     </fieldsets> 
     <models> 
      <newmodule> 
       <class>NameSpace_NewModule_Model</class> 
       <resourceModel>newmodule_mysql4</resourceModel> 
      </newmodule> 
      <newmodule_mysql4> 
       <class>NameSpace_NewModule_Model_Mysql4</class> 
       <entities> 
        <newmodule> 
         <table>newmodule</table> 
        </newmodule>      
       </entities> 
      </newmodule_mysql4> 
     </models> 
     <resources> 
      <newmodule_setup> 
       <setup> 
        <module>NameSpace_NewModule</module> 
       </setup> 
       <connection> 
        <use>core_setup</use> 
       </connection> 
      </newmodule_setup> 
      <newmodule_write> 
       <connection> 
        <use>core_write</use> 
       </connection> 
      </newmodule_write> 
      <newmodule_read> 
       <connection> 
        <use>core_read</use> 
       </connection> 
      </newmodule_read> 
     </resources> 
     <blocks> 
      <newmodule> 
       <class>NameSpace_NewModule_Block</class> 
      </newmodule> 
     </blocks> 
     <helpers> 
      <newmodule> 
       <class>NameSpace_NewModule_Helper</class> 
      </newmodule> 
     </helpers> 
    </global> 
    <default> 
     <payment> 
      <newmodule> 
       <active>1</active> 
       <model>newmodule/payment_newmodule</model> 
       <order_status>processing</order_status> 
       <title>NewModule Payment</title> 
       <payment_action>authorize</payment_action> 
      </newmodule> 
     </payment> 
    </default> 
</config> 

希望。これらのxmlを確認して比較してください。

0

新しいグループセクションの下にある新しいお支払いのフィールドに、それぞれ<config_path>payment/[YourGroupName]/[FieldName]</config_path>ノードを追加する必要があります。 だからあなたのフィールドが何かあるごSystem.Xmlのファイルに次のようになります。Magentoの中

... 
    <fields> 
     <active translate="label"> 
      <label>Enabled</label> 
      <config_path>payment/method1/active</config_path> 
      <frontend_type>select</frontend_type> 
      <source_model>adminhtml/system_config_source_yesno</source_model> 
      <sort_order>10</sort_order> 
      <show_in_default>1</show_in_default> 
      <show_in_website>1</show_in_website> 
      <show_in_store>1</show_in_store> 
     </active> 
     <title translate="label"> 
      <label>Title</label> 
      <config_path>payment/method1/title</config_path> 
      <frontend_type>text</frontend_type> 
      <sort_order>15</sort_order> 
      <show_in_default>1</show_in_default> 
      <show_in_website>0</show_in_website> 
      <show_in_store>1</show_in_store> 
     </title> 
     . 
     . 
     . 
    </fields> 
... 

PayPalのモジュールは、支払方法のために新しいことを、確認してください学び、発見する良いリファレンスを変えています。

関連する問題