Magento1 Interview Questions

Q1: What is Magento

Magento is open source Ecommerce CMS which is built in PHP. It is most popular for ecommerce website. It uses multiple other PHP frameworks such as ZEND, Laminas and Symfony.

Magento is also specially designed for online sellers who need a simple e-commerce store. It is free to all so anyone can create their own website. Magento is easy to install, easy to customize, and easy to scale, and this makes it a popular choice for all sorts of companies, from small businesses to huge multinationals.

Magento was acquired by Adobe Inc in May 2018 for $1.68 Billion USD.

Q2: Module’s version information save in which table?

All the module’s version information save into the “core_resource” table. If you want to change the version of the module then the old version replaced by a new version.

Q3: How to create a store in magento1?

Firstly login to the magento admin panel after that click the “System/Manage Stores” tab. Now click the “Create Store” button. Now select the website, write the name of the store and now select the root category after that click the “Save Store” button.
create_store

Q4: How to change theme in magento1?

Change theme in Magento is very simple, firstly login to Magento admin panel, after that go to the System tab, after this click the Design tab and after that click the Add Design Change button and now choose the theme what do you want.

Note:- system/design

Q5: How to check customer is logged in or not in magento1?

If you want to check customer is logged in or not through code so we can use below code.

$check_login=Mage::getSingleton("customer/session")->isLoggedIn();
if(!$check_login){
echo 'Not Logged in';
}else{
echo 'logged in';
}

Q6: How to get static block in phtml file in magento1?

$this->getLayout()->createBlock('cms/block')->setBlockId('static block code')->toHtml(); 

Q7: Difference between register, registry and unregister in magento1?

Magento registry is used to share information anywhere in the Magento store. It works like a Global variable. there are 3 static methods (i) register (ii) registry (iii) unregister of the Mage class.

(i) Mage::register:- It is used to register the value in the registry.

 Mage::register('name', $value);

(ii) Mage::registry:- (ii) It is used to get the value from the registry.

 Mage::registry('name');

(iii) Mage::unregister:- (ii) this method is used to remove it from the registry.

 Mage::unregister('name');

Q8: What is Singleton in Magento1?

It is a design pattern, it is used for memory utilization. When you create an Object then It always checks Object is already created or not if already created then use this, otherwise create a new object.

Q9: Difference between Mage::getSingleton() and Mage::getModel() in magento1?

Mage::getSingleton():- It always check that Object is already created or not if already created then use this, otherwise create new object. It follows the Singleton design pattern.

Mage::getSigleton('ModuleName/ModelName');

Mage::getModel():- It always create new Object. It follow Standard Factory pattern.

Mage::getModel('ModuleName/ModelName');

Q10: What is EAV model in Magento1?

EAV model:- EAV(Entity Attribute Value) is a data model. When we want to add a new field in the table then we do not need to modify the table structure.

Note:- EAV structure for product in magento, 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.

Example:- If we want to add a field name is productinfo then we add into catalog_product_entity_varchar.

Q11: Difference between EAV and Flat model in magento1?

(i) EAV model is very useful when we want to add a field in a table structure, not need to modify the structure. In the Data model, when we add a new field then modify the table structure.

(ii) EAV model is very complex for (select, insert and update query) because we use relation from many tables. The data model is very easy to (select, insert, and update query).

(iii) EAV model is slow and the Data model is fast than the EAV model.

Q12: How many types of product in magento1?

There are five types of product
1) Simple Product
2) Configurable Product
3) Grouped Product
4) Bundled Product
5) Virtual Product

Note:- to get the complete information click on the Link

Q13: How many types of code pool in magento1?

1) core pool
2) community pool
3) local pool

Note:- to get the complete information click on the Link

Q14: How to get customer details in magento1?

  $customerData = Mage::getSingleton('customer/session')->getCustomer();
  print_r($customerData);

Q15: customer attribute save in which tables in magento1?

custom customer attribute save in tables
(1) eav_attribute
(2) customer_eav_attribute
(3) If we use checkout_register form then we use sales_flat_quote table
(4) value of attribute save in tables like
customer_entity_datetime, customer_entity_decimal, customer_entity_int, customer_entity_text, customer_entity_varchar
Note:- attributes value save in a table according to datatype
ex:- if we create attribute data type varchar then save in the customer_entity_varchar and if we create attribute data type int then save in the customer_entity_int so on.

Q16: Customer’s address attribute save in which tables in magento1?

custom customer address attribute save in tables
(1) eav_attribute
(2) customer_eav_attribute
(3) value of attribute save in tables like
customer_address_entity_datetime, customer_address_entity_decimal, customer_address_entity_int, customer_address_entity_text, customer_address_entity_varchar
Note:- attributes value save in a table according to datatype
ex:- if we create attribute data type varchar then save in the customer_address_entity_varchar and if we create attribute data type int then save in the customer_address_entity_int so on.