hello everybody,
I want to know all the pages responsible for products on home page in magento.
Please help me.
Thanks in advance.
Printable View
hello everybody,
I want to know all the pages responsible for products on home page in magento.
Please help me.
Thanks in advance.
Not sure what your mean "page". But if you want to know all of php/template files relate to home page process then you can turn on the debug mod of magento.
Hello
Actually I wanted to know the complete flow of a magento view. Suppose i am viewing the home page, can I ask how the flow of control goes through the PHTML, XML and PHP files , in order to view the home page? Basically wanted to know the flow of control of magento.
Well the magento version is 1.7.0.2. If you still have a doubt in understanding my query , please let me know.
Regards
I think you want to enable Developer mode. Add this to your .htaccess file:
You may also want to enable display errors in index.php:Code:SetEnv MAGE_IS_DEVELOPER_MODE "true"
The best way I have found to debug is with X-Debug in a local environment. You can also use log files to help debug in a production environment, if your unable to run X-Debug in the environment.PHP Code:
ini_set('display_errors', 1);
I've got a more detailed posting here:
http://www.molotovbliss.com/debuggin...gento-commerce
Consider also installing XDebug
Or in another way with printDebugBacktrace. printDebugBacktrace function looks like:
You need to put the above method in app/Mage.php.PHP Code:
public static function printDebugBacktrace($title = 'Debug Backtrace:') {
$output = "";
$output .= "<hr /><div>" . $title . '<br /><table border="1" cellpadding="2" cellspacing="2">';
$stacks = debug_backtrace();
$output .= "<thead><tr><th><strong>File</strong></th><th><strong>Line</strong></th><th><strong>Function</strong></th>".
"</tr></thead>";
foreach($stacks as $_stack)
{
if (!isset($_stack['file'])) $_stack['file'] = '[PHP Kernel]';
if (!isset($_stack['line'])) $_stack['line'] = '';
$output .= "<tr><td>{$_stack["file"]}</td><td>{$_stack["line"]}</td>".
"<td>{$_stack["function"]}</td></tr>";
}
$output .= "</table></div><hr /></p>";
return $output;
}
Note: As you see that above method utilizes the php’s debug_backtrace() method. But manually calling that function will give you very large string due to large no of complex properties & nested objects in magento classes and will be very difficult in tracing. So recommended to use the above mentioned utility function instead.
Usage
Suppose say you are trying to figure out the flow of Mage_Sales_Model_Quote_Address_Total_Shipping::col lect() method.
Go to that class method and put the following line
And when you load the page (my cart) in frontend then you will get the following output:PHP Code:
public function collect(Mage_Sales_Model_Quote_Address $address)
{
echo Mage::printDebugBacktrace(); exit; //add this line just after the opening
//Mage::log(Mage::printDebugBacktrace(), null, 'backtrace.log'); //or you can even log the backtrace
Good luck with your debug :)