Magento Interview Questions & Answers

1. Explain Registry pattern in Magento?
Ans:

Registry pattern is basically a pattern that allows any object or data to be available in a public global scope for any resource to use.

In Magento, you can register an object or data with Mage::register function,

Mage::register(‘identifier’, $object_or_data);
After it is registered, you can call it with Mage::registry by passing identifier name:

Mage::registry(‘identifier’);
You can also unregister an object at any time with Mage::unregister

Mage::unregister(‘identifier’);
This is especially helpful transferring data between Models and Blocks without having to instantiate an entire class and load data.

2. What are the unique advantages of Magento MVC architecture when building a site?
Ans:

Magento follows PHP MVC (Model-View-Controller) application architecture.
Model View Controller design Pattern is used to keep the code modular and clean to assist in programming (keep things separate).

It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user.

The central component, the model, consists of application data, business rules, logic and functions.A view can be any output representation of information, such as a chart or a diagram

Multiple views of the same information are possible, such as a bar chart for management and a tabular view for accountants.

The third part, the controller, accepts input and converts it to commands for the model or view.

3. List product types exist in Magento?
Ans:

In Magento 6 standard product types exists, they are

Configurable
Simple
Grouped
Bundle
Virtual
Downloadable
4. What are the different versions of Magento?
Ans:

Four different versions of Magento are available, they are

Magento Enterprise Edition
Magento Community Edition
Magento Professional Edition
Magento .go Edition
Also, Read WordPress Interview Questions -2018

5. In Magento which product types implement a parent-child relationship between product entities?
Ans:

Configurable, bundle and grouped products implement a parent-child relationship between product entities in Magento.

6. Explain Magento’s Compilation feature?
Ans:

The Compilation feature of Magento will allow you to compile all files of a Magento installation in order to create a single include path to increase performance. The performance increase is between 25% – 50% on page loads. In order to use this tool, the directory ‘includes’ and the file includes/config.php must both be writable.

7. What is the difference between “pay” and “capture” operations in Magento?
Ans:

Pay: This basically sets the invoice state is ‘paid’, this works for both when payment is online or offline.

Capture: This is when actual payment processing happens online, and the capture() method in our payment method is called. After capture, pay() is called.

8. What scripting language and database management system does Magento use?
Ans:

Magento uses PHP as a scripting language and MySQL for the database. Database: MySQL 5.6 (Oracle or Percona). PHP version: PHP 5.4, PHP 5.5 or above.

9. What is Magento?
Ans:

Magento is free open source e-commerce software written PHP language, that allows merchants to create online e-commerce stores.

10. What is the difference between Omni Channel and multichannel retailing?
Ans:

MultiChannel retailing

MultiChannel means providing different platform like web, mobile, etc. to facilitate the sale of products/item

Omni Channel Retailing

Omni-Channel is a step above MultiChannel. Omni-Channel dictates that we should provide same brand experience irrespective of channel/medium customer choose

11. What are the differences between EAV and Flat model?
Ans:

EAV is an entity attribute value database model, where data is fully in normalized form. Each column data value is stored in their respective data type table. Example, for a product, product ID is stored in catalog_product_entity_int table, product name in catalog_product_entity_varchar, product price in catalog_product_entity_decimal, product created date in catalog_product_entity_datetime and product description in catalog_product_entity_text table. EAV is complex as it joins 5-6 tables even if you want to get just one product’s details. Columns are called attributes in EAV.

The flat model uses just one table, so it’s not normalized and uses more database space. It clears the EAV overhead, but not good for dynamic requirements where you may have to add more columns in database table in future. It’s good when comes to performance, as it will only require one query to load whole product instead of joining 5-6 tables to get just one product’s details. Columns are called fields in flat model.

12) How to make Magento working with another domain?
Ans:

To let the Magento working with another domain, URL option of Magento base can be changed.

Follow these steps:

select Magento admin -? System ? configuration and then click Web.
Choose unsecure option
Replace the base URL filed

13) How will you get first and last item from the collection in Magento?
Ans:

$collection->getFirstItem() and $collection->getLastItem();

14) Explain the use of namespace in Magento?
Ans:

Magento core modules are placed in mage namespace, core/Mage/Catalog and all custom modules are placed in local/CustomModule.

You can have more than one module with same name but they need to be placed in different namespaces.

15) Explain handles in Magento?
Ans:

Handles control the structure of the page to be displayed. It decides which block will be placed where in the page. Handle is called for every page and every page request can have several unique handles.

16) Explain compilation feature in Magento?
Ans:

Compilation feature allows us to compile all Magento files to create a single include path to increase performance.

17) How to enable Maintenance mode in Magento?
Ans:

Create a file named as maintenance.flag and upload it to Magento home directory containing following code.

$maintenanceFile = ‘maintenance.flag’;

if (file_exists($maintenanceFile)) {
include_once dirname(__FILE__) . ‘/errors/503.php’;
exit;
}

18) How to convert default currency to others in Magento?
Ans:

To convert default currency to others, select the currency and import currency rates from System-> Manage currency-> Rates.

Syntax:

$convertedPrice = Mage::helper(‘directory’)->currencyConvert($price, currentCurrency, newCurrency);

19) Explain Google checkout in Magento.
Ans:

Magento allows the integration of online stores with Google checkout. Google checkout is the online payments service provided by the Google. It works like PayPal.

20) Explain how to change Magento core API setting?
Ans:

You have to follow these steps to change Magento core API setting.

Go to Admin menu, choose System -> Configuration
Select Magento Core API on the left side of the Configuration Panel, under Services
Click on to expand the General Settings section
Type name of the Default Response Charset that you want to use
Determine the Client Session Timeout in seconds
Click the Save Config button when completed

21) Can all billing information be managed through Magento?
Ans:

You can do the following things through client Magento account:

You can update your billing address.
You can add a credit card.
You can view your billing history.
You can add a PayPal account.
You can produce a print ready receipt.

22) What are the advantages of applying Connect Patches in Magento?
Ans:

In Magento, applying Connect Patches provides following features:

Enable easy installation of packages with installation and overwrite any existing translations for the same time
Enhance security, by default Magento Connect uses HTTP to download extensions instead of FTP
Facilitate the extension developers to create new extensions with a dash character in the name
Magento administrators will be informed now who tries to install an extension with insufficient file system privileges.

23) How to fetch 5 bestsellers products programmatically in Magento?
Ans:

Mage::getResourceModel(‘reports/product_collection’)
->addOrderedQty()
->addAttributeToSelect(‘*’)
->setPage(1, 5)
->load();

24) How many types of sessions are there? Why we use different sessions in Magento?
Ans:

There are namely three sessions in Magento:

customer session
checkout session
core session
All these sessions are stored in one session only. We use different sessions because sometimes we need to clear only a particular session data and not all session data.

25) How can you reset Magento Files and Directory permissions?
Ans:

Change the directory to the directory where Magento is installed and execute the following commands.

1.

find. -type d -exec chmod 755
2.

chmod+x magento

For more  Click Here


For Course Content  Click Here