Home » Archive

Articles tagged with: block

Magento, Magento 2 »

[8 Aug 2016 | 2 Comments]

This article shows how you can override / rewrite Block, Controller, Model, and Helper in Magento 2.
This can be done by two ways:
1) using Preference
2) using Plugin

Magento, Magento 2 »

[24 Mar 2016 | One Comment]

In Magento 1.x, you could call/print any module’s template block in any other template (phtml) file with the following code:

Magento, Magento 2 »

[21 Mar 2016 | One Comment]

In Magento 1.x, you could call/print the CMS Static Block in template file with the following code:

Magento »

[3 Aug 2015 | No Comment]

You can add custom blocks inside already existing block through your custom layout xml file. You don’t need to change the template (phtml) code.
Suppose, you want to add a block inside product view page. To do so, you can write the following xml code in your custom module’s layout file. In the below code, I have added a button in product view page.

Magento »

[9 Jun 2010 | 18 Comments]

This article will show how you can override/rewrite Magento Block, Controller, Model and Helper files. We will be dealing with the config XML files and the class files to override.
We override Magento core classes to update/modify the core functionalities according to our need. We can directly makes changes in the core Magento classes but doing so will hamper us when we upgrade the Magento version. All our changes will go away then. Because, when we upgrade Magento, the new core files will replace the old core files which we had …

Magento »

[4 Dec 2009 | 4 Comments]

You can easily call any static block from template (phtml) file. At first, you have to create a static block.
Let us suppose, you created a static block with the identifier cool_items.

Magento »

[4 Dec 2009 | 3 Comments]

You can call your block directly from a phtml file with the following code. You can keep this code and call the block from any phtml file.
I have assumed my module name as Newmodule and my block name as Newblock.php. The phtml file for the block is assumed to be newmodule/newblock.phtml