If you want all the details please check the links provided by Alan Storm and others.
As this has been documented extensively before I will only provide a simple example for the sake of answering the question.
Create your own extension with your namespace (called Vendor
in the following) and extension name (Extensionname
).
Add the file app/code/[codePool]/[Vendor]/[Extensionname]/etc/system.xml
. From your text I assume that you already did that.
First important bit: when adding a new section, specify the correct tab name as specified in the system.xml under
<config>
<tabs>
<[tabname] translate="label" module="[module]">
<label>Tab name</label>
<sort_order>10</sort_order>
</[tabname]>
</tabs>
</config>
E.g.
<config>
<sections>
<yoursection translate="label" module="customer">
<class>separator-top</class>
<label>Your section</label>
<tab>customer</tab> <!-- the important one -->
<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>
</yoursection>
</sections>
</config>
Add your groups and fields as usual.
Second important bit add the section to the ACL in app/code/[codePool]/[Vendor]/[Extensionname]/etc/adminhtml.xml
so that you can enter the section (after you have added the permission to the backend users and logged out/in again).
<config>
<acl>
<resources>
<admin>
<children>
<system>
<children>
<config>
<children>
<yoursection translate="title" module="customer">
<title>Your section</title>
<sort_order>10</sort_order>
</yoursection>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
</config>
Even without groups and fields you should be able to see the section.
partial answer
I manage to call my module controller via the button :
the controller class became :
class Mine_Custoptiontype_FilesstateController extends Mage_Adminhtml_Controller_Action
{
public function updateAction()
{
echo "ca va updater!";
}
}
the class instanciation in config.xml
...
</global>
<admin>
<routers>
<mine_custoptiontype>
<use>admin</use>
<args>
<module>Mine_Custoptiontype</module>
<frontName>custoptiontype</frontName>
</args>
</mine_custoptiontype>
</routers>
</admin>
</config>
and the button :
class Mine_Custoptiontype_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View {
public function __construct() {
$this->_addButton('updatebutton', array(
'label' => Mage::helper('adminhtml')->__('SAVE ORDER'),
'onclick' => 'setLocation(\''.Mage::helper("adminhtml")->getUrl("custoptiontype/filesstate/update").'\')',
'class' => 'scalable save'
), 0, 100, 'header', 'header');
parent::__construct();
}
Now I need to post the radio input value and update the order…
I am still surching for a solution.
I read several posts on form submission using something like
$this->_addButton('save_and_continue', array(
'label' => Mage::helper('blog')->__('Save And Continue Edit'),
'onclick' => 'saveAndContinueEdit()',
'class' => 'save'
), -100);
$this->_formScripts[] = "
function saveAndContinueEdit(){
editForm.submit($('edit_form').action + 'back/edit/');
}
";
but I am not even sure I declared my input radio button correctly… As they are used as a product option configuration, maybe I should have used something like :
<input type="radio" class="input-text" name="product[options][{{option_id}}][label]" value="Checking">
<input type="radio" class="input-text" name="product[options][{{option_id}}][label]" value="Files_OK"></td>
<input type="radio" class="input-text" name="product[options][{{option_id}}][label]" value="Files_not_OK">
I would really appreciate any help please...
Best Answer
The default values must be added in the
config.xml
file.Add this inside the
<config>
tag:Clear the cache and check your system configuration section.