How to create Featured product in Magento home page?

Create new Featured attribute Create a new attribute by going to Catalog > Attributes > Manage Attributes > Add New Attribute. Attribute Properties Attribute Identifier: featured Scope: Store View Catalog Input Type for Store Owner: Yes/No Unique Value (not shared with other products): No Values Required: No Input Validation for Store Owner: None Apply To: All Product Types Front End …

Continue Reading

Explain class naming conventions and their relationship with the autoloader

Magento was developed based on the Zend Framework, so the rules of class naming in Magento were taken from the Zend Framework (read more here). Magento standardizes class names depending on their location in the file system. Such standardization enables automatic class loading (autoloader) instead of using require_once and include_once functions. Rather than the directory separator (‘/’ – invalid character …

Continue Reading

Describe Magento Codepools

Magento has three different codepools: Community Core Local Core pool First of all, this folder stores all the code that makes Magento so powerful, flexible and lovely. The chief rule of Magento development is that you should never make any changes in it. In other words, this folder belongs to Magento core developers only and if you are going to …

Continue Reading

Magento Sample Question & Answer

Q. How will you log current collection’s SQL query? A. $collection->printLogQuery(true); OR $collection->getSelect()->__toString(); Q. How to get first item or last item from the collection? A. $collection->getFirstItem() and $collection->getLastItem(); Q. Where is the relation between configurable product and it’s simple product stored in database? A. In the 2 tables: catalog_product_relation catalog_product_superlink_table Q. What are the commonly used block types? What …

Continue Reading

Mage_Core_Block_Text in Magento

It inherints directly from Mage_Core_Block_Abstract and extends its base class only with three methods: 1.  public function setText($text) 2.  public function addText($text, $before=false) {} 3.  public function getText() The block only stores a text string (it could be plain or html of course), and during rendering phase, the block simply outputs the stored string. You could set the string to …

Continue Reading

Mage_Core_Block_Template in Magento

The most important feature of this type of block is of course that you can asign it a template file for rendering. That template will be a file stored on the theme level, so we could say this block is maybe the base block for Magento support of themes. When the block it’s going to be rendered, Magento looks for …

Continue Reading

What is a difference in rendering process for different types of blocks in Magento?

Mage_Core_Block_Text : This is a simple text block so it is not usual that it has child. If so, they will not be automatically rendered, and you would need to render it manually in code. Mage_Core_Block_Template : Childs of template based block renders when calling getChildHtml from template file. The block should be defined as child either by layout directive …

Continue Reading