Reputation: 49
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.
Upvotes: 6
Views: 13311
Reputation: 23
you can use https://github.com/mithereal/opencart_inline_debuggers and just d($var); in the source where var is a varible or object
Upvotes: 1
Reputation: 3287
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.
Upvotes: 7