Magento XML using before/after to place blocks hardly ever works

The before and after attributes only work in one of two cases: When you insert into a core/text_list block When your template block calls getChildHtml without any parameters When you say <reference name=”root”> <block type=”core/template” name=”example_block” before=”content” template=”page/html/example-block.phtml”/> </reference> you’re telling Magento Hey Magento, put the example_block inside the root block. When you put a … Read more

Magento getSingleton confusion

First, before we get to Magento, it’s important to understand that PHP has a radically different process model than Java.  A PHP singleton (regardless of Magento’s involvement) is a single instance of a class per HTTP Request.  A PHP program isn’t persistent in memory the same way a Java program is, so adjust your expectations … Read more

Get skin path in Magento?

The way that Magento themes handle actual url’s is as such (in view partials – phtml files): echo $this->getSkinUrl(‘images/logo.png’); If you need the actual base path on disk to the image directory use: echo Mage::getBaseDir(‘skin’); Some more base directory types are available in this great blog post: http://alanstorm.com/magento_base_directories

How to get Fedex testing tracking number?

Your question is not at all stupid. I upvoted it. The fedex documentation is horrible and doesn’t mention how to use their services while testing and after moving to production. Their support is worse. While I was rambling in the internet, I found a page mentioning the tracking number 123456789012 as a test number. Use … Read more

Magento – Passing data between a controller and a block

You don’t. In Magento’s MVC approach, it’s not the responsibility of the controller to set variables for the view (in Magento’s case, the view is Layout and blocks). Controllers set values on Models, and then Blocks read from those same models. In Magento’s view of the world, having a Block relying on the controller doing … Read more

Magento How to debug blank white screen

This is how I got it corrected(Hope will help you guys): Use the following code in your index.php file ini_set(‘error_reporting’, E_ERROR); register_shutdown_function(“fatal_handler”); function fatal_handler() { $error = error_get_last(); echo(“<pre>”); print_r($error); } In my case it tolde me that error/503.php was unavailable. 3.The issue was with testimonial extension I used(http://www.magentocommerce.com/magento-connect/magebuzz-free-testimonial.html) I deleted the testimonial.xml file in … Read more