New tab not showing on Magento backend - magento

I've created my system.xml under app/code/local/[Namespace]/[Module]/etc directory but it doesn't seem to work.
I understand that the same name given to the tab must be the one I place in the tab tag of the section, and I already have my acl configuration in my config.xml file too.
Can some one help me with this?
<config>
<tabs>
<minimum translate="label" module="minimum">
<label>Ari Modules</label>
<sort_order>10</sort_order>
</minimum>
</tabs>
<sections>
<minimum translate="label" module="minimum">
<label>Minimum Shop Amount</label>
<tab>minimum</tab>
<frontend_type>text</frontend_type>
<sort_order>10</sort_order>
<shown_in_default>1</shown_in_default>
<shown_in_website>1</shown_in_website>
<shown_in_store>1</shown_in_store>
<groups>
<general translate="label" module="minimum">
<label>Configuration</label>
<frontend_type>text</frontend_type>
<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>
<fields>
<yes_no_active translate="label">
<label>Active</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_yesno</source_model>
<sort_order>00</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</yes_no_active>
<minimum_amount translate="label">
<label>Minimum shopping amount</label>
<frontend_type>text</frontend_type>
<sort_order>01</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_amount>
<minimum_message translate="label">
<label>Message to show if the minimum shopping amount is not met</label>
<frontend_type>textarea</frontend_type>
<sort_order>02</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_message>
</fields>
</general>
</groups>
</minimum>
</sections>
This is my config.xml
<config>
<modules>
<Ari_Minimum>
<version>0.1.0</version>
</Ari_Minimum>
</modules>
<global>
<models>
<minimum>
<class>Ari_Minimum_Model</class>
</minimum>
</models>
<helpers>
<minimum>
<class>Ari_Minimum_Helper</class>
</minimum>
</helpers>
</global>
<default>
<ari>
<general>
<yes_no_active>0</yes_no_active>
<minimum_amount>1500</minimum_amount>
<minimum_message><![CDATA[The minimum shopping amount is %s euros]]></minimum_message>
</general>
</ari>
</default>
<frontend>
<events>
<sales_quote_save_after>
<observers>
<ari_minimum_verifyminimum>
<type>singleton</type>
<class>Ari_Minimum_Model_Observer</class>
<method>verifyMinimum</method>
</ari_minimum_verifyminimum>
</observers>
</sales_quote_save_after>
</events>
</frontend>

<?xml version="1.0" encoding="UTF-8"?>
<config>
<tabs>
<ari translate="label" module="minimum">
<label>Ari Modules</label>
<sort_order>10</sort_order>
</ari>
</tabs>
<sections>
<minimum translate="label" module="minimum">
<label>Minimum Shop Amount</label>
<tab>ari</tab>
<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>
<groups>
<general translate="label" module="minimum">
<label>Configuration</label>
<frontend_type>text</frontend_type>
<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>
<fields>
<yes_no_active translate="label">
<label>Active</label>
<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>
</yes_no_active>
<minimum_amount translate="label">
<label>Minimum shopping amount</label>
<frontend_type>text</frontend_type>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_amount>
<minimum_message translate="label">
<label>Message to show if the minimum shopping amount is not met</label>
<frontend_type>textarea</frontend_type>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</minimum_message>
</fields>
</general>
</groups>
</minimum>
</sections>
Then create a file called adminhtml.xml on your module's etc/ folder
<config>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<minimum translate="title" module="minimum">
<title>Ari Minimum</title>
<sort_order>999</sort_order>
</minimum>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
Log out and in , delete your cache storage and try it, you wrote shown_in_* instead of show_in_*
Also, on config .xml, use this instead
<default>
<minimum>
<general>
<yes_no_active>0</yes_no_active>
<minimum_amount>1500</minimum_amount>
<minimum_message><![CDATA[The minimum shopping amount is %s euros]]></minimum_message>
</general>
</minimum>
</default>
Hope this helps

Related

Move magento module from navigation menu to a tab in the admin configuration

I have a widget grid type module, which i want to move into magento system config.
I have added the following into my system.xml:
<config>
<sections>
<customesetup>
<groups>
<serialnumbervalidator>
<label>Serial Numbers</label>
<sort_order>20</sort_order>
<expanded>1</expanded>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<frontend_class>complex</frontend_class>
<frontend_model>mymodule/adminhtml_serial</frontend_model>
</serialnumbervalidator>
</groups>
</customesetup>
</sections>
</config>
but apparently it shows nothing. as the Block extends Mage_Adminhtml_Block_Widget_Grid_Container .
If anyone can point me where to look for my answer this would be great (Did searches and did not find anything useful).
You have to modify your config.xml, to show this up in System Configuration section.
<adminhtml>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<YOUR_MODULE translate="title">
<title><![CDATA[MY TITLE]]></title>
<sort_order>2100</sort_order>
</YOUR_MODULE>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
[...]
</adminhtml>
And in your system.xml :
<config>
<tabs>
<YOUR_MODULE_tab translate="label" module="YOUR_MODULE">
<label>YOUR_MODULE</label>
<sort_order>150</sort_order>
<class>container_admin_img</class> /*optionnal*/
</YOUR_MODULE_tab>
</tabs>
<sections>
<customesetup>
<groups>
<serialnumbervalidator>
<label>Serial Numbers</label>
<sort_order>20</sort_order>
<expanded>1</expanded>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<frontend_class>complex</frontend_class>
<frontend_model>mymodule/adminhtml_serial</frontend_model>
</serialnumbervalidator>
</groups>
</customesetup>
</sections>
</config>
Hope this helps.
Take a look at Alan Storm's No Frills Magento Layout book, or on his website : http://alanstorm.com/category/magento

Magento ad variable in phtml

We have a file for one of our affiliates and want to call a static block in a phtml file.
It has to be in here:
$domain = "domain.com";
The domain.com has to be a variable and I think it would be best to give it a static block so I can put my own variable there. It is for a multistore so every storeview need to have it's own variable.
Let me know if someone knows how to do this.
If the required domain is the current store url
To use the domain name for the current url
$domain = Mage::getBaseUrl();
If the required domain is different to the current store url
I would make this part of the system configuration.
Create a new module
app/code/local/Vendor/Module/etc/config.xml
<config>
<modules>
<Juno_ProductRegion>
<version>0.1.0</version>
</Juno_ProductRegion>
</modules>
<global>
<helpers>
<vendor_module>
<class>Vendor_Module_Helper</class>
</vendor_module>
</helpers>
</global>
</config>
app/code/local/Vendor/Module/etc/system.xml
<config>
<tabs>
<vendor translate="label" module="module">
<label>Vendor</label>
</vendor>
</tabs>
<sections>
<vendor translate="label" module="module">
<label>Module</label>
<tab>vendor</tab>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<general translate="label">
<label>General</label>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<fields>
<affiliate_url translate="label">
<label>Affiliate URL</label>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</affiliate_url>
</fields>
</general>
</groups>
</vendor>
</sections>
</config>
app/code/local/Vendor/Module/etc/adminhtml.xml
<config>
<acl>
<admin>
<children>
<system>
<children>
<config>
<children>
<vendor>
<title>Vendor</title>
</vendor>
</children>
</config>
</children>
</system>
</children>
</admin>
</acl>
</config>
That would create a tab and section in System -> Configuration where you can enter the affiliate url for each store.
To fetch the affiliate url you would use
<?php echo Mage::getStoreConfig('vendor/general/affiliate_url'); ?>

Magento - Adminhtml new custom Tab in the config section is not showing up

i'm using Magento 1.9.0.1 and right now i am working on a new extension and i want to add new module with tab in the admin panel.
Here is what i've done so far:
/app/code/community/VivasIndustries/SmsNotification/etc/config.xml:
<?xml version="1.0"?>
<config>
<modules>
<VivasIndustries_SmsNotification>
<version>0.1.0</version>
</VivasIndustries_SmsNotification>
</modules>
<global>
<models>
<smsnotification>
<class>VivasIndustries_SmsNotification_Model</class>
</smsnotification>
</models>
<events>
<sales_order_save_after>
<observers>
<vivasindustries_smsnotification>
<class>smsnotification/observer</class>
<method>orderSaved</method>
</vivasindustries_smsnotification>
</observers>
</sales_order_save_after>
</events>
</global>
<adminhtml>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<vivas>
<title>Vivas - All</title>
</vivas>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</adminhtml>
</config>
Here is what i have in:
/app/code/community/VivasIndustries/SmsNotification/etc/system.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<tabs>
<vivas translate="label" module="vivasindustries_smsnotification">
<label>Vivas Extensions</label>
<sort_order>100</sort_order>
</vivas>
</tabs>
<sections>
<vivas translate="label" module="vivasindustries_smsnotification">
<label>Extension Options</label>
<tab>vivas</tab>
<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>
<vivas_group translate="label" module="vivasindustries_smsnotification">
<label>My Extension Options</label>
<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>
<fields>
<vivas_input translate="label">
<label>My Input Field: </label>
<comment>My Comment</comment>
<frontend_type>text</frontend_type>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</vivas_input>
<vivas_select translate="label">
<label>My Dropdown: </label>
<comment>Source model provider Magento's default Yes/No values</comment>
<frontend_type>select</frontend_type>
<sort_order>90</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<source_model>adminhtml/system_config_source_yesno</source_model>
</vivas_select>
</fields>
</vivas_group>
</groups>
</vivas>
</sections>
</config>
Here is what i have in: /app/code/community/VivasIndustries/SmsNotification/Helper/Data.php:
<?php
class VivasIndustries_SmsNotification_Helper_Data extends Mage_Core_Helper_Abstract
{
}
With this done i receive the following error when i open my admin panel:
Fatal error: Class 'Mage_Vivasindustries_Smsnotification_Helper_Data' not found in /home/superweb/public_html/store/app/Mage.php on line 547
When i change the name of the FOLDER SmsNotification to Smsnotification this error is gone, but there is any new tab in the System->Configuration...
So guys can you help me out to create a new tab in the Admin panel ?
Thanks in advance!
You forgot to define the helper alias for your module in config.xml. It should be in the same form as for the models:
<global>
<helpers>
<smsnotification>
<class>VivasIndustries_SmsNotification_Helper</class>
</smsnotification>
</helpers>
...
Also, you have to use the same alias in system.xml when specifying the module used for translation:
module="smsnotification"
To explain what has happened: Magento doesn't find a helper with the alias "vivasindustries_smsnotification", so it falls back to the Mage namespace and the given alias with capitalized letters as module (no, I have never seen a case where this would have been the desired behavior, but this is how it works). This results in Mage_Vivasindustries_Smsnotification_Helper_Data as helper class name which cannot be found.
As a general rule: If Magento tries to load classes from your module with "Mage_" prefix, your module configuration is either incomplete, has errors or is cached with an old version and the configuration cache must be cleared.

How to add multiple sections under same tab magento admin panel?

I am trying to add multiple section under same tab in magento admin panel. I added this in system.xml file. It works fine for one section but when i add another it display the section but after click it throw 404 not fount error.
I am using the below code :
<tabs>
<mss translate="label" module="sqlite">
<label>Mss Extensions</label>
<sort_order>100</sort_order>
</mss>
</tabs>
<sections>
<mss translate="label" module="sqlite">
<label>Auto Indexing</label>
<tab>mss</tab>
<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>
<mss_group translate="label" module="sqlite">
<label>Indexing Options</label>
<frontend_type>text</frontend_type>
<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>
<fields>
<mss_input translate="label">
<label>Auto Products</label>
<frontend_type>select</frontend_type>
<sort_order>90</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<source_model>adminhtml/system_config_source_yesno</source_model>
</mss_input>
</fields>
</mss_group>
</groups>
</mss>
</sections>
<sections
<sqlite translate="label" module="sqlite">
<label>Auto Indexing</label>
<tab>mss</tab>
<sort_order>100</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<groups>
<sqlite_group translate="label" module="sqlite">
<label>Sqlite Process</label>
<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>
<fields>
<sqlite_input translate="label">
<label>Sqlite Product</label>
<frontend_type>select</frontend_type>
<sort_order>90</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<source_model>adminhtml/system_config_source_yesno</source_model>
</sqlite_input>
</fields>
</sqlite_group>
</groups>
</sqlite>
</sections>
1 ) This is my mss section this works fine
2) This is section which i am trying to with name sqlite (when i click on this section this throws 404 error)
Please help me how to add new section in tab or where i am doing wrong.
Please change adminhtml.xml file in your module as shown below :
<?xml version="1.0"?>
<config>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<mss translate="title" module="sqlite">
<title>Auto Indexing</title>
<sort_order>0</sort_order>
</mss>
<sqlite translate="title" module="sqlite">
<title>Auto Indexing</title>
<sort_order>1</sort_order>
</sqlite>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
And then clear your magento cache and session.
Please check your modules config.xml. In it check if this section exists if not add it
<adminhtml>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<mss>
<title>Mss - All</title>
</mss>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</adminhtml>
This should solve 404 error.

Payment method is visible in Admin configuration but not on Frontend in Magento

I have included Payment method module on my website.That payment method is visible in Admin Configurations but not on frontend on Payment Step.
I have a config file named config.xml whose code is
<?xml version="1.0"?>
<config>
<modules>
<Goodahead_Santander>
<version>1.0.0</version>
</Goodahead_Santander>
</modules>
<global>
<models>
<goodahead_santander>
<class>Goodahead_Santander_Model</class>
<resourceModel>goodahead_santander_resource</resourceModel>
</goodahead_santander>
<goodahead_santander_resource>
<class>Goodahead_Santander_Model_Resource</class>
<entities>
<finance_id>
<table>goodahead_santander_finance_id</table>
</finance_id>
</entities>
</goodahead_santander_resource>
</models>
<resources>
<goodahead_santander_setup>
<setup>
<module>Goodahead_Santander</module>
<class>Mage_Eav_Model_Entity_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</goodahead_santander_setup>
<goodahead_santander_write>
<use>core_write</use>
</goodahead_santander_write>
<goodahead_santander_read>
<use>core_read</use>
</goodahead_santander_read>
</resources>
<blocks>
<goodahead_santander>
<class>Goodahead_Santander_Block</class>
</goodahead_santander>
</blocks>
<helpers>
<goodahead_santander>
<class>Goodahead_Santander_Helper</class>
</goodahead_santander>
</helpers>
</global>
<frontend>
<layout>
<updates>
<goodahead_santander>
<file>goodahead/santander.xml</file>
</goodahead_santander>
</updates>
</layout>
<events>
<controller_action_predispatch_checkout_cart_index>
<observers>
<goodahead_messages_postdispatch_checkout_cart_add>
<class>goodahead_messages/observer</class>
<method>addIsInCart</method>
</goodahead_messages_postdispatch_checkout_cart_add>
</observers>
</controller_action_predispatch_checkout_cart_index>
<controller_action_predispatch_checkout_onepage_savePayment>
<observers>
<goodahead_santander_controller_action_predispatch_savePayment>
<class>goodahead_santander/observer</class>
<method>onSavePaymentMethod</method>
</goodahead_santander_controller_action_predispatch_savePayment>
</observers>
</controller_action_predispatch_checkout_onepage_savePayment>
<checkout_submit_all_after>
<observers>
<goodahead_santander_checkout_submit_all_after>
<class>goodahead_santander/observer</class>
<method>sendOrderEmail</method>
</goodahead_santander_checkout_submit_all_after>
</observers>
</checkout_submit_all_after>
</events>
</frontend>
<default>
<payment>
<santander>
<active>1</active>
<model>goodahead_santander/Finanzierung</model>
<order_status>1</order_status>
<title>Finanzierung</title>
<allowspecific>0</allowspecific>
<form_block_type>0</form_block_type>
<payment_action>authorize</payment_action>
<show_bank_accounts_in_pdf>1</show_bank_accounts_in_pdf>
<show_customtext_in_pdf>1</show_customtext_in_pdf>
</santander>
</payment>
</default>
</config>
and system.xml is
<?xml version="1.0"?>
<config>
<sections>
<payment>
<groups>
<santander translate="label" module="goodahead_santander">
<label>Finanzierung</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>
<active translate="label">
<label>Enabled</label>
<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>
<frontend_type>text</frontend_type>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</title>
<vendornumber translate="label">
<label>Vendor number</label>
<frontend_type>text</frontend_type>
<sort_order>21</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Your account number</comment>
</vendornumber>
<vendorpassword translate="label">
<label>Vendor password</label>
<frontend_type>password</frontend_type>
<sort_order>22</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Your account password</comment>
</vendorpassword>
<endpoint translate="label">
<label>WSDL endpoint</label>
<frontend_type>text</frontend_type>
<sort_order>23</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>WSDL endpoint URL (Given by bank)</comment>
</endpoint>
<url translate="label">
<label>Financing URL</label>
<frontend_type>text</frontend_type>
<sort_order>24</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Financing URL (Given by bank)</comment>
</url>
<order_status translate="label">
<label>New order status</label>
<frontend_type>select</frontend_type>
<source_model>goodahead_santander/source_order_status</source_model>
<sort_order>40</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</order_status>
<sort_order translate="label">
<label>Sort order</label>
<frontend_type>text</frontend_type>
<sort_order>50</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</sort_order>
<allowspecific translate="label">
<label>Payment from applicable countries</label>
<frontend_type>allowspecific</frontend_type>
<sort_order>60</sort_order>
<source_model>adminhtml/system_config_source_payment_allspecificcountries</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</allowspecific>
<specificcountry translate="label">
<label>Payment from Specific countries</label>
<frontend_type>multiselect</frontend_type>
<sort_order>70</sort_order>
<source_model>adminhtml/system_config_source_country</source_model>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</specificcountry>
<min_order_total>
<label>Minimum Order Total</label>
<frontend_type>text</frontend_type>
<sort_order>71</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</min_order_total>
<max_order_total>
<label>Maximum Order Total</label>
<frontend_type>text</frontend_type>
<sort_order>72</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</max_order_total>
</fields>
</santander>
</groups>
</payment>
</sections>
<!-- FINANCING CALCULATOR -->
<tabs>
<goodahead translate="label" module="goodahead_santander">
<label>Goodahead</label>
<sort_order>300</sort_order>
</goodahead>
</tabs>
<sections>
<goodahead_calculator translate="label">
<label>Financing Calculator</label>
<tab>goodahead</tab>
<frontend_type>text</frontend_type>
<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>
<groups>
<rates translate="label">
<label>Rates</label>
<frontend_type>text</frontend_type>
<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>
<fields>
<cms_page translate="label">
<label>CMS page:</label>
<frontend_type>text</frontend_type>
<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>
<comment>Enter CMS page url key</comment>
</cms_page>
<shipping translate="label">
<label>Shipping cost:</label>
<frontend_type>text</frontend_type>
<sort_order>20</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
<comment>Shipping cost included to calculation</comment>
</shipping>
<rates translate="label">
<label>Months and Rates:</label>
<frontend_type>text</frontend_type>
<frontend_model>goodahead_santander/adminhtml_rates</frontend_model>
<backend_model>adminhtml/system_config_backend_serialized</backend_model>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</rates>
</fields>
</rates>
</groups>
</goodahead_calculator>
</sections>
</config>
and model file named Finanzierung.php is
<?php
class Goodahead_Santander_Model_Finanzierung extends Mage_Payment_Model_Method_Abstract
{
protected $_code = 'santander';
// protected $_canAuthorize = true;
protected $_formBlockType = 'goodahead_santander/form';
protected $_infoBlockType = 'goodahead_santander/info';
/**
* SoapClient object
* #var SoapClient
*/
protected $_soapClient;
/**
* WSDL endpoint url
* #var string
*/
protected $_endpoint;
/**
* Parameters for SOAP request
* #var array
*/
protected $_params;
/**
* #see Mage_Payment_Model_Method_Abstract::isAvailable()
*/
public function isAvailable($quote = null)
{
if (!$this->getEndpoint()
|| !$this->_getVendorNumber()
|| !$this->_getVendorPassword()
|| !$this->getConfigData('url')
) {
return false;
}
return parent::isAvailable($quote);
}
}
?>
and layout design file is
<?xml version="1.0" encoding="UTF-8"?>
<layout>
<checkout_onepage_index>
<reference name="head">
<action method="addJs"><script>goodahead/santander/calculator.js</script></action>
</reference>
</checkout_onepage_index>
<santander_redirect_index>
<reference name="content">
<block type="goodahead_santander/redirect" name="redirect" as="redirect" template="goodahead/santander/redirect.phtml" />
</reference>
</santander_redirect_index>
<checkout_cart_index>
<reference name="head">
<action method="addJs"><script>goodahead/santander/calculator.js</script></action>
</reference>
<reference name="checkout.cart">
<block type="goodahead_santander/calculator" name="goodahead.santander.calculator" as="calculator" template="goodahead/santander/calculator.phtml"/>
</reference>
</checkout_cart_index>
</layout>
Please help.
<?php
class Goodahead_Santander_Model_Finanzierung extends Mage_Payment_Model_Method_Abstract
{
protected $_code = 'santander';
protected $_canUseInternal = true;
protected $_canUseCheckout = true;
}
?>
Please refer above sample code
$_canUseInternal = true; //this means you have to used payment in admin
$_canUseInternal = true; // this means you have to used payment in checkout

Resources