1. Question: Select which method will register observers/hooks to events in Magento:

    A
    Mage::registerObserver(‘<EventNameToHook>’,’MyClass::observerFunction’);

    B
    Using the option in the Magento Admin panel: System > Configuration > Advanced > Developer > Register Observer

    C
    Registering observers using the XML layout of the module: <events> <EVENT_TO_HOOK> <observers> <module> <type>singleton</type> <class>company_module_model_observer</class> <method>methodToCall</method> </module> </observers> </EVENT_TO_HOOK> </events>

    D
    Mage::registerObserver(‘myglobalobserver’); Function myglobalobserver($event,$args){ switch($event){ case ‘event1’: processevent1($args); break; case ‘event2’: processevent2($args); break; } }

    Note: Not available
    1. Report
  2. Question: Magento has the ability to run multiple stores from the same database. After adding the new store from System -> Manage Store, what is the correct code to add to the htaccess file to make Magento automatically load the new store?

    A
    RewriteCond %{HTTP_HOST} ^oldstore.com RewriteRule ^ - [E=MAGE_RUN_CODE:yourOldStoreCode] RewriteRule ^ - [E=MAGE_RUN_TYPE:website]

    B
    RewriteCond %{HTTP_HOST} ^newstore.com RewriteRule ^ - [E=MAGE_RUN_CODE:yourNewStoreCode] RewriteRule ^ - [E=MAGE_RUN_TYPE:website]

    C
    RewriteCond %{HTTP_HOST} ^newstore.com RewriteRule ^ - [E=MAGE_RUN_CODE:yourStoreCode] RewriteRule ^ - [E=MAGE_RUN_TYPE:website]

    D
    RewriteCond %{HTTP_HOST} ^newstore.com RewriteRule ^ - [E=MAGE_RUN_CODE:yourNewStoreCode] RewriteRule ^ - [E=MAGE_RUN_TYPE:website]

    Note: Not available
    1. Report
  3. Question: Which of the following will save a custom session variable in Magento?

    A
    $_SESSION['name'] = 'frontend';

    B
    $session = Mage::getSingleton("core/session", array("name"=>"frontend")); $session->setData("device_id", 4);

    C
    Mage::getSingleton( 'customer/session' )->setValue( 'name', array( 1, 2, 3 ) );

    D
    None

    Note: Not available
    1. Report
  4. Question: Which of the following will get information ('customer_referrer_id') from a currently logged-in admin user?

    A
    $collection->addAttributeToFilter('customer_referrer_id', $referrer_id); $referrer_id = Mage::getSingleton('admin/session')->getUser()->getId();

    B
    $collection->addAttributeToSelection('customer_referrer_id', $referrer_id); $referrer_id = Mage::getSingleton('admin/session')->getUser()->getId();

    C
    $collection->addAttributeToFilter('customer_referrer_id', $referrer_id); $referrer_id = getSingleton('admin/session')->getUser()->getId();

    D
    None

    Note: Not available
    1. Report
  5. Question: Which of the following will display a product's thumbnail?

    A
    $product->hasThumbnail()) $product->setThumbnail($product->getImage());

    B
    <img src="<?php echo $this->helper('catalog/image')->init($_item->getProductThumbnail(), 'image')->resize(50); ?>" alt="<?php echo $_item->getName() ?>" />

    C
    <img src="<?php echo $_item->getProduct()->getThumbnailUrl() ?>" alt="<?php echo $_item->getName() ?>" />

    D
    <img src="<?php echo $this->helper('catalog/image')->init($_item->getProduct(), 'thumbnail')->resize(50); ?>" alt="<?php echo $_item->getName() ?>" />

    Note: Not available
    1. Report
  6. Question: Consider the following code: <block type="A/B" name="root" output="toHtml" template="example/view.phtml"> What is the meaning of A/B?

    A
    "Module's alias" / "Class name relative to the alias"

    B
    "Controller's Alias" / "Class name relative to the alias"

    C
    "Controller's Class" / "Method Name"

    D
    "Method Name" / "Parameter"

    Note: Not available
    1. Report
  7. Question: Which of the following code samples will display a list of both active and inactive sub-categories of the current category?

    A
    <?php $_category = $this->getCurrentCategory(); $collection = Mage::getModel('catalog/category')->getCategories($_category->entity_id); $helper = Mage::helper('catalog/category'); foreach ($collection as $cat): if($_category->getIsActive()): $cur_category = Mage::getModel('catalog/category')->load($cat->getId()); ?> <a href="<?php echo $helper->getCategoryUrl($cat);?>"> <?php echo $cat->getName();?> </a> <?php endif; endforeach; ?>

    B
    <?php $_category = $this->getCurrentCategory(); $collection = Mage::getModel('catalog/category')->getCategories($_category->entity_id); $helper = Mage::helper('catalog/category'); foreach ($collection as $cat): $cur_category = Mage::getModel('catalog/category')->load($cat->getId()); ?> <a href="<?php echo $helper->getCategoryUrl($cat);?>"> <?php echo $cat->getName();?> </a> <?php endforeach; ?>

    C
    <?php $_helper = Mage::helper('catalog/category'); $_categories = $_helper->getStoreCategories(); if (count($_categories) > 0): foreach($_categories as $_category): ?> <a href="<?php echo $_helper->getCategoryUrl($_category) ?>"> <?php echo $_category->getName() ?> </a> <?php endforeach; endif; ?>

    D
    None

    Note: Not available
    1. Report
  8. Question: Which of the following will return a visitor's UserAgent information?

    A
    Mage::helper('core/http')->getHttpUserAgent()

    B
    Mage::helper('core/mage')->getHttpUserAgent()

    C
    Mage::helper('core/mage')->getHttpAgent()

    D
    Mage::helper('core/http')->getHttpUserServer()

    Note: Not available
    1. Report
  9. Question: How can account navigation links be changed?

    A
    Using an XML file to define the template

    B
    Using a third party module

    C
    Either using an XML file to define the template, or using a third party module

    D
    None

    Note: Not available
    1. Report
  10. Question: Which of the following will correctly add a custom event in Magento?

    A
    Mage::registerEvent

    B
    Mage::dispatchEvent

    C
    Mage::addAction

    D
    Mage::registerObserverEvent

    Note: Not available
    1. Report
Copyright © 2025. Powered by Intellect Software Ltd