poplol Posted July 28, 2010 Share Posted July 28, 2010 Hi I am currently doing a prestashop modification where i can pass parameters for example to show me order with the status from 8- 12.. Its code is ok.The problem is that i copy and paste the token from other pages it works for the current user, but when the user changes it does not work. Can anyone help on how to create a new token for me to link internally my pagesLINK EXAMPLE = /admin/index.php?tab=AdminOrders&id_state=8&token=520975cae29bde4b1032996d68fbbb3dI want the token= part to be dynamic.. can anyone help pleaseThanks Presta Forum Link to comment Share on other sites More sharing options...
poplol Posted July 28, 2010 Author Share Posted July 28, 2010 P.S I am making the internal linking from the homepage of the admin and also from certain modules i developed myself Link to comment Share on other sites More sharing options...
codegrunt Posted May 6, 2011 Share Posted May 6, 2011 Bumping this as it is coming up in search results near the top.The admin token is generated on the fly so of course you cannot just copy and paste the rendered value and expect it to work.It will depend a bit on the context of where you are generating the link as to what all is available but the usual approach looks like this:taken from one of a custom module's hook functions: $token=Tools::getAdminToken('[classname]'.intval(Tab::getIdFromClassName('[classname]')).intval($params['cookie']->id_employee)); Where you would replace "[classname]" with the name of the tab class you are linking to. i.e. taken from the stock PayPal module: $token=Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee)); Where you get the employee id from depends on what you are doing (a hook would see it in the $params array);Cheers 1 Link to comment Share on other sites More sharing options...
varadipeter Posted April 26, 2020 Share Posted April 26, 2020 (edited) For me Tools::getAdminTokenLite('AdminProducts') did the trick. Prestashop 1.6 // ThirtyBees 1.1.0 Edited April 26, 2020 by varadipeter added software version (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