flyfire Posted December 18, 2015 Share Posted December 18, 2015 Hello I have a problem with an installed creditcard payment module not redirecting to the confirmation page upon successful authorisation from the bank. i am attempting to debug a validation.php file by embedding p() in the php code to see what is happening. The frustration is i dont see any display of p() output on the browser. {debug} works fine for tpl type files but i wish to debug php code. What simple step am i missing here? i have limted developer experience so any advice appreciated. Chris Link to comment Share on other sites More sharing options...
-=peter=- Posted December 19, 2015 Share Posted December 19, 2015 I never used p()..just install netbeans for php and enjoy . Link to comment Share on other sites More sharing options...
flyfire Posted December 20, 2015 Author Share Posted December 20, 2015 Thanks for the suggestion. Yes I am aware of Netbeans though I am not an experienced user of it. Given the Prestashop experts have provided p() capability I thought I should learn more. As you can guess I am keen to know the correct syntax for using p()) so if anyone is willing to share some examples here I would greatly appreciate it. The documentation on the Prestashop core site is a little cryptic and probably assumes prior knowledge well in advance of my own, Also before I put my question up I did read some commentary here on the Prestashop forum that also refers to the firefox extension firephp as one other tool to capture variables for debugging purposes though this was some years ago. Hence my assumption that p () is worth exploring. Link to comment Share on other sites More sharing options...
-=peter=- Posted December 20, 2015 Share Posted December 20, 2015 (edited) do you have this in config?@ini_set('display_errors', 'on');define('_PS_DEBUG_SQL_', true); edit: maybe it's PS_MODE_DEV in defines.ini.php Edited December 20, 2015 by -=peter=- (see edit history) Link to comment Share on other sites More sharing options...
flyfire Posted December 21, 2015 Author Share Posted December 21, 2015 Yes all good and confirmed. I also have the profiler enabled as well. {Debug} dumps successfully to the web page when I embed the code in a tpl file. Just wish to do the same with a php file. So my questions are: 1) Does p() dump to a web page or to some file or to a console somewhere 2) Should i use the syntax " echo" p ( $some variable) rather than p($some variable) 3) Where is the code for p() located. Perhaps there are some introductory comments at the header that may help? Can someone help me please? There must be some fundamental step I am missing here...... Link to comment Share on other sites More sharing options...
-=peter=- Posted December 21, 2015 Share Posted December 21, 2015 It's in Tools class. Look at dieObject(). Link to comment Share on other sites More sharing options...
flyfire Posted December 22, 2015 Author Share Posted December 22, 2015 Thanks I will investigate. I also plan to experiment with the syntax for the p() operator. For example I am wondering if p('message: this is a test') will work. Other than that I am simply dumbfounded that nobody has mentioned that they have used this functionality. The problems I am experiencing I think would be trivial to an experienced developer....... Link to comment Share on other sites More sharing options...
-=peter=- Posted December 22, 2015 Share Posted December 22, 2015 You can always try print_r() or var_dump().. Link to comment Share on other sites More sharing options...
flyfire Posted December 23, 2015 Author Share Posted December 23, 2015 Well looking at other php forums i found a comment that smarty could be stopping the console messaging. I am using firefox with the console enabled and have tried var_dump() as well. Still no output. I have also tried firephp and installed the library on the localhost version of my live site.. I added fb('message to console') to one of the php payment modules that processes the payments. Still no output. I really don't know what else to do or investigate. Could it be some setting in the firebox browser that is wrong? Link to comment Share on other sites More sharing options...
-=peter=- Posted December 23, 2015 Share Posted December 23, 2015 I tried in blockcart.php: public function hookRightColumn($params) { ddd($params); and it works. Check your php config for disable_functions. I'm not an expert in php (I use it only when I must), so I'm afraid I can't help you more. Link to comment Share on other sites More sharing options...
flyfire Posted December 24, 2015 Author Share Posted December 24, 2015 Thanks for taking the time to prove the method works in your case. Based on your feedback looks like I have an environment or setting issue. I will investigate. Thanks for your indulgence. Appreciate your help and advice. And Merry Christmas! 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