Certificated magento

1.1) Describe Magento codepools

1.1) Describe Magento codepools

    Describe Magento Codepools Magento has three different codepools: Community Core Local Core pool First of all, this folder stores all the code that makes Magento so powerful, flexible and lovely. The chief rule of Magento development is that you should never make any changes in it....

Read more

1.2) Describe typical Magento module structure

1.2) Describe typical Magento module structure

  MVC architecture. Let’s review all parts of module structure step by step.   Block This folder liability is View, if we use terms of classical MVC architecture. Blocks coordinate models with the template files. The files in the folder load the data from database and transfer it to the templates...

Read more

1.3) Describe Magento templates and layout files location

1.3) Describe Magento templates and layout files location

Layout files are separated on a per-module basis, every module bringing with it its own layout file (for instance 'catalog.xml' is a layout file for the catalog module, 'customer.xml' is for the customer module...etc). These layout files are located in app/design/frontend/your_interface/your_theme/layout/ and each file...

Read more

1.4) Describe Magento skin and javascript files location

1.4) Describe Magento skin and javascript files location

Skin folder includes Javascript, CSS and image files that are used in .phtml files in template folder, i.e. all the files in this folder vary from theme to theme. From the given picture you can see that there are three main folders – CSS for style-sheets of your theme, images (for media files that are used in your...

Read more

1.5) Identify and explain the main Magento design areas (adminhtml and frontend)

1.5) Identify and explain the main Magento design areas (adminhtml and frontend)

      All frontend files are stored in three main Magento design areas.     install Files from this area will be displayed during the installation process.   admintml Everything that you will observe while working in the admin panel can be found here. In other words, if module...

Read more

1.6) Explain class naming conventions and their relationship with the autoloader

1.6) Explain class naming conventions and their relationship with the autoloader

Magento was developed based on the Zend Framework, so the rules of class naming in Magento were taken from the Zend Framework (read more here).   Magento standardizes class names depending on their location in the file system. Such standardization enables automatic class loading (autoloader) instead of using require_once...

Read more

1.7) Describe methods for resolving module conflicts

1.7) Describe methods for resolving module conflicts

 First we should determine what type of conflict we are dealing with and then figure out the appropriate solutions.   There are 3 levels of modules compatibility conflicts:   1) Conflicts in configuration files 2) Conflicts with the software part 3) Conflicts in a module display     Conflicts...

Read more

Q.1.1) How does the framework interact with the various codepools?

Q.1.1) How does the framework interact with the various codepools?

Magento firstly it includes Local code pool, than community and after that core, which allow developers to override classes without changing core files.   Magento has three different codepools: Community, Core, Local.   Core pool First of all, this folder stores all the code that makes Magento so powerful,...

Read more

Q.1.2) What constitutes a namespace and a module?

Q.1.2) What constitutes a namespace and a module?

It's worth noting that Namespace should always begin with an uppercase letter - because of the Magento autoloader.

Read more

Q.1.3) What does the structure of a complete theme look like?

Q.1.3) What does the structure of a complete theme look like?

In this article, we are going to walk through magento theme structure and see its folder and files structure. Magento theme is build based on layout blocks defined in xml files which calls related html output files based on controller action.   Every theme must be defined under package folder. By default magento...

Read more

1.8) Explain how Magento loads and manipulates configuration information

1.8) Explain how Magento loads and manipulates configuration information

by Pavel Novitsky http://blog.belvg.com/magento-certified-developer-exam-explaining-how-magento-loads-and-manipulates-configuration-information-part2.html - be sure to check out comments on this page too!   Basically, Magento configuration is spread among dozens of .xml files. So this is a reasonable question –...

Read more

1.9) Describe class group configuration and use in factory methods

1.9) Describe class group configuration and use in factory methods

Let’s have a look at the proccess of class instantiating by the example of models and try to instantiate the product object. This can be done by using getModel() method:   $product = Mage::getModel(‘catalog/product’);     This method retrieves an instance of Mage_Catalog_Model_Product...

Read more

1.10) Describe the process and configuration of class overrides in Magento

1.10) Describe the process and configuration of class overrides in Magento

 In the previous post we have described the following factory methods, used in Magento.   •    for blocks        Mage_Core_Model_Layout :: createBlock(...) •    for models        Mage :: getModel(...) and getResourceModel(...) •  ...

Read more

1.11) Identify the function and proper use of automatically available events, including *_load_after, etc.

1.11) Identify the function and proper use of automatically available events, including *_load_after, etc.

Its the _afterLoad Method which is defined in Mage_Core_Model_Abstract. First it dispatches the 'model_load_after' Event, then the $this->_eventPrefix.\'_load_before\'.

Read more

1.12) Set up a cron job

1.12) Set up a cron job

Let’s start with server setup.   As any complex system, Magento has a lot of tasks that need to be executed periodically. Here are some of these processes: catalog price rules, sending newsletters, generating Google Sitemaps, customer alerts/notifications (product price change, product back to stock), automatic...

Read more

Q.1.4) How does the framework discover active modules and their configuration?

Q.1.4) How does the framework discover active modules and their configuration?

Class: Mage_Core_Model_Config Method: _loadDeclaredModules()

Read more

Q.1.5) What are the common methods with which the framework accesses its configuration values and areas?

Q.1.5) What are the common methods with which the framework accesses its configuration values and areas?

Mage::getStoreConfig('sectionName/groupName/fieldName');. Ex : Mage::getStoreConfig('larry_module/module_options/host');

Read more

Q.1.6) How are per-store configuration values established in the XML DOM?

Q.1.6) How are per-store configuration values established in the XML DOM?

Defined in config.xml <stores> - module <store_code> - node

Read more

Q.1.10) What configuration parameters are available for event observers?

Q.1.10) What configuration parameters are available for event observers?

 type (model, object, none, singleton), class (class name of observer), method (method to invoke)

Read more

Q.1.11) What are the interface and configuration options for automatically fired events?

Q.1.11) What are the interface and configuration options for automatically fired events?

 <event>   <observer>     <class>       <method>?????   This seems to be talking about Observer set up?? TODO...

Read more

Q.1.1.12) What is the structure of event observers, and how are properties accessed therein?

Q.1.1.12) What is the structure of event observers, and how are properties  accessed therein?

For checkout/cart after adding product, Mage::dispatchEvent(’checkout_cart_product_add_after’, array(’quote_item’=>$result, ‘product’=>$product));   to call,   $observer->getEvent()->getQuoteItem() and $observer->getEvent()->getProduct()

Read more

Q.1.13) What configuration parameters are available for cron jobs?

Q.1.13) What configuration parameters are available for cron jobs?

<config>     <crontab>         <jobs>             <cronjob_code>                 <schedule><cron_expr>*/15 * * * *</cron_expr></schedule>          ...

Read more

1.13) Describe how to plan for internationalization of a Magento site

1.13) Describe how to plan for internationalization of a Magento site

 Magento can manage multiple stores in a single installation. There are three layers in this hierarchy – websites, stores and store views.   The top level is Website. It’s made up of one or multiple stores. They in turn are made up of one or multiple store views. Stores have the same customers, orders...

Read more

1.14) Describe the use of Magento translate classes and translate files

1.14) Describe the use of Magento translate classes and translate files

The translation function is Mage::helper(‘core’)->__() This function call to the object Mage::getSingleton(‘core/translate’); The process to conduct in this class: - The corresponding CSV file will be loaded (in which locale the store is and which module the store is being called). - String...

Read more

1.15) Describe the advantages and disadvantages of using subdomains and subdirectories in internationalization

1.15) Describe the advantages and disadvantages of using subdomains and subdirectories in internationalization

1) Subfolders (yourstore.com/uk, yourstore.com/ru)   Advantages   Separate folders can be still targeted. Easier linking process. All SEO efforts and advertisements will affect all subfolders the website will even count towards the power of the subdirectories. Easy to manage.   Disadvantages   SERP...

Read more

Q.1.14) Which method is used for translating strings, and on which types of objects is it generally available?

Q.1.14) Which method is used for translating strings, and on which types of  objects is it generally available?

Everywhere in Magento templates (.phtml files) you can see something similar to this one $this->__(‘some string’). Actually it’s Mage::helper(‘core’)->__()   Let’s see how it looks like.   app/code/core/Mage/Core/Helper/Abstract.php   /**      *...

Read more

Q.1.15) In what way does the developer mode influence how Magento handles translations?

Q.1.15) In what way does the developer mode influence how Magento handles  translations?

Let’s see how Magento initializes translation.   app/code/core/Mage/Core/Model/Translate.php   /**      * Initialization translation data      *      * @param   string $area      * @return  Mage_Core_Model_Translate    ...

Read more

Q.1.16) How many options exist to add a custom translation for any given string?

Q.1.16) How many options exist to add a custom translation for any given  string?

 As mentioned above, there are three options in Magento to add a custom translation to a text string: module translation, theme translation and inline translation.   1. Module translation   Module translations are stored in app/locale/languagecode_COUNTRYCODE/ folder in form of csv files, named as Namespace_Modulename.csv...

Read more

Q.1.17) What is the priority of translation options?

Q.1.17) What is the priority of translation options?

 As we saw in intit() method from   //Loading data from module translation files         foreach ($this->getModulesConfig() as $moduleName=>$info) {             $info = $info->asArray();             $this->_loadModuleTranslation($moduleName,...

Read more

Q.1.18)How are translation conflicts (when two modules translate the same string) processed by Magento?

Q.1.18)How are translation conflicts (when two modules translate the same  string) processed by Magento?

What to check if your translation isn't working   If your translation from a translate.csv file isn't being used, follow this checklist:   Is the translation cache turned off/refreshed? (Solution: clear the cache) Is the translate.csv file really in the theme fallback for the current store? (Solution: fix...

Read more

2.1) Describe the steps for application initialization

2.1) Describe the steps for application initialization

 We have finished Magento Basics with 9 articles which guide you about fundamentals, configuration XML, and multi-language… in Magento. Today, I will start the next step of Magento Certificate Preparation. You will be introduced the first topic – Application initialization consisting of two parts:   Describe...

Read more

Q.2.1) How and when is the include path set up and the auto loader registered?

Q.2.1) How and when is the include path set up and the auto loader registered?

The include path is set soon after the /app/Mage.php file is called from the /index.php file. The autoloader is registered soon after:    // app/Mage.php define('DS', DIRECTORY_SEPARATOR); define('PS', PATH_SEPARATOR); define('BP', dirname(dirname(__FILE__)));   Mage::register('original_include_path',...

Read more

Q.2.2) How and when does Magento load the base configuration, the module configuration, and the database configuration?

Q.2.2) How and when does Magento load the base configuration, the module configuration, and the database configuration?

 Magento loads the base configuration, the module configuration and the database configuration in Mage_Core_Model_Config->init()   The order of loading is: Base configuration (all *.xml files from /app/etc/ directory) Module configuration (active modules merged with local.xml file at the end to prevent...

Read more

Q.2.3) How and when are the two main types of setup script executed?

Q.2.3) How and when are the two main types of setup script executed?

In Mage_Core_Model_Resource_Setup we find these two functions: applyAllUpdates applyAllDataUpdates     applyAllUpdates applyAllUpdates calls applyUpdates which depending on 'version_compare' check calls _rollbackResourceDb, _upgradeResourceDb or _installResourceDb. This method is responsible for running...

Read more

Q.2.4) When does Magento decide which store view to use, and when is the current locale set?

Q.2.4) When does Magento decide which store view to use, and when is the current locale set?

 Both store and locale are set in the Mage_Core_Model_App->run() function. Locale are set first since in baseInit() method (which sets locale) is called before _initCurrentStore(). Locale:   index.php Mage::run() /app/Mage.php calls Mage_Core_Model_App->run() Mage_Core_Model_App->run() calls Mage_Core_Model_App->baseInit() Mage_Core_Model_App->baseInit()...

Read more

Q.2.5) Which ways exist in Magento to specify the current store view?

Q.2.5) Which ways exist in Magento to specify the current store view?

 // Gets the current store's details $store = Mage::app()->getStore();   // Gets the current store's id $storeId = Mage::app()->getStore()->getStoreId();   // Gets the current store's code $storeCode = Mage::app()->getStore()->getCode();   // Gets the current website's id $websiteId...

Read more

Q.2.6) When are the request and response objects initialized?

Q.2.6) When are the request and response objects initialized?

 The request and response objects are initialized early in the bootstrap, in the Mage_Core_Model_App->run() method.   index.php calls Mage::run() Mage::run() (/app/Mage.php) calls Mage_Core_Model_App->run() Mage_Core_Model_App->run() initializes the request and response objects.   Mage::run()  ...

Read more

2.4) Describe the role of the front controller

2.4) Describe the role of the front controller

 Magento uses the Front Controller pattern for the following purposes: Receiving and processing browser data, transferring it to other system elements; Defining controller and proper action to perform using routes; Displaying browser-requested data using blocks, templates and model data.   Front...

Read more

2.5) Identify uses for events fired in the front controller

2.5) Identify uses for events fired in the front controller

You can see them in  $this->getFrontController()->dispatch(); of Mage_Core_Model_App->run(); There are 4: 1) For getFrontController() - Mage_Core_Controller_Varien_Front->init()  controller_front_init_before - the first event triggered and can be used for any sort or redirects, logging or benchmarking controller_front_init_routers...

Read more

Q.2.7) Which ways exist in Magento to add router classes?

Q.2.7) Which ways exist in Magento to add router classes?

  1. <config> <default> … <web> <routers> <!– declare default routers–> <your_custom_router> <area>frontend</area> <class>Yournamespace_Yourmodule_Controller_Router</class> </your_custom_router> </routers> … </web> … </default> … </config>   Then...

Read more

Q.2.8) What are the differences between the various ways to add routers?

Q.2.8) What are the differences between the various ways to add routers?

Take a look at :   http://goweb.vn/kien-thuc-web-vi/thiet-ke-web/q27-which-ways-exist-in-magento-to-add-router-classes-749.html

Read more

Q.2.9) Think of possible uses for each of the events fired in the front controller

Q.2.9) Think of possible uses for each of the events fired in the front controller

Of course, it's possible. We can use controller_front_init_routers

Read more

2.6) Describe URL structure/processing in Magento

2.6) Describe URL structure/processing in Magento

 -URL structure in Magento A link in Magento has format as below:   https://user:password@host:443/base_path/[base_script][storeview_path]route_name/controller_name/action_name/param1/value1?query_param=query_value#fragment    •User:password@host:443/base_path/[base_script]:   the path...

Read more

2.7) Describe the URL rewrite process

2.7) Describe the URL rewrite process

 - The URL rewrite process takes place in 3 moments: •Core URL rewrite: from the request path, the system will find target_path in CSDL  and rewrite the request path.     •Module configure URL rewrite: is the controller rewrite in the system. From the  configuration, the system...

Read more

Q.2.11) When does Magento created the rewrite records for categories and products?

Q.2.11) When does Magento created the rewrite records for categories and  products?

 When create or update a category or product and reindex.

Read more