Magento Interview questions and answers for freshers as well as experienced developers.
1. Explain Magento’s MVC architecture
First of all, what is MVC?
MVC stands for Model-View-Controller. Any application that separates it’s data access, business logic and user interface is called MVC. There can be two types of MVC: convention-based and configuration-based. Example, cakePHP is convention-based, i.e. you just need to follow the instructions of the core system to get your module ready in just few lines. Magento is configuration-based, i.e. you need to specify each and every thing to your module’s config file in order to get it work. Magento has controllers (for request/response routing), Block (for rendering content), Model (for business logic), Resource/Mysql4 (for database operations), etc (for module-specific configuration files), Helper (for common functions), sql (for setup scripts), layout (for connecting block with templates for each controller action) and template/.PHTML file (for Presentation i.e. View).
Continue reading »
Add custom column in admin Grid which will show radio/checkbox button. I know this is weird, but some people need this as a requirement. Here I will show you how you can have radio button or checkbox button that you can have directly in your grids.
For radio button,
1 2 3 4 5 6 7 8
$this->addColumn('some_id', array( 'header_css_class' => 'a-center', 'header' => Mage::helper('adminhtml')->__('Some Header'), 'type' => 'radio', 'html_name' => 'items', 'align' => 'center', 'value' => array('1') ));
Ever annoyed by the notification which pops up everytime you login to your Magento admin panel? Well, you can get rid of those bugging notifications without changing core.
Just disable the output of Mage_AdminNotification at:
System -> Configuration -> Advanced -> Disable Modules Output
Now logout and login, you will now never see those unwanted notifications.
In Magento, image quality is distorted when it’s resized in Category page as well as Product page. This is very bad if you are running an eCommerce website because image is the only thing which gives best impression to your customers. There are several complains regarding this in Magento forums with different answers. Some even suggest to use ImageMagick over the default Gd2 library.
If you don’t want to switch to ImageMagick and also don’t want to do much changes, here is a simple solution.
1.) Copy app/code/core/Mage/Catalog/Helper/Image.php
2.) Paste it in local (app/code/local/ , create directories Mage/Catalog/Helper if it’s not there)
So the final structure will be app/code/local/Mage/Catalog/Helper/Image.php
3.) Edit newly pasted Image.php’s init() method, just after it sets “watermark size”, add a line:
4.) Save, flush image cache, run any category or product page and see the difference!
Hope this helps!
If you are building website in Magento, you may have noticed that there are two columns in sales_flat_order table which are confusing. These are state and status. You might think what is the difference between these two, both having same meaning.
Well, this is not the case. They both are different. State is used by magento to tell if the order is new, processing, complete, holded, closed, canceled, etc.; while Statuses are the one that YOU would be defining at the backend in System -> Order Statuses. Magento displays order STATUSES and not STATES in the backend order detail page to let you know which status is assigned as per your mapping. Remember, multiple statuses can be mapped with one state, while vice versa is not possible. Continue reading »
Welcome to my Blog
- Apache (1)
- Domain name (3)
- eCommerce (2)
- Humor (3)
- Instagram API (1)
- jQuery (4)
- JSON (1)
- Linux (10)
- Magento (136)
- Magento admin (58)
- Magento Certification (2)
- Magento error (13)
- Magento frontend (68)
- Magento Interview (5)
- Magento2 (4)
- Mobile (1)
- MySQL (7)
- OroCRM (2)
- Performance (2)
- PHP (8)
- Prototype JS (3)
- Security (1)
- Wordpress (3)
- XML (2)