Chill_user Posted August 12, 2020 Share Posted August 12, 2020 Hello to all, I am wondering how to get backoffice product link with the token? Something like ::getAdminProductLink($id_product) wich redirects to the backoffice product page. Any suggestions? P.S. getAdminTokenLite and getAdminToken are not the same tokens in this link Link to comment Share on other sites More sharing options...
get3code Posted August 12, 2020 Share Posted August 12, 2020 (edited) Hello Amantha, maybe this solution help you 'token'=>Tools::getAdminTokenLite('AdminProducts') or Tools::getAdminTokenLite('AdminProducts') Edited August 12, 2020 by graficzny.chlopak (see edit history) Link to comment Share on other sites More sharing options...
Chill_user Posted August 13, 2020 Author Share Posted August 13, 2020 8 hours ago, graficzny.chlopak said: Hello Amantha, maybe this solution help you 'token'=>Tools::getAdminTokenLite('AdminProducts') or Tools::getAdminTokenLite('AdminProducts') Not correct token (( Link to comment Share on other sites More sharing options...
get3code Posted August 13, 2020 Share Posted August 13, 2020 (edited) Hi, do you send token to tpl? 'token'=>Tools::getAdminTokenLite('AdminProducts') Edited August 13, 2020 by graficzny.chlopak (see edit history) Link to comment Share on other sites More sharing options...
get3code Posted August 13, 2020 Share Posted August 13, 2020 (edited) Or tray this solution, change only name of admin panel (adminPanelName). $productLink = _PS_BASE_URL_.__PS_BASE_URI__."adminPanelName/"; $productLink .= 'index.php?controller=AdminProducts'; $productLink .= '&token='.Tools::getAdminTokenLite('AdminProducts'); $productLink .= '&id_product='.(int) Tools::getvalue('id_product'); $productLink .= '&updateproduct&key_tab=Images&action=Images'; $this->context->smarty->assign(array( 'editLink' => $productLink )); Edited August 13, 2020 by graficzny.chlopak (see edit history) 1 Link to comment Share on other sites More sharing options...
ArpitWebkul Posted September 17 Share Posted September 17 (edited) $productLink = Context::getContext()->link->getAdminLink( 'AdminProducts', true, ['id_product' => (int) $id_product, 'viewproduct' => 1], ['id_product' => (int) $id_product, 'viewproduct' => 1] ); You can refer this Edited September 17 by ArpitWebkul (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