Magento Interview Questions – Set 03

Explain ORM in Magento.

ORM stands for Object Relational Mapping. It is a programming technique used to convert different types of data into objects and vice versa.

There are two types of ORM:

  • Converts different types of data into objects.
  • Converts objects to various types of data.

How to enable Maintenance mode in Magento?

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;
}

What is the technology used by Magento?

In Magento, PHP is used as a scripting language while MySQL is used as the database.

How to run custom query in Magento?

To run custom query,

$db = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’);
$result=$db->query(‘SELECT * FROM users where id=4’);

How to fetch 5 bestsellers products programmatically in Magento?

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

What is EAV in Magento?

EAV stands for Entity Attribute Value. It is a technique that facilitates users to add unlimited columns to their table virtually

How can you reset Magento Files and Directory permissions?

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

How to make Magento working with another domain?

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

Explain different modules in Magento.

  • Core modules
  • Commercial modules
  • Community modules

How to convert default currency to others in Magento?

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);