About Magento Interview Preparation
Magento interview question and answers for all ecommerse developer
For better preparation, read each question carefully, understand the concept, prepare one real example,
and connect your answer with your project or work experience.
Magento Questions List
Quick list of important Magento interview questions. Detailed answer previews are available below.
- What Is Magento ?
- Explain Magento Versions and License
- What The History Behind Magento ?
- Explain features use of Magento
- what is EAV in Magento?
- How Magento's MVC architecture works:
- How Magento ORM works?
- what is Difference between Magento function getSingleton() and getModel()
- How to improve magento performance?
- What is benefit of namespace (package) in magento?
- How to include CMS block in template file(.phtml)?
- How to add an external javascript or css file to Magento?
- What are handles in magento (layout)?
- How to upgrade to the latest version using Magento Connect?
- Why magento is slow ?
- What are the addAttributeToFilter Conditionals in Magento?
- What permissions required for file and folder In Magento ?
- How to change Currency in INR in magento ?
- How To Add Blog In Magento?
- How to add review list on product page of Magento?
- How to run custom MySql query in Magento ?
- How to add Custom javascript and css file in magento
- How To Create a Featured Product?
- How too reset admin password in magento ?
- What is the latest version of magento?
- how to change any page title in magento?
- How to add a home link to the menu bar?
- How to add an RSS feed in magento?
- How to integrate JW Image Rotator 3.17 in megento?
- How to create a new page in magento?
Question 1: What Is Magento ?
Answer: Magento is a open source eCommerce platform for a complete eCommerce web site solution. Magento’s open source architecture enables the user to maintain complete control over the structure and functionality of a web site. One of the most impressive aspects of Magento is the use of the Zend Framework. This allows for separation of the Model-View-Controller (MVC) which separates its core operations from functionality and appearance. Magento offers a stable eCommerce environment and gives us the flexibility to completely customize the web site to suit our business needs.
View detailed answer →
Question 2: Explain Magento Versions and License
Answer: There are currently two versions of Magento: the Magento Community Edition and the Magento Enterprise Edition. The Magento Community Edition is licensed under the Open Software License (OSL) v3.0. The Magento Enterprise Edition is available under a commercial license and requires an annual fee. Both editions share the same underlying framework. The Enterprise Edition includes several additional features that are not included with the Community Edition, including gift certificates, customer store credits, and strong data encryption.
View detailed answer →
Question 3: What The History Behind Magento ?
Answer: Varien began developing Magento in January of 2007. It was their vision to establish an eCommerce platform unlike anything else on the market. Varien originally planned on building an eCommerce platform based on a fork of osCommerce, but decided to write their own system using the Zend Framework instead. During Varien’s six month beta period, they had over 225,000 downloads of Magento. The first public release of Magento, version 1.0, was released on March 31, 2008. Shortly after, Magento 1.1 was released. Magento 1.1 fixed many bugs found in version 1.0, but also included a faster and more informative administrative user interface. Mag...
View detailed answer →
Question 4: Explain features use of Magento
Answer: In addition to a solid architecture and framework, there are several unique reasons why Magento makes a great choice for an eCommerce solution. • One of the most amazing features about Magento is that you can design and develop multiple web sites and they store and share one administrative interface. This extremely flexible feature allows you to modify and control multiple web sites. All of your products inventory and pricing can be controlled from one central location. There is no longer a need to login to multiple locations to handle multiple web sites. Magento has the ability to control them all. • Magento supports over sixty lan...
View detailed answer →
Question 5: what is EAV in Magento?
Answer: EAV means Entity Attribute Value this allows us to add unlimited columns or attributes to our table virtually. Means, the fields which is represented in “column” way in a regular table, is represented in a “row” (records) way in EAV. In EAV, we have one table which holds all the “attribute” (table field names) data, and other tables which hold the “entity” (id or primary id) and value (value for that id) against each attribute. In Magento, there is one table to hold attribute values called eav_attribute and 5-6 tables which holds entity and data in fully normalized form, eav_entity, eav_en...
View detailed answer →
Question 6: How Magento's MVC architecture works:
Answer: MVC means Model, View and Controller. so any architecture use to separates their business logic and user interface known as MVC it two type convention-based in this just need to follow the instructions of the core system to get our module ready in just few lines. Magento is 2nd type configuration-based, i.e. we need to specify each and every thing to our module’s config file in order to get it work. Magento has Controller (for Routing), Block (for Business Logic), Model (for DB access, sql) and Template file (for Presentation i.e. View). It work like below 1. When you enter the URL like http://www.pcds.co.in/frontn...
View detailed answer →
Question 7: How Magento ORM works?
Answer: ORM stands for Object Relational Mapping. It’s a programming technique used to convert different types of data to Objects and vice versa. In Magento, ORM is shown as Model (based on Zend Framework’s Zend_Db_Adapter), which further breaks down to two types of Models. - First is the “simple” i.e. Regular Models which is nothing but flat table or our regular table structure. - Second Model is EAV (Entity Attribute Value), which is quite complicated and expensive to query. All Magento Models interacting with database are inherited from Mage_Core_Model_Abstract class, which is further inherited from Varien_Object. Differenc...
View detailed answer →
Question 8: what is Difference between Magento function getSingleton() and getModel()
Answer: The difference between Mage:getSingleton() and Mage::getModel() is that the former one does not create an object if the object for same class is already created, while the later creates new objects every time for the class when it’s called. Mage::getSingleton() uses the “singleton design pattern” of PHP. If the object is not created, it will create it. Mage::getSingleton() is mostly used when you want to create an object once, modify it and later fetch from it. Popular example is session, you first create a session object, and then add/remove values from session across different pages, so that it retains your values (e.g. ca...
View detailed answer →
Question 9: How to improve magento performance?
Answer: Enabled magento caching MySQL Query caching Enable Gzip Compression Disable any unused modules Disable the Magento log Optimise your images Combine external CSS/JS into one file Enable Apache KeepAlives: Make sure your Apache configuratio has KeepAlives enabled.
View detailed answer →
Question 10: What is benefit of namespace (package) in magento?
Answer: you can have more than one module with same name but they should be placed in different namespaces. All magento core modules are contained in mage namespace. And Magento search module in order by local then community then base module
View detailed answer →
Question 11: How to include CMS block in template file(.phtml)?
Answer: Access blocks content from .phtml template file by : echo $this->getLayout()->createBlock("cms/block")->setBlockId("static_block_id")->toHTML();
View detailed answer →
Question 12: How to add an external javascript or css file to Magento?
Answer: To add an external javascript or css file to Magento is too much easy as we can add this in any of below tow ways in xml layout file in given like in <catelog_product_view> part we an add in <referense name="head"> <action method="addJs"><script>js/yourfile.js</script></action> <action method="addCss"><stylesheet>css/yourstyle.css</stylesheet></action> or <action method="addItem"><type>skin_js</type><name>js/ yourfile.js</name></action> <action method="addItem"><type>skin_css</type><name>css/yourstyle. css</name></a...
View detailed answer →
Question 13: What are handles in magento (layout)?
Answer: Handles are basically used for controlling the structure of the page like which block will be displayed and where. First level child elements of the node are called layout handles. Every page request can have several unique Handles. The handle is called for every page. handle for products belongs to virtual product type, PRODUCT_TYPE_simple is called for product details page of simple product type and PRODUCT_TYPE_virtual is called for the virtual product detail page and customer_logged_in handle is called only if customer is logged in. The muster_index_index handle is created by combining the frontName (muster), Action Controller (index), an...
View detailed answer →
Question 14: How to upgrade to the latest version using Magento Connect?
Answer: Upgrading Magento to the latest version is a fairly simple task. Copy and Paste this key magento-core/Mage_All_Latest VIA Magento Connect where it states Paste extension key to install:. This will upgrade Magento to the newest version.
View detailed answer →
Question 15: Why magento is slow ?
Answer: Magento is slow due to below thing 1. EAV structure of magento database, even for retrieving single entity the query becomes very complex . 2. Magento’s template system involves a lot of recursive rendering 3. Huge XML trees built up for layout configuration, application configuration settings
View detailed answer →
Question 16: What are the addAttributeToFilter Conditionals in Magento?
Answer: In Magento we can use addAttributeToFilter Conditions same as WHERE in SQL Below are the all condtions Equals: eq $_products->addAttributeToFilter('status', array('eq' => 1)); Not Equals - neq $_products->addAttributeToFilter('sku', array('neq' => 'test-product')); Like - like $_products->addAttributeToFilter('sku', array('like' => 'UX%')); One thing to note about like is that you can include SQL wildcard characters such as the percent sign. Not Like - nlike $_products->addAttributeToFilter('sku', array('nlike' => 'err-prod%')); In - in $...
View detailed answer →
Question 17: What permissions required for file and folder In Magento ?
Answer: A security Issue happen if Setting all the files & folders to 777 will make them writable by everyone.! Normal Operation For the normal operation or installation of a Magento store, only 2 folders need to be writable: /media - for web accessible files, such as product images /var - for temporary (cache, session) and import/export files Installation During installation Magento Install Wizard will create app/etc/local.xml file which contains database configuration and global encryption key for your Magento copy. Meaning app/etc folder has to be writable to web service. Web based MagentoConnect manager If you wish to use web based downloader...
View detailed answer →
Question 18: How to change Currency in INR in magento ?
Answer: In Magento, Currency change is very easy just we need to follow below step From the Admin panel, select System > Configuration. From the Configuration panel on the left, under General, select the Currency Setup tab. Click to expand the Currency Options section. Then, do the following: In the Base Currency list, select the primary currency that is used for store transactions. In the Default Display Currency list, select the primary currency that is used to display pricing in your store. In the Allowed Currencies list, select all currencies that are accepted as payment by your store. When finished, click the Save Config button. To...
View detailed answer →
Question 19: How To Add Blog In Magento?
Answer: To add Blog in Magento we just need to get magento connect extension key and follow below step In admin panel system>magento connect>Magento connect manager and then below input type Paste extension key to install: need to add this key http://connect20.magentocommerce.com/community/AW_Blog there then click on Install button after that need to proceed Just it you will get a link in admin panel name blog
View detailed answer →
Question 20: How to add review list on product page of Magento?
Answer: To Add Review List on mageto product page we have to do below few step First of all we need to open catalog.xml in Layout folder of used design theme and then we have to add below code in catalog_product_view. section <block type="review/product_view_list" name="product.info.product_additional_data" as="reviews" template="review/product/view/list.phtml"/> and then next step is to just put a single line of code in file catalog/product/view.phtml in template < ?php echo $this->getChildHtml('reviews') ? > after that mus...
View detailed answer →
Question 21: How to run custom MySql query in Magento ?
Answer: To write custom SQl query in magento is very easy we have to just need to call $db = Mage::getSingleton('core/resource')->getConnection('core_write'); $result=$db->query("SELECT * FROM PCDSTable");
View detailed answer →
Question 22: How to add Custom javascript and css file in magento
Answer: It's much important for Magento theme developer to add their own external js and css file so that they can use custom JavaScript and css and it much easier in Magento to add this. as just you needto add local.xml in your own theme and add below structure code in that filein local.xml under layout folder of your own theme /or default theme that currently in use <?xml version="1.0" encoding="UTF-8"?><layout><default><reference name="head"><action method="addCss"><stylesheet>css/pcds_style.css</stylesheet></action><action method="addJs"><script>pcds/jquery.js</script></action&g...
View detailed answer →
Question 23: How To Create a Featured Product?
Answer: We are gooing to add Fueture product on our magento store as The Featured Product is a product with an attribute added from the administrative UI. When the administrator selects Yes in the Featured attribute, that product will be displayed in a content block on the category page. Step 1) 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:...
View detailed answer →
Question 24: How too reset admin password in magento ?
Answer: If we forget admin password and want to update this admin password then we have to just do litil bet effort just need to run below query on our sql database SELECT * FROM admin_user; Then, find the username we want to modify in the listing provided ‘pcds’ in this example. Then, to update the password, type UPDATE admin_user SET password=CONCAT(MD5('Pcinfotech'), ':Pc') WHERE username='pcds'; ‘Pc’ would be changed to whatever we want it to be and same goes for ‘infotech’
View detailed answer →
Question 25: What is the latest version of magento?
Question 26: how to change any page title in magento?
Answer: Fire up your IDE and open the Magento project. Now expand the following directory: app/design/frontend/YOUR_PACKAGE/YOUR_THEME. In my case, it is: app/design/frontend/base/default We will change the page template and related layout file to set our custom page title:1. Find and open the head.phtml file from your active theme directory. In my case, thehead.phtml file is located in the /var/www/magento.local.com/public/app/design/frontend/base/default/template/page/html/ directory.2. Look for the following line:<title><?php echo $this->getTitle() ?></title> 3. Now replace the line with the following:<title><?php ech...
View detailed answer →
Question 27: How to add a home link to the menu bar?
Answer: Magento has a strong caching mechanism to serve the pages faster. By default, Magento setsthe caching as enabled. We have to disable the caching feature to view the changes afternecessary modification. At development, the environment will keep the caching disabled. Todisable the caching, go through the following steps:1. Log in at your Magento Admin Panel and point your browser to System | CacheManagement.2. Click on the Select All link to select all rows.3. Select Disable from the Actions dropdown.4. Click on the Submit button to save the changes. 1. Now look for the top.phtml file in app/design/frontend/YOUR_PACKAGE/YOUR_THEME/templa...
View detailed answer →
Question 28: How to add an RSS feed in magento?
Answer: We will use Zend_Feed_Rss library to parse the RSS feed, which came with Magento andZend Framework. Open your favorite PHP IDE and fire up the Magento project. 1. Create a new file named tweets.phtml in the app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/callouts directory. In my case, it's app/design/frontend/base/default/template/callouts.2. Now paste the following code inside it and change the Twitter username and feedURL with your desired one:<?php/*** @var String $twitterUsername* change $twitterUsername with your desired username*/$twitterUsername = 'packtpub';/*** @var String $twitterFeedUrl* change it with your twitter feed. y...
View detailed answer →
Question 29: How to integrate JW Image Rotator 3.17 in megento?
Answer: Grab the latest release of JW Image Rotator from http://www.longtailvideo.com/players/jw-image-rotator/. 1. Extract the downloaded files and copy the imagerotator.swf in the /media/content/flash/ directory.2. Create a new directory named imagerotator in /js directory and paste theextracted swfobject.js file in it.3. Drop some images in media/content/images/ folder for showing in JW ImageRotator, which will be linked in packt.xml file. Create a new XML file named packt.xml in the media/content/flash/ directory and paste the following code:<?xml version="1.0" encoding="utf-8"?><playlist version="1" xmlns="http://xspf.org/ns/0/"><...
View detailed answer →
Question 30: How to create a new page in magento?
Answer: Creating a new page in Magento is pretty easy to do. In this recipe, we are going to create anew page and add it to the footer block by using Magento CMS. Log in to Magento admin panel for creating a Terms of Service page from Magentoadmin area. 1. Enter the Magento admin area and point your browser to CMS | Pages menu.2. Click the Add New Page button from the top-right corner.3. You should see an empty field for newly created page. Fill it up and save the changesyou made.4. Let me tell you what I entered there in the Page Information menu:‰‰ Page Title: Terms of Service‰‰ URL Key: tos‰‰ Store view: All Store Vie...
View detailed answer →
Question 31: How to add Lightbox2 in magento?
Answer: "Lightbox is a simple, unobtrusive script used to overlay images on the current page. It's asnap to setup and works on all modern browsers." Go and grab a copy of Lightbox2 from http://www.lokeshdhakar.com/projects/lightbox2/. 1. We have the Lightbox2 archive that we downloaded fromhttp://www.lokeshdhakar.com/projects/lightbox2/. Let's extract it.2. Open /skin/frontend/YOUR_PACKAGE/YOUR_THEME/js/ and create anew directory named lightbox (in my case, it's /skin/frontend/default/default/js/) and put lightbox.js in this directory.3. Open lightbox.js file in your editor and replace the last line with thefollowing code:var myLightbox;docume...
View detailed answer →
Question 32: How to Add an accepted payment banner at the footer?
Answer: Collect required specific credit card icons, for instance, the icons of a regional bank in yourcountry; make sure to visit the official site of the bank first to get the most recent icons. Theyare usually presented in the sections titled logo center, brand materials, media center, andso on. Credit cards may also look different depending on the country they are supposed to beused in. I have used some typical free credit card icons from http://www.virtuallnk.com/credit-card-icons.aspx. 1. Let's assume that you have already collected the credit card icons that will be shownin the accepted payment banner.2. Fire up your file explorer and p...
View detailed answer →
Question 33: How can we Create a custom "Twitter handle" field in a
registration form?
Answer: Let's fire up our IDE and open the Magento project, where we will write some code for addingthe Twitter handle registration field. 1. Magento uses the Entity-Attribute-Value (EAV) data model for manipulating data ina more flexible way. In an EAV data model, data is usually stored in three columns:‰‰ Entity: This is the item being described‰‰ Attribute or parameter: A foreign key into a table of attribute definitions‰‰ Value: This is the value of the attribute2. We have to add a new EAV attribute for the new Twitter field to save the user'sTwitter field with registration data. We will add it by executing a code sn...
View detailed answer →