shoulders Posted August 9, 2013 Share Posted August 9, 2013 is it possibly to debug the admin? I want to dump out the smarty variables and see what the page is called? this assumes the admin uses smarty. I can get the debug and console to come up for the front page but not the admin. Any help would be appreciated Link to comment Share on other sites More sharing options...
vekia Posted August 9, 2013 Share Posted August 9, 2013 what prestashop version you use ?everything depends on it. Link to comment Share on other sites More sharing options...
shoulders Posted August 9, 2013 Author Share Posted August 9, 2013 ps 1.5.4.1 Link to comment Share on other sites More sharing options...
vekia Posted August 9, 2013 Share Posted August 9, 2013 okay, so in the template files (.tpl) you can use {debug} variable, then you will se popup with smarty debug console. you can also use print_r($this->context->smarty) to see the same in php files Link to comment Share on other sites More sharing options...
shoulders Posted August 9, 2013 Author Share Posted August 9, 2013 you can also use print_r($this->context->smarty) to see the same in php files not used the method above. i will try editing one of the admin template files and see where i get. tar Link to comment Share on other sites More sharing options...
vekia Posted August 9, 2013 Share Posted August 9, 2013 remember that the $this->context object must be defined. otherwise it will not work Link to comment Share on other sites More sharing options...
shoulders Posted August 9, 2013 Author Share Posted August 9, 2013 (edited) The page in question is in the admin. when you go to customers and then edit the customer. i believe is is called customer view. so the page i am looking at in the admin is: admin/themes/default/template/controllers/customers/helpers/view.tpl with i have tried in the tpl {$debug} {debug} {$smarty_debug} and these dont cause the console to pop up. {$smarty_debug} causes an error print_r($this->context->smarty) does nothing adding &SMARTY_DEBUG to the end of the url does nothing However if i put {debug} in /admin/themes/default/template/header.tpl and have either of the following turned on in performance Open console with URL parameter (SMARTY_DEBUG) Always open console the console pops up. It just seems you cant use the console method for sub .tpl files. Which is basically what i need to do. I want to read the variable that shows how much the customer has purchased in the past. I will also then use this method for looking at other things later. no quite there yet Edited August 9, 2013 by shoulders (see edit history) Link to comment Share on other sites More sharing options...
shoulders Posted August 9, 2013 Author Share Posted August 9, 2013 it looks like i will have to write a plugin for smarty because i probably need to execute php code and the recommended way is throught a plugin. i could also use the smartyBC.class to reallow {php} and {include_php} tags. If i get it working i will post back here. Link to comment Share on other sites More sharing options...
shoulders Posted August 12, 2013 Author Share Posted August 12, 2013 i have cracked it. it all depends where you put the {debug} declaration for admin templates and if you are debugging a module in the front, the key is to put the 'Debug Console' setting to 'open console with URL parameter. I will write this up properely as it will help people a lot. i could of done with it. lol 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