Menu

UpWork Magento Test Answers

We help you to get prepared and pass your Marketing online Certification exams. It’s a better way to learn what you need using our Top Quality Time-Saving Guides and practical tips and tricks. More info: https://www.certificationanswers.com/en/

UpWork Magento Test Answers

Magento Test

Questions
From 20 up to 60 questions
Time
About 60 minutes
Difficulty
The test will provide a variety of question from easy to hard ones

We need to make the following actions in order to create a module with one payment method that will?

  • accept credit card information
  • authorize it when an order is submitted
  • save the transaction ID in order payment record
Module declaration, module configuration, adapter model, declaring configuration options for admin panel, database updates
Module declaration, module validation, module configuration, declaring configuration options for admin panel, database updates
Module declaration, module validation, module configuration, adapter model, declare configuration options for admin panel, database updates
Configuration options from admin panel

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

Mage::helper('checkout')->getQuote()->getShippingAddress()->getData('tax_amount');
$totalItemsInCart = Mage::helper(‘checkout/cart’)->getItemsCount();
$totals = Mage::getSingleton(‘checkout/session’)->getQuote()->getTotals();
$subtotal = round($totals["subtotal"]->getValue());
$grandtotal = round($totals["grand_total"]->getValue());
>if(isset($totals['discount']) && $totals['discount']->getValue()) {
$discount = round($totals['discount']->getValue());
} else {
$discount = ”;
}

if(isset($totals['tax']) && $totals['tax']->getValue()) {
$tax = round($totals['tax']->getValue());
} else {
$tax = ”;
}
$order = Mage::getModel('sales/order')->load($order_id);
$items = $order->getAllItems();
$subtotals = array();
foreach ($items as $_item) {
   if (array_key_exists($subtotals[$_item->getTaxClassId()])) {
       $subtotals[$_item->getTaxClassId()] += $_item->getRowTotal();
   } else {
       $subtotals[$_item->getTaxClassId()] = $_item->getRowTotal();
   }
}
<?php
$order = Mage::getModel('sales/order')->loadByIncrementId($this->getOrderId());
$data = $order->getData();
?>


Which command can you use to clear the directories?

rm -rf <your Magento install dir>/var/data/* <your Magento install dir>/var/generation/*
rm -rf <your Magento install dir>/var/di/* <your Magento install dir>/var/generation/*
rm +rf <your Magento install dir>/var/di/* <your Magento install dir>/var/generation/*
rm -rf <your Magento install dir> -> /var/di/* <your Magento install dir>/var/generation/*

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

Mage::registerObserver(‘<EventNameToHook>’,’MyClass::observerFunction’);
Using the option in the Magento Admin panel:
System > Configuration > Advanced > Developer > Register Observer
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>
Mage::registerObserver(‘myglobalobserver’);

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

Magento has the following codepool?

Community, Advanced and Local
Core, Community and Local
Remote, Core and Community
None of the above.


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

Processing state
Payment Processing  state
Pending shipment state
Payment Review state

Which of the following can be used to get the latest n products?

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->getSelect()->order('entity_id desc')->limit(n);
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->getSelect()->orderBy('entity_id desc')->limit(n);
$collection = Mage::getModel('catalog/products')->getCollections();
$collection->getSelect()->orderBy('entity_id desc')->limit(n);
None of the above


Which of the following piece of codes can be used to get Magento clients by payment method?

$collection = Mage::getResourceModel('sales/order_payment_collection')->addFieldToSelect('*')->addFieldToFilter('method', "mundipagg_boleto");
 foreach ($collection as $orderPayment) {
     $orderId = $orderPayment->getParentId();
     $order = Mage::getModel('sales/order')->load($orderId);
     $customerId = $order->getCustomerId();
 }
$collection = Mage::getResourceModel('sales/order_payment_collection')->addFieldToSelect('*');
 foreach ($collection as $method) {
     if ($method->getMethod() == "mundipagg_boleto") {
          print $method->getMethod()."<br>";
     }
 }
$collection = Mage::getResourceModel('sales/order_payment_collection')->addFieldToSelect('*')->addField('method', "mundipagg_boleto");;
 foreach ($collection as $method) {
     if ($method->getMethod() == "mundipagg_boleto") {
          print $method->getMethod()."<br>";
     }
 }
All of the above


Which of the following tasks can be performed by Command Line Interface?

Installing Magento
Clearing the cache
Managing indexes, including reindexing
Creating translation dictionaries and translation packages
All of the above

What is the file format for a data upgrade script?

{$module}-v2.php
install-data-v2-{$module}.php
upgrade-0.0.2.php
data-upgrade-0.0.1-0.0.2.php

Which of the following is not a Magento cache type?

Configuration
Page cache
Entity attribute value (EAV)
DML
DDL


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

Mage::app()->getStore();
Mage::app()->getStoreId();
Mage::app()->getName();
None of the above

Which function can be used to get the image Width and Height?

Imagesx() , Imagesy()
getWidth() , getHeight()
scaleX() , ScalyY()
Imagex() , Imagey()

What function fits in this code snippet?

class Namespace_Module_Block_Content extends Mage_Core_Block_Template {
protected function _construct() {
     parent::_construct();
          $this->[function] ('namespace/module/content.phtml');
}
}
setTemplate
setView
setViewFile
setLayout

What does the following tag mean in module's config.xml file?

<sallowspecific>0</sallowspecific>
allow all available countries
allow all countries specified in the country list
shipping not allowed
None of the above


Which of the following files does Magento use to detect maintenance mode?

var/.maintenance.flag
var/.maintenance.mg
var/.maintenance
None of the above


How can you access the Magento theme directory?

Mage::getSingleton('core/design_package')->getSkinBaseDir()
Mage::getBaseDir('skin');
$this->getSkinUrl()
All of the above


Which code is used to specify JavaScript resources mapping?

var config = {
   paths: {
       // configuration for resource 'app/code/Magento/Catalog/controller/frontend/product/product.js'
       "product": "./product/product"
   }
};
var config = {
   paths: {
       // configuration for resource 'app/code/Magento/Catalog/view/frontend/product/product.js'
       "product": "./product/product"
   }
};
var config = {
   paths: {
       // configuration for resource 'app/code/Magento/Catalog/model/frontend/product/product.js'
       "product": "./product/product"
   }
};
var config = {
   paths: {
       // configuration for resource 'app/code/Magento/Catalog/js/frontend/product/product.js'
       "product": "./product/product"
   }
};


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

sales/payment
sales/tax
sales/order
sales/quote


A gift registry will hold the following informations?

Note: There may be more than one right answer.
List of products
Event location
Event name
Event id


Which of the following are the methods of PayPal Payment Gateways?

Note: There may be more than one right answer.
Payflow Pro (Includes Express Checkout)
Payflow Link (Includes Express Checkout)
Payflow Add (Includes Express Checkout)
Payflow List (Includes Express Checkout)


Which Magento command is used to display the current deployment mode?

magento deploy:mode
magento mode:show
magento deploy:mode:show
None of the above


Which theme file defines the location information in Magento 2.0?

signup.php
registration.php
new.php
frontend.php


What is the difference between subtotal price and base subtotal?

Base subtotal is in the customer's currency and subtotal is in your shop's base currency
Subtotal in the customer's currency and base subtotal is in your shop's base currency
Subtotal includes taxes, base subtotal does not
Nothing special, it’s the same value


The controller action _____ method is called each time before calling the action method itself?

preDispatch
preAction
beforeDispatch
beforeAction


Which code is used to get the Total Price of items currently in the cart?

helper(‘checkout’)->formatPrice(Mage::getSingleton(‘checkout/cart’)->getPrice()->getGrandTotal()); ?>
helper(‘checkout’)->formatPrice(Mage::getSingleton({‘checkout/cart’})->getQuotes()->getGrandTotal()); ?>
helper(‘checkout’)->formatPrice(Mage::getSingleton(‘checkout/cart’)->getQuote()->getGrandTotal()); ?>
helper(‘checkout’)->formatPrices(Mage::getSingletons(‘checkout/cart’)->getQuote()->getGrandTotal()); ?>

How can you get Magento extension to run javascript when an item is added to the cart?

<checkout_cart_product_add_after>
   <reference name="footer">
       <block type="core/templates" name="INSERT_CUSTOM_NAME_HERE" template="path/to/your/phtml/file.phtml" />
   </reference>
</checkout_cart_product_add_after>
<catalog_product_view>
   <reference name="footer">
       <block type="core/template" name="INSERT_CUSTOM_NAME_HERE" template="path/to/your/phtml/file.phtml" />
   </reference>
</catalog_product_view>
<checkout_cart_product_add_after>
   <reference name="footer">
       <block type="core/template" name="INSERT_CUSTOM_NAME_HERE" template="path/to/your/phtml/file.phtml" />
   </reference>
</checkout_cart_product_add_after>
All of the above


What happens when you edit an existing order using the order management page?

Depending on the order status, different editing forms appear for the current order
The current order is cancelled and a new order is created from scratch based on the current order's data.
It will work well and let me edit the order.
A form appears that allows you to edit shopping information for the current order only


When we are using .htaccess, how can you redirect all admin pages in Magento to another domain and subdirectory?

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
RewriteCond %{REQUEST_URI} !admin
RewriteCond %{REQUEST_URI} !index.php [NC]
RewriteRule ^ http://www.example.com/landing [R=302,L]
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/index\.php/admin [NC]
RewriteRule ^ - [L]
RewriteCond %{THE_REQUEST} !/new/ [NC]
RewriteRule !^new/ /new%{REQUEST_URI} [NC,R=301,L]
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/index\.php/admin [NC]
RewriteRule ^ - [L]
RewriteCond %{THE_REQUEST} !/new/ [NC]
RewriteRule !^new/ /new%{REQUEST_URI} [NC,R=301,L]
All of the above


Which statement is correct regarding Theme's registration.php file?

It contains the basic meta-information, like the theme name and the parent theme name, and the theme is inherited from an existing theme.
It is required to register your theme in the system.
This file is optional.
Describes the theme dependencies and some meta-information.

Which of the following is not a Magento product type?

Simple Product
Complex Product
Grouped Product
Configurable Product
Virtual Product


Which PHP framework does Magento use?

Yii
Symfony
Zend
Lavarel


Which of the following conditions can be checked to track down a product that is not showing in a category page? (choose all that apply)

Note: There may be more than one right answer.
Product visibility must be "Listed";
Product must be enabled;
Stock and quantity must be greater than 0;
If using multiple websites, check which website the product points to;

If module A declares a dependency upon Module B, which of the following is not valid to declare such dependency?

In Module A's module.xml file, Module B is listed in the <sequence> list
declare a dependency upon Module B in A's composer.json
declare a dependency upon Module A in B's composer.json
in the deployment configuration, Modules A and B must both be defined as enabled.


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?

Database table ‘core_config_data’
config.inc file at magento root
app/etc/config.xml
app/etc/local.xml


What model property is responsible for the naming of this event: "catalog_product_after_load"?

$_eventName property
$_eventDataKey property
$_eventObject property
$_eventPrefix property


How do you change an order status to complete?

Directly in the database
By clicking Complete button
You need to create shipping for order
You need to create an invoice and shipping

How do you forward to a specific external URL outside Magento from your controller?

_forward ($url)
_redirectUrl ($url)
rewriteUrl($url)
goto($url)

Static __ is a silent function of a class, which is stored in the memory space of a class (not objects)?

variable
function
page
method


Which relationship is not possible between two modules?

uses
reacts to
customizes
moves
replaces