I'm new one to opencart.is there any debug tools available for opencart ? .i don't know control flow of opencart execution.so i want to put break points,step into code,see variable values. please give any reference to that .thanks in advance.
I wrote a super simple little function for the loader class that I use 100 times a day. It really helps and you can call it from just about anywhere.
OPEN:
system/engine/loader.php
Right before the closing brace for the class add this method:
// adding testing method
public function test ($items, $quit = true) {
echo "<pre>";
print_r ($items);
echo "</pre>";
if ($quit):
exit;
endif;
}
Now anytime after the Controller is instantiated you can call:
$this->load->test($results);
OR:
$this->load->test($results, false);
if you're in a loop and don't want the script to exit.
Obviously substitute $results
for whatever array or variable you want to test.
It's been a huge help to me.
You can of course add this via vqmod if you don't want to modify the core.
You are right. Opencart is very simple system. In addition you can use xDebug - very useful tool. Also, read system/logs/error.txt
error_reporting(E_ALL); // very helpful
die(print_r($_POST, true)); // print all POST data and break the code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With