Jump to content

Advice On Use Of P() And Ppp() For Debugging


flyfire

Recommended Posts

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

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

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

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

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

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

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