federico8 Posted August 10, 2012 Share Posted August 10, 2012 Hi, when editing an address I would like to be able to redirect from AdminAddresses to AdminCustomers since it is more suitable for me... how could I do this? Link to comment Share on other sites More sharing options...
bellini13 Posted August 10, 2012 Share Posted August 10, 2012 You would have to edit the AdminAddress tab and redirect to the AdminCustomers tab once postProcessing is complete. Link to comment Share on other sites More sharing options...
federico8 Posted August 10, 2012 Author Share Posted August 10, 2012 Yes I tried to do that but I cannot see where I must add my redirect, and moreover I am inserting a wrong token so I cannot go on... Link to comment Share on other sites More sharing options...
bellini13 Posted August 10, 2012 Share Posted August 10, 2012 there is a function called postprocess, and at the end is a redirect. you would have to alter that area of the code to redirect based on your requirements. Link to comment Share on other sites More sharing options...
federico8 Posted August 13, 2012 Author Share Posted August 13, 2012 (edited) Hi, in my post process function I see this code: /* If this address come from order's edition and is the same as the other one (invoice or delivery one) ** we delete its id_address to force the creation of a new one */ if ((int)(Tools::getValue('id_order'))) { $this->_redirect = false; if (isset($_POST['address_type'])) $_POST['id_address'] = ''; } } if (!sizeof($this->_errors)) parent::postProcess(); /* Reassignation of the order's new (invoice or delivery) address */ $address_type = ((int)(Tools::getValue('address_type')) == 2 ? 'invoice' : ((int)(Tools::getValue('address_type')) == 1 ? 'delivery' : '')); if (isset($_POST['submitAdd'.$this->table]) AND ($id_order = (int)(Tools::getValue('id_order'))) AND !sizeof($this->_errors) AND !empty($address_type)) { if (!Db::getInstance()->Execute('UPDATE '._DB_PREFIX_.'orders SET `id_address_'.$address_type.'` = '.Db::getInstance()->Insert_ID().' WHERE `id_order` = '.$id_order)) $this->_errors[] = Tools::displayError('An error occurred while linking this address to its order.'); else Tools::redirectAdmin(Tools::getValue('back').'&conf=4'); } However I cannot see where I should insert my redirect to AdminCustomers, so I put an <a> tag at the top of the page. However when I try to click on it I receive a token error... Edited August 13, 2012 by federico8 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now