What is Your Name Meaning ? Click here

Upwork Magento Elance Test Answers



This blog contain all magento upwork(oDesk) Elance test answers. All answers is correct and taken from upwork.com. On this blog have 82 Magento Elance test answers list. All Answers is perfect , Magento elance test answers detail below..

* Upwork Magento Test Answer N0 1.

Question:

Which of the following will get the tax amount on a page in Magento?

Answers:

Mage::helper('checkout')->getQuote()->getShippingAddress()->getData('tax_amount');

* Upwork Magento Test Answer N0 2.

Question:

Which of the following will get information ('customer_referrer_id') from a currently logged-in admin user?

Answers:

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

* Upwork Magento Test Answer N0 3.

Question:

The "Suspected Fraud" Order status is grouped under which state?

Answers:

Payment Processing state

* Upwork Magento Test Answer N0 4.

Question:

Which of the following code samples will display a list of both active and inactive sub-categories of the current category?

Answers:

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

* Upwork Magento Test Answer N0 5.

Question:

Which of the following is the minimum memory requirement for running a Magento site?

Answers:

at least 256MB

* Upwork Magento Test Answer N0 6.

Question:

When does the following error occur? "Not all products are available in the requested quantity"

Answers:

When the products are out of stock, but the cart still proceeded to checkout

* Upwork Magento Test Answer N0 7.

Question:

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

Answers:

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

* Upwork Magento Test Answer N0 8.

Question:

Which of the following code samples will detect if the account being checked on the front-end is an admin account?

Answers:

• <?php require_once 'app/Mage.php'; ini_set('display_errors',true); Mage::setIsDeveloperMode(true); umask(0) ; Mage::app(); //get the admin session Mage::getSingleton('core/session', array('name'=>'adminhtml')); //verify if the user is logged in to the backend if(Mage::getSingleton('admin/session')->isLoggedIn()){ echo "Admin Logged in with following details".'<br>'; echo "Admin Username: - ".Mage::getSingleton('admin/session')->getData('user')->getUsername().'<br>'; echo "Admin Encrypted Password: - ".Mage::getSingleton('admin/session')->getData('user')->getPassword().'<br>'; } else { echo "You need to be logged in as an admin."; } ?>

* Upwork Magento Test Answer N0 9.

Question:

Why does the error, "front controller reached 100 router match iterations", occur?

Answers:

Router references were set incorrectly

* Upwork Magento Test Answer N0 10.

Question:

Which of the following will display only 'configurable' products in a page?

Answers:

$collectionConfigurable = Mage::getResourceModel('catalog/product_collection') ->addAttributeToFilter('type_id', array('eq' => 'configurable'));

* Upwork Magento Test Answer N0 11.

Question:

Which of the following will add an external JavaScript file to a Magento page?

Answers:

<reference name=”head”> <action method=”addJs”><script>folder/file.js</script></action> </reference>

* Upwork Magento Test Answer N0 12.

Question:

Select which conditions can be checked to track down a product that is not showing in a category page.

Answers:

Product must be enabled;

* Upwork Magento Test Answer N0 13.

Question:

Which of the following attributes are the data member of magento Mage_Newsletter_Model_Subscriber Class?

Answers:

• STATUS_SUBSCRIBED • STATUS_NOT_ACTIVE • STATUS_UNSUBSCRIBED • All the above

* Upwork Magento Test Answer N0 14.

Question:

Assuming a left column is going to be added, which of the following are possible values of the block type in the code below? <block type="" name="left" as="left" template="page/html/left.phtml" />

Answers:

page/html

* Upwork Magento Test Answer N0 15.

Question:

Which of the following will return the absolute path for a product image in Magento?

Answers:

A) echo $_product->getImageUrl();

* Upwork Magento Test Answer N0 16.

Question:

Which of the following code samples will display products from a certain category in random order?

Answers:

$products = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSort() ->addAttributeToSelect('*'') ->addCategoryFilter(Mage::getModel('catalog/category')->load()); $products->getSelect()->order(new Zend_Db_Expr('RAND()'));

* Upwork Magento Test Answer N0 17.

Question:

Which of the following will add a static block on the site's home page in Magento?

Answers:

<cms_index_index> <reference name="content"> <block type="cms/block" name="home-page-block"> <action method="setBlockId"><block_id>home-page-block</block_id></action> </block> </reference> <cms_index_index>

* Upwork Magento Test Answer N0 18.

Question:

Which of the following will not increase the performance of a Magento site?

Answers:

Disabling the cache in the admin panel

* Upwork Magento Test Answer N0 19.

Question:

Which of the following statements are correct about Magento quotes?

Answers:

Quotes are offers to the user, which if the user accepts get converted into orders

* Upwork Magento Test Answer N0 20.

Question:

Which of the following will set a template only if a particular module is disabled in Magento?

Answers:

<action method="setTemplate" ifconfig="advanced/modules_disable_output/Myname_Mymodule"> <template>mytemplate.phtml</template> </action>

* Upwork Magento Test Answer N0 21.

Question:

What is the correct method to add an external JavaScript file to Magento's local.xml file?

Answers:

<action method="addJS"><script>jquery/jquery.js</script></action>

* Upwork Magento Test Answer N0 22.

Question:

Which of the following will change the order of existing blocks via XML?

Answers:

<reference name="parent.block.name"> <action method="unsetChild"><alias>child_block_alias</alias></action> <action method="insert"><blockName>child.block.name</blockName><siblingName>name_of_block</siblingName><after>1</after><alias>child_block_alias</alias></action> </reference>

* Upwork Magento Test Answer N0 23.

Question:

Which of the following needs to be edited to input and display the order attributes in Magento?

Answers:

Both /app/design/adminhtml/default/default/template/sales/order/view/info.phtml and /app/code/local/CWACI/SalesExt/controllers/Adminhtml/Sales/OrderController.php

* Upwork Magento Test Answer N0 24.

Question:

Which of the following statements are correct to store Contact form data in database of magento? A. By default Magento store the Contact form data in database B. Need to create a custom module which store data in database by override the core contacts module

Answers:

Statement B is true and Statement A is false

* Upwork Magento Test Answer N0 25.

Question:

Is it possible to trigger an event after an order has been set to "processing"?

Answers:

Yes, by using a custom module.

* Upwork Magento Test Answer N0 26.

Question:

Which of the following methods can be used add a new attribute to all products?

Answers:

Via the Magento Admin panel (Manage Attributes)

* Upwork Magento Test Answer N0 27.

Question:

Which of the followings magento features are related to CRM?

Answers:

• Newsletters • Contact and Transactional Emails • Poll • All of above

* Upwork Magento Test Answer N0 28.

Question:

Which of the following is the correct method to use to check if custom options were added to a product?

Answers:

$product->hasOptions();

* Upwork Magento Test Answer N0 29.

Question:

Which of the following statements are true regarding passing data between a controller and a block in Magento?

Answers:

It can not be done by using Magento's MVC approach, but it can be done by emulating traditional PHP MVC behaviors

* Upwork Magento Test Answer N0 30.

Question:

How can a new column be added in sales_flat_order to save a custom value in Magento?

Answers:

By defining column name in Block and table

* Upwork Magento Test Answer N0 31.

Question:

When using a custom Magento logo as the default logo for transactional emails; which of the following is the correct way for the logo to be maintained even after Magento system upgrades?

Answers:

Create a new theme and place the new logo, named as "logo_email.png", in the skin directory.

* Upwork Magento Test Answer N0 32.

Question:

Which of the following will save a custom session variable in Magento?

Answers:

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

* Upwork Magento Test Answer N0 33.

Question:

Which of the following will get the order increment ID in Magento?

Answers:

$order = Mage::getSingleton('sales/order')->getLastOrderId(); $lastOrderId = $order->getIncrementId();

* Upwork Magento Test Answer N0 34.

Question:

How can account navigation links be changed?

Answers:

Using an XML file to define the template

* Upwork Magento Test Answer N0 35.

Question:

Assuming that product images need to be imported from a product import file, which folder should the images be uploaded to, before running the import profile routine?

Answers:

<MAGENTOROOT>/media/import/

* Upwork Magento Test Answer N0 36.

Question:

Which of the following will correctly add a custom event in Magento?

Answers:

Mage::dispatchEvent

* Upwork Magento Test Answer N0 37.

Question:

Which of the following statements are true regarding custom options for products in Magento?

Answers:

If the values for custom options are modified, they would need to be saved, and that will set them for all users.

* Upwork Magento Test Answer N0 38.

Question:

What is the correct method for calling a single product inside a static block?

Answers:

{{block type="catalog/product_single" product_id="1" template="catalog/product/singleproduct.phtml"}}

* Upwork Magento Test Answer N0 39.

Question:

Which of the following methods will allow access to a Magento session from other sites on different subdomains?

Answers:

subdomain.domain.com needs to be entered in Magento's Admin->System->Configuration->Web->Cookie Domain, to make session cookies available to other subdomains.

* Upwork Magento Test Answer N0 40.

Question:

Which of the following will get a specific product attribute from its product ID without loading the whole product?

Answers:

Mage::getResourceModel('catalog/product')->getAttributeRawValue($productId, 'attribute_code', $storeId);

* Upwork Magento Test Answer N0 41.

Question:

Which of the following XML files will remove an item from Magento's admin panel navigation?

Answers:

<?xml version="1.0" ?> <config> <menu> <xmlconnect> <disabled>1</disabled> </xmlconnect> </menu> </config>

* Upwork Magento Test Answer N0 42.

Question:

By default, Magento allows 3 themes to be loaded at any time. In what order are they loaded? (1 being first and 3 being last)

Answers:

1 Custom non-default theme 2 Custom default theme 3 Magento base theme

* Upwork Magento Test Answer N0 43.

Question:

For data security and privacy reasons, Magento uses two cookies for frontend session. All I know is that one of them is being set in Mage_Core_Model_Cookie::set(..) and the other one in Zend_Session::expireSessionCookie(). Why does Magento use the Zend_Session::expireSessionCookie()?

Answers:

It is the vestigial code, so I was able to delete the Zend cookie without any apparent deleterious effects

* Upwork Magento Test Answer N0 44.

Question:

How can the checkout process be skipped for downloadable products in Magento?

Answers:

The checkout step cannot be skipped in Magento.

* Upwork Magento Test Answer N0 45.

Question:

The browser is ignoring the file referred on the code below: <link src="http://siteurl.com/theme/skin/frontend/default/mytheme/css/colors.css.php" rel="stylesheet" type="text/css"> Assume that this is a PHP file that is used as a stylesheet in a Magento extension. Which of the following choices will make the browser apply the stylesheet?

Answers:

Call a static CSS file instead of using a PHP file as a stylesheet.

* Upwork Magento Test Answer N0 46.

Question:

Assuming that trees must have categories as parents and products as children, and that there are no sub-categories under main categories, which of the following code samples will get the full catalog tree?

Answers:

$categories = Mage::getModel('catalog/category') ->getCollection(); foreach ($categories as $category) { print $category->getName(); $products = Mage::getModel('catalog/category') ->load($category->getId()) ->getProductCollection(); foreach($products as $product){ Print $product->getName(); } }

* Upwork Magento Test Answer N0 47.

Question:

Which of the following code samples will link a configurable product's images to its constituent simple products, in the product details page?

Answers:

$_parentIdArray = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($_product->getId()); if(sizeof($_parentIdArray)==1 && Mage::getModel('catalog/product')->load($_parentIdArray[0])->getTypeId() == 'configurable'){ $_product = Mage::getModel('catalog/product')->load($_parentIdArray[0]); }

* Upwork Magento Test Answer N0 48.

Question:

Which of the following will correctly display the current theme name in Magento?

Answers:

Mage::getSingleton('core/design_package')->getTheme('frontend');

* Upwork Magento Test Answer N0 49.

Question:

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

Answers:

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>

* Upwork Magento Test Answer N0 50.

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?

Answers:

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

* Upwork Magento Test Answer N0 51.

Question:

What is the difference between "Flush Magento Cache" and "Flush Cache Storage" in the Magento Cache Management System?

Answers:

"Flush Magento Cache" removes "/tmp/" folder's cache only, while "Flush Cache Storage" clears everything

* Upwork Magento Test Answer N0 52.

Question:

When migrating a Magento store to a new server, after moving the files and the database, where must the database access details be configured for the new server?

Answers:

app/etc/local.xml

* Upwork Magento Test Answer N0 53.

Question:

Assuming that a column needs to be added under Catalog >> Manage Products in Magento, which file will need to be edited?

Answers:

app/code/local/Myname/Catalogextended/Block/Adminhtml/Catalog/Product/Grid.php

* Upwork Magento Test Answer N0 54.

Question:

Which of the following will get a list of products belonging to a specific category within a view file?

Answers:

$productCollection = Mage::getResourceModel('catalog/product_collection') ->addCategoryFilter($category);

* Upwork Magento Test Answer N0 55.

Question:

What is the best way to create global variables which can be used everywhere in Magento?

Answers:

Via a Magento Session $myValue = 'Hello World'; Mage::getSingleton('core/session')->setMyValue($myValue);

* Upwork Magento Test Answer N0 56.

Question:

Which of the following will retrieve a list of all shipping methods in Magento?

Answers:

public function toOptionArray($isMultiSelect = false) { $methods = Mage::getSingleton('shipping/config')->getActiveCarriers(); $options = array(); foreach($methods as $_code => $_method) { if(!$_title = Mage::getStoreConfig("carriers/$_code/title")) $_title = $_code; $options[] = array('value' => $_code, 'label' => $_title . " ($_code)"); } if($isMultiSelect) { array_unshift($options, array('value'=>'', 'label'=> Mage::helper('adminhtml')->__('--Please Select--'))); } return $options; }

* Upwork Magento Test Answer N0 57.

Question:

Which of the following will list all products from a particular category?

Answers:

$productCollection = Mage::getResourceModel('catalog/product_collection') ->addCategoryFilter($category);

* Upwork Magento Test Answer N0 58.

Question:

What does the Capture method do in the Magento Purchase and Order Processing flow?

Answers:

Collects funds from the authorized transaction and puts it in the merchant's account.

* Upwork Magento Test Answer N0 59.

Question:

How magento contact form can be shown on a CMS page?

Answers:

• By using block syntax {{block type="core/template" name="contactForm" template="contacts/form.phtml"}} • By Using Layout Update • By Creating an Widget of Contact form and adding that widget to CMS page • All of above is correct

* Upwork Magento Test Answer N0 60.

Question:

Assuming the following choices are to be added to a custom theme layout's local.xml file; which of the following will move the "related products" box in the "product details page" to the bottom center column?

Answers:

<catalog_product_view> <reference name="right"> <action method="unsetChild"> <block>catalog.product.related</block> </action> </reference> <reference name="content"> <action method="insert"> <block>catalog.product.related</block> </action> </reference> </catalog_product_view>

* Upwork Magento Test Answer N0 61.

Question:

Which of the following will check whether the currently logged-in customer ever placed an order at the Magento store?

Answers:

$orders = Mage::getResourceModel('sales/order_collection') ->addFieldToSelect('*') ->addFieldToFilter('customer_id', $customer->getId()); if ($orders->getSize()) { }

* Upwork Magento Test Answer N0 62.

Question:

Which of the following will display a product's thumbnail?

Answers:

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

* Upwork Magento Test Answer N0 63.

Question:

Which of the following code samples will get all products sorted by 'position', assuming 'position' is of a numeric type?

Answers:

$products = Mage::getModel('catalog/product') ->getCollection() ->addAttributeToSelect('*') ->addAttributeToSort('position', 'ASC'); ->load();

* Upwork Magento Test Answer N0 64.

Question:

Which of the following will add a new custom block on the product details page after the media block, using a custom module?

Answers:

<reference name="product.info"> <block type="mymodule/folder_class" after="media" name="mymodule.folder.class" template="mymodule/folder/class.phtml" as="mymodule_folder_class"></block> </reference> <?php echo $this->getChildHtml('mymodule_folder_class');?>

* Upwork Magento Test Answer N0 65.

Question:

Select the correct sequence of methods to use to create a bundle product in Magento.

Answers:

setBundleOptionsData, setBundleSelectionsData, setCanSaveBundleSelections, setAffectBundleProductSelections

* Upwork Magento Test Answer N0 66.

Question:

Which file needs to change to update database when transfer a local Magento install onto live server?

Answers:

app/etc/local.xml

* Upwork Magento Test Answer N0 67.

Question:

Which of the following will get active store information (such as the store's name) in Magento?

Answers:

Mage::app()->getStore();

* Upwork Magento Test Answer N0 68.

Question:

Which of the following will display a customer's TAX/VAT number?

Answers:

$taxvat = $order['customer_taxvat']; • $order->getData('customer_taxvat');

* Upwork Magento Test Answer N0 69.

Question:

What is the difference between the isSaleable() and isAvailable() functions?

Answers:

isAvailable() is used to decide whether to display the product as "in stock" or "out of stock", while isSaleable() is used to decide whether to show an "Add to Cart" button or not.

* Upwork Magento Test Answer N0 70.

Question:

Which of the following Events are triggered when the payment has been confirmed?

Answers:

sales_order_payment_pay

* Upwork Magento Test Answer N0 71.

Question:

Which of the following will return a visitor's UserAgent information?

Answers:

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

* Upwork Magento Test Answer N0 72.

Question:

Which XML file(s) should be checked when the following Magento error occurs during installation? "PHP Extensions "0" must be loaded"

Answers:

config.xml in app/code/core/Mage/Install/etc

* Upwork Magento Test Answer N0 73.

Question:

An observer in Magento is defined as a:

Answers:

Class

* Upwork Magento Test Answer N0 74.

Question:

Which of the following conditions must be met in order to successfully run a Magento install script?

Answers:

The install script should be placed in MODULE/sql/RESOURCES_KEY/SCRIPT_NAME. • The install script should be named using the convention, mysql4-install-MODULE_VERSION.php • The module version in config.xml and in the install script file name must be same. • All of these.

* Upwork Magento Test Answer N0 75.

Question:

Which of the following Magento objects will be created during checkout?

Answers:

sales/quote

* Upwork Magento Test Answer N0 76.

Question:

Which of the following will sort products in the catalog by the date they were added?

Answers:

Under "app/code/core/Mage/Catalog/Model/Config.php", add this value to the $options array: 'created_at' => Mage::helper('catalog')->__('Date')

* Upwork Magento Test Answer N0 77.

Question:

What is the best way to store session values in Magento?

Answers:

$myValue=’Hello world’; Mage::getSingleton( 'core/session' )->setMyValue($myValue);

* Upwork Magento Test Answer N0 78.

Question:

Which of the following will check if the current request is for a backend page or a frontend page?

Answers:

Mage::app()->getStore()->isAdmin()

* Upwork Magento Test Answer N0 79.

Question:

What is the recommended way to override/extend Magento core functionality?

Answers:

Copy the original Magento core file to the app/code/local folder and customize that file.

* Upwork Magento Test Answer N0 80.

Question:

Which of the following will call a static block inside one of Magento's template files?

Answers:

$this->getLayout()->createBlock('cms/block')->setBlockId('my_static_block_name')->toHtml()

* Upwork Magento Test Answer N0 81.

Question:

Which of the following Magento classes should be used for adding custom duties/taxes to a quote during the checkout process?

Answers:

Mage_Sales_Model_Quote_Address_Total_Abstract

* Upwork Magento Test Answer N0 82.

Question:

How can programmatically added bundle products be shown in Magento's front-end?