In a module I created a new file type product option. The goal was to add a "file is valid" parameter.
With this option, I can define in the admin panel the option "is valid" state from the order detail view page and a button permits to submit the state change via a controller.
I would like after submission to be redirected to the order detail view page.
I tried $this->_redirect('*/*');
but get 404 error
my option phtml (app/design/adminhtml/default/default/template/custoptiontypev6/options/customview/xfile.phtml)
...
<span>
<FORM id="xfile_state_sel" method="post" style="margin: 0px 5px 0px 15px;" action="<?php echo Mage::helper("adminhtml")->getUrl("custoptiontypev6/xfile/update");?>">
<input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
<input name="order_id" type="hidden" value="<?php echo $_order_id ?>" />
<input name="item_id" type="hidden" value="<?php echo $_item_id ?>" />
<input name="option_id" type="hidden" value="<?php echo $_optionid ?>" />
<input name="option_label" type="hidden" value="<?php echo $_label ?>" />
<INPUT type= "radio" name="<?php echo 'Xfile_option_'.$_optionid.'_'.$_label;?>" value="Checking" <?php echo $_checked_verif;?>> Being verified
<INPUT type= "radio" name="<?php echo 'Xfile_option_'.$_optionid.'_'.$_label;?>" value="Files_OK" <?php echo $_checked_ok;?>> Files OK
<INPUT type= "radio" name="<?php echo 'Xfile_option_'.$_optionid.'_'.$_label;?>" value="Files_not_OK" <?php echo $_checked_notok;?>> Files not OK
<span><button type="submit" style="margin: 0px 5px 0px 15px;">Update state</button></span>
</FORM>
</span>
The controller :
<?php
class Mine_Custoptiontypev6_XfileController extends Mage_Adminhtml_Controller_Action
{
public function updateAction()
{
$post = $this->getRequest()->getPost();
try {
if (empty($post)) {
//echo 'Invalid form data.';
}
/******* form processing *******/
...
$this->_redirect('*/*');
}
}
?>
Thank you for your help,