Jump to content

Redirect from AdminAddresses to AdminCustomers


federico8

Recommended Posts

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 by federico8 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...