Jump to content

Redirect user after saving data in admin controller Prestashop


shobhitverma

Recommended Posts

I have an admin controller which displays the list of data on clicking edit on an entry or adding a new entry I am showing renderForm() but after saving the data (either by edit or add) I want to redirect the user to another controller in place of showing the same controller list.

 

function initContent() {
    parent::initContent();
    if (Tools::isSubmit('submit')) {
        Tools::redirectAdmin(self::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminCategories') . '&conf=7');
    }
}

 

Edited by shobhitverma (see edit history)
Link to comment
Share on other sites

public function postProcess() {
        if (Tools::getIsset('submitAddadditional_service')) {
            $this->redirect_after = Context::getContext()->link->getAdminLink('AdminGCardeliverycity', true) . '&updatecitydelivery&id_citydelivery=' . Tools::getValue('id_citydelivery');
        }
        parent::postProcess();
    }

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...