Another version of Magento interview question:-
1. what are the different order states in Magento?
Magento has following order states :-
Pending: – Whenever we create place any order in Magento then it is marked in pending status, which means that order has not been processed yet.
Pending PayPal: Those order which did not clear by PayPal has this status.
Processing: Processing means that orders have either been invoiced or shipped, but not both.
Complete: When an order have been invoiced and have shipped then it is marked as complete.
Canceled: If an order is canceled from admin section.
Closed: When an order have had a credit memo assigned to it and the customer has been refunded for their order then it is marked as closed order.
On Hold: Orders placed on hold must be taken off hold before continuing any further actions.
Order states are defined in Mage_Sales_Model_Order:
const STATE_NEW = ‘new’;
const STATE_PENDING_PAYMENT = ‘pending_payment’;
const STATE_PROCESSING = ‘processing’;
const STATE_COMPLETE = ‘complete’;
const STATE_CLOSED = ‘closed’;
const STATE_CANCELED = ‘canceled’;
const STATE_HOLDED = ‘holded’;
const STATE_PAYMENT_REVIEW = ‘payment_review’;
2. what is the difference between order status and order state Magento?
Order state and Order status are usually mixed up because their names and functions are quite similar. An order state is a position of an order in an order processing flow. Each Magento order status can be assigned to more than one order state.
For example, a “Pending Payment” order state can have the following order statuses:
Pending Payment Paypal
Pending Payment Card
Pending Payment Store Credit
and so on…
3. Mention what is the limitation of Magento?
We all know about the advantage of our Magento but let’s go through limitation also:-
Magento runs on PHP, thus it takes up a lot of memory during processes and strong hardware is required to run the software.
Magento is quite complex for admin users and for developers too.
The most important are slowness, every Magento developer has to go through this, a good server configuration and optimized code are needed for using Magento.
4. Explain how Magento can be made more secure for the client?
Below are some points that will make our Magento application more secure:-
– We should use a strong password and should change them at regular interval.
– We should update all Magento security patches.
– We should disable remote access to Magento Connect Manager
– We should disable Downloader on production sites
– We can also restrict access to safe IP addresses
5. Explain how you can move Magento to another Directory OR can move the Magento to the Production environment?
– Firstly, you need to zip your code and dump SQL database.
– Upload and extract zip content and create a database on the server and import the data from SQL dump.
– Edit app/etc/local.xml to change the database name, user, and password to match your new database.
– In your new database, go to the core_config_data table, and change the web/unsecure/base_url and web/secure/base_url to the URL of your development server. Don’t forget a forward slash at the end of the URL.
– Delete cache and session in the var folder on your dev server. Your application should start working now.
6. How do we upgrade Magento version?
Firstly make sure to take a backup of current database and code. And place maintenance.flag file on root so that website is offline.
– Remove all file and folder from old version and replace them with new version except maintenance.flag
– Download latest Magento from the http://www.magentocommerce.com/download
– Now from your older Magento version merge your following custom folders into the new version
your theme or package
custom folders from Skin (both for adminhtml and frontend).
copy your custom XML files from app/etc/modules/ to current app/etc/modules/
any custom admin theme folder from adminhtml/default/yourtheme.
copy your custom folders from adminhtml/default/default/ from old application to adminhtml/default/default/ of new Magento version.
custom js files if any from app/js/.
– Now go to app/etc/local.xml.Edit database details them; put your database username and password and database name.
– Remove maintenance.flag file and check the site in the browser. it is done.
7. How can we change the admin default URL by using some custom name?
You can simply change it in local.xml file. Inside frontname node:-
<admin> <routers> <adminhtml> <args> <frontName><![CDATA[adminnewpath]]></frontName> </args> </adminhtml> </routers>
8. What is the benefit of using namespace (package) in magento?
Magento has several module and they might have same name, thus to differentiate them we have a namespace which we keep unique.
To add external JS use below sample code:-
<reference name="head"> <block type="core/text" name="google.cdn.jquery"> <action method="setText"> <text> script details </text> </action> </block> </reference>
10. What are handles in Magento (layout)?
For every request in Magento, we have a handle which is created as per the controller called. In layout file of theme, we can list our XML code which will be specific to that controller. There are some handles that are called on every page such as default.