I have created a module to implement a new product option type. This product option can be configured from the admin view order page :
and for each product that has this option, I have a radio button form :
…
<FORM id="file_state_sel" method="post">
<INPUT type= "radio" name="<?php echo $_label;?>" value="Checking" <?php echo $_checked_verif;?>> Being verified
<INPUT type= "radio" name="<?php echo $_label;?>" value="Files_OK" <?php echo $_checked_ok;?>> Files OK
<INPUT type= "radio" name="<?php echo $_label;?>" value="Files_not_OK" <?php echo $_checked_notok;?>> Files not OK
</FORM>
I added in the view order page a Save Order button :
module config.xml
<blocks>
<custoptiontype>
<class>Mine_Custoptiontype_Block</class>
</custoptiontype>
<adminhtml>
...
<rewrite>
<sales_order_view>Mine_Custoptiontype_Block_Adminhtml_Sales_Order_View</sales_order_view>
</rewrite>
</adminhtml>
</blocks>
and the class
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('Sales')->__('SAVE ORDER'),
'onclick' =>
'class' => 'scalable save'
), 0, 100, 'header', 'header');
parent::__construct();
}}
As you can see, the 'onclick' parameter stays a mystery to me… I tried hundreds of things, but none of them worked…
The goal is to make a a saveAndContinueEdit type function : - get the radio button configuration - update the options values - save the order - reload the order view page
I tried making a module controller, with no success :
in the config.xml
<admin>
<routers>
<adminhtml>
<args>
<modules>
<mine_custoptiontype after="Mage_Adminhtml">Mine_Custoptiontype_Adminhtml</mine_custoptiontype>
</modules>
</args>
</adminhtml>
</routers>
</admin>
with
<?php
class Mine_Custoptiontype_Adminhtml_FilesstateController extends Mage_Adminhtml_Controller_Action
{
public function updateAction()
{
echo "ca va updater!";
}
}
?>
but I do not manage to call it properly…
I you could help me please, I am getting mad…
Thanks very much,
Alex