Upwork Magento Test answers August 2022 | Magento Test answers earnwithfs

 Upwork Magento Test answers August 2022 | Magento Test answers earnwithfs







Upwork Magento Test answers August 2022










in this article i will provide you 60 Upwork Magento Test answers August 2022. if you want to get 100% score in Upwork Magento Test then read this article carefully and till the end.



c




Upwork Magento Test answers August 2022 | Magento Test answers  earnwithfs ( Q No. 1 to Q No. 20 )



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

Answers:

� $myValue=�Hello world�; Mage::getSingleton( ‘customer/session’ )->setMyValue($myValue);

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

� $myValue=�Hello world�; Mage::getSingleton( ‘core/variable’ )->setMyValue($myValue);

� $myValue=�Hello world�; $_SESSION[�MyValue�] = $myValue;

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

Answers:

� Processing state

� Payment Processing state

� Pending shipment state

� Payment Review state

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

Answers:

� /app/design/adminhtml/default/default/template/sales/order/view/info.phtml

� /app/design/adminhtml/default/default/template/salesext/edit_form.phtml

� /app/code/local/CWACI/SalesExt/controllers/Adminhtml/Sales/OrderController.php

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

4.)  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:

� Replace the logo in the base theme skin directory.

� Create a new theme and replace the new logo in the skin directory.

� Update the logo in all transactional emails.

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




5.)  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

� When the products are in stock, but not in the cart

� When no products are available

� None of these.

6.) 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>

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

� <reference name=”child.block.name”> <action


c

 method=”unsetParent<alias>child_block_alias</alias></action> <action method=”insert”><blockName>parent.block.name</blockName><siblingName>name_of_block</siblingName><after>1</after><alias>child_block_alias</alias></action> </reference>

� It is not possible to edit the order of existing blocks.

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

Answers:

� at least 128MB

� at least 256MB

� at least 512MB

� over 512MB

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

Answers:


� The checkout step cannot be skipped in Magento.

� Downloadable products automatically do not require checkout.

� There is an option in the admin panel to skip the checkout step for downloadable products.

� Magento does not support downloadable products.

9.)  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.

10.)  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:



� Database table �core_config_data�

� config.inc file at magento root

� app/etc/config.xml

� app/etc/local.xml


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

Answers:

� $taxvat = $order[‘customer_taxvat’];

� $order->getData(‘customer_taxvat’);

� $order->getQuote()->getCustomerTaxvat();

� $order->getData()->getCustomerTaxvat();

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

Answers:


� There is an error in the code.

� Some modules failed to load.

� Router references were set incorrectly.

� .htacces is blocking URLs.

13.) 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’)

� Under “app/code/core/mage/catalog/model/resource/eav/mysql4/product/collection.php”, add this value to the $options array: $this->getSelect()->order(“e.entity_id desc”);

� Under “app/code/core/Mage/Catalog/Model/Config.php”, add this value to the $options array: ‘sort_by’ => Mage::helper(‘catalog’)->__(‘Date’)

� It’s not possible to sort products in the catalog by date.

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

Answers:


� Yes, by using a custom module.

� Yes, by registering an event.

� No, since it’s a security threat.

� No, since no additional action can be added at this stage.

15.) 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();

� $products = Mage::getModel(‘catalog/product’) ->getCollection() ->addAttributeToSelect(‘*’) ->addOrder(‘position’, ‘ASC’); ->load();

� function cmp($a, $b) if ($a == $b) return 0; return ($a < $b) ? -1 : 1; $products = Mage::getModel(‘catalog/product’) ->getCollection() ->addAttributeToSelect(‘*’) ->load(); usort($products, “cmp”);

� function mySortByPosition($a, $b) if ($a[‘position’] == $b[‘position’]) return 0; return ($a[‘position’] < $b[‘position’]) ? -1 : 1; $products = Mage::getModel(‘catalog/product’) ->getCollection() ->addAttributeToSelect(‘*’) ->addSorter(mySortByPosition) ->load();

16.) 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.

� The lifetime of the quote cannot be controlled.

� Quotes don’t deal with metadata about the store.

� Quotes are not related to order payment and shipping method information.

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

Answers:

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

18.) 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 ^oldstore.com RewriteRule ^ – [E=MAGE_RUN_CODE:yourOldStoreCode] RewriteRule ^ – [E=MAGE_RUN_TYPE:website]

� RewriteCond %HTTP_HOST ^newstore.com RewriteRule ^ – [E=MAGE_RUN_CODE:yourNewStoreCode] RewriteRule ^ – [E=MAGE_RUN_TYPE:website]

� RewriteCond %HTTP_HOST ^newstore.com RewriteRule ^ – [E=MAGE_RUN_CODE:yourStoreCode] RewriteRule ^ – [E=MAGE_RUN_TYPE:website]

� RewriteCond %HTTP_HOST ^newstore.com RewriteRule ^ – [E=MAGE_RUN_CODE:yourNewStoreCode] RewriteRule ^ – [E=MAGE_RUN_TYPE:website]

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

Answers:

� $_SESSION[‘name’] = ‘frontend’;

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

� Mage::getSingleton( ‘customer/session’ )->setValue( ‘name’, array( 1, 2, 3 ) );

� None of the above

20.)  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();

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

� $collection->addAttributeToFilter(‘customer_referrer_id’, $referrer_id); $referrer_id = getSingleton(‘admin/session’)->getUser()->getId();

� None of these.



Upwork Magento Test answers August 2022 | Magento Test answers  earnwithfs ( Q No. 21 to Q No. 40 )



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

Answers:

� Creating a empty module and adding a system.xml file to it

� Using the Magento Admin panel: System > Custom Variables > create a new custom variable

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

� $myValue=”Hello World”; Mage::getModel(‘core/variable’)->addMyValue($myValue);

22.)  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:

� There is no solution; a PHP file cannot be used as a stylesheet.

� Use the “href” attribute instead of “src” to specify the file’s location, as in: <link href=”http://siteurl.com/theme/skin/frontend/default/mytheme/css/colors.css.php” rel=”stylesheet” type=”text/css”>

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

� Send a valid Content-Type HTTP header, as in: header(“content-type: text/css”);

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

Answers:


c

� Directly edit the core files of Magento with proper commenting.

� Mage::registerOverride(�CoreClassName�,�CoreFunctionName�,�MyClassName�,�MyFunctionname�);

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

� Create extended versions of core files in their own folder with extension information. app/code/core/Mage/Cms/Model/Page.php app/code/core/Mage/Cms/Model/Page.1.php App/code/core/Mage/Cms/Model/Page.2.php

24.) An observer in Magento is defined as a:

Answers:

� Method

� Class

� Event

� None of these.

25.) 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.

� “Flush Cache Storage” removes “/tmp/” folder’s cache only, while “Flush Magento Cache” clears everything.

� “Flush Magento Cache” and “Flush Cache Storage” are equivalent; they work the same way.

� None of the above.

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

Answers:

c


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

� block type=”catalog/product_list” category_id=”7″ template=”catalog/product/list.phtml”

� $productCollection = Mage::getResourceModel(‘catalog/product_collection’) ->addFilter($category);

� $productCollection = Mage::getModel(‘catalog/product_collection’) ->addCategoryFilter($category);

27.) 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(); $categoryDetails = Mage::getModel(‘catalog/category’)->load($category->getId()); $products = $categoryDetails->loadChildProducts(); foreach($products as $product) Print $product->getName();

� $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();

� $categories = Mage::getModel(‘catalog/category’) ->getCollection() ->setLoadProducts(true); foreach ($categories as $category) print $category->getName(); foreach($category->getProducts() as $product) print $product->getName();

� $products = Mage::getModel(‘catalog/product’) ->getCollection(); foreach ($products as $product) print $product->getCategory()->getName(); print $product->getName();

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

Answers:

� $this->setBlockId(‘my_static_block_name’)->toHtml()

� $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘my_static_block_name’)->toHtml()

� $this->createBlock(‘cms/block’)->setBlockId(‘my_static_block_name’)->toHtml()

� $this->getLayout()->createBlock(‘cms/block’)->BlockId(‘my_static_block_name’)->toHtml()

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

Answers:

� sales/payment

� sales/tax

� sales/order

� sales/quote

30.) 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>

� <catalog_product_view> <reference name=”right”> <action method=”unsetChild”> <block>catalog.product.related</block> </action> </reference> <reference name=”product.info”> <action method=”insert”> <block>catalog.product.related</block> <after>1</after> </action> </reference> </catalog_product_view>

� <catalog_product_view> <reference name=”right”> <action method=”unsetChild”> <block>catalog.product.related</block> </action> </reference> <reference name=”product.info”> <action method=”insert”> <block>catalog.product.related</block> <after>0</after> </action> </reference> </catalog_product_view>

� None of the above.

click for btc👉


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

Answers:

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

� <img src=”https://solvedupworktests.blogspot.com/2018/08/<?php echo $this->helper(“catalog/image’)->init($_item->getProductThumbnail(), ‘image’)->resize(50); ?>” alt=”<?php echo $_item->getName() ?>” />

� <img src=”https://solvedupworktests.blogspot.com/2018/08/<?php echo $_item->getProduct()->getThumbnailUrl() ?>” alt=”<?php echo $_item->getName() ?>” />

� <img src=”https://solvedupworktests.blogspot.com/2018/08/<?php echo $this->helper(“catalog/image’)->init($_item->getProduct(), ‘thumbnail’)->resize(50); ?>” alt=”<?php echo $_item->getName() ?>” />

32.) 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”

� “Controller’s Alias” / “Class name relative to the alias”

� “Controller’s Class” / “Method Name”

� “Method Name” / “Parameter”

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

Answers:

� <?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=”https://solvedupworktests.blogspot.com/2018/08/<?php echo $helper->getCategoryUrl($cat);?>”> <?php echo $cat->getName();?> </a> <?php endif; endforeach; ?>

� <?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=”https://solvedupworktests.blogspot.com/2018/08/<?php echo $helper->getCategoryUrl($cat);?>”> <?php echo $cat->getName();?> </a> <?php endforeach; ?>

� <?php $_helper = Mage::helper(‘catalog/category’); $_categories = $_helper->getStoreCategories(); if (count($_categories) > 0): foreach($_categories as $_category): ?> <a href=”https://solvedupworktests.blogspot.com/2018/08/<?php echo $_helper->getCategoryUrl($_category) ?>”> <?php echo $_category->getName() ?> </a> <?php endforeach; endif; ?>

� None of the above.

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

Answers:

� Mage::helper(‘core/http’)->getHttpUserAgent()

� Mage::helper(‘core/mage’)->getHttpUserAgent()

� Mage::helper(‘core/mage’)->getHttpAgent()

� Mage::helper(‘core/http’)->getHttpUserServer()

35.) How can account navigation links be changed?

Answers:

� Using an XML file to define the template

� Using a third party module

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

� None of these.

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

Answers:

� Mage::registerEvent

� Mage::dispatchEvent

� Mage::addAction

� Mage::registerObserverEvent

37.) 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

� install.xml in app/code/core/Mage/Install/etc

� extensions.xml in app/code/core/Mage/Install/etc

� None of these3

38.) 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>

� Using File: app/code/core/Mage/Core/Model/Layout.php protected function _generateAction($node, $parent) { if (isset($node[‘ifconfig’]) && ($configPath = (string)$node[‘ifconfig’])) if (!Mage::getStoreConfigFlag($configPath)) return $this;

� <action method=”setTemplate”> <template helper=”mymodule/myhelper/switchTemplateIf”/> </action>

� None of these.

39.) 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>

� <?xml version=”1.0″ ?> <config> <menu> <xmlconnect> <hide>1</hide> </xmlconnect> </menu> </config>

� <?xml version=”1.0″ ?> <config> <menu> <xmlconnect> <delete>1</delete> </xmlconnect> </menu> </config>

� Items under the Magento admin panel can’t be removed.

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

Answers:

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

� Mage::app()->getStoreId();

� Mage::app()->getName();

� None of the above



Upwork Magento Test answers August 2022 | Magento Test answers  earnwithfs ( Q No. 41 to Q No. 60 )



41.) 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” name=”mymodule.folder.class” template=”mymodule/folder/class.phtml” as=”mymodule_folder_class”></block> </reference>

� <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’);?>

� <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_class’);?>

� None of the above.

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

Answers:

� Using XML layout files

� By creating a new field in the database table named �catalog_attributes�

� Via the Magento Admin panel (Manage Attributes)

� By creating a new module

43.) 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:

� catalog/navigation

� core/text_list

� page/template_container

� page/html

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

Answers:

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

� There is no difference between the two functions.

� isSaleable() checks if the product’s type can be sold, while isAvailable() checks if the product itself can be sold.

� 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.

45.) 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_Item_Option

� Mage_Sales_Model_Quote_Address_Total_Abstract

� Mage_Sales_Model_Quote_Item

� Mage_Sales_Model_Quote_Payment



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

Answers:

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

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

Answers:

� By re-indexing

� By using the following codes: Mage::register(‘product’, $product); Mage::register(‘current_product’, $product); $product->setCanSaveConfigurableAttributes(false); $product->setCanSaveCustomOptions(true);

� By using the following: 1. setBundleOptionsData() 2. setBundleSelectionsData() 3. setCanSaveBundleSelections(true)

� It is not possible to show programmatically added bundle products in the front-end.

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

Answers:

� $product->hasCustomType();

� $product->hasCustomOptions();

� $product->hasOptions();

� $product->hasOptionsType();

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

Answers:

� checkout_onepage_controller_success_action

� checkout_payment_confirmed

� sales_order_payment_pay

� payment_confirmed_action


click for btc👉

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

Answers:

� Custom options are only stored on the quote as option IDs and values.

� Every time the options are rendered, they are reloaded from the database.

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

� None of these.

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

Answers:

� setBundleOptionsData, setBundleSelectionsData, setCanSaveBundleSelections, setAffectBundleProductSelections

� setBundleOptionsData,setCanSaveBundleSelections,setBundleSelectionsData,setAffectBundleProductSelections

� setBundleOptionsData, setBundleSelectionsData, setAffectBundleProductSelections, saveBundleOptions

� setBundleOptionsData, setCanSaveBundleSelections,setSelectionCollection, setAffectBundleProductSelections

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

Answers:

� $_productCollection = Mage::getResourceModel(‘catalog/product_collection’); Mage::getModel(‘catalog/layer’)->prepareProductCollection($_productCollection); $_productCollection->getSelect()->order(‘rand()’);

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

� $products = Mage::getModel(‘catalog/product’) ->getCollection() ->addAttributeToSort(‘id’, ‘RAND()’) ->addAttributeToSelect(‘small_image’) ->addCategoryFilter(Mage::getModel(‘catalog/category’) ->load($catId));

� $_productCollection = Mage::getResourceModel(‘catalog/product_collection’); Mage::getModel(‘catalog/layer’)->prepareProductCollection($_productCollection); $_productCollection->getSelect()->rand();

53.) 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:

� Because it is necessary for magento and you must use that session.

� Because Magento relies heavily on the Zend Framework as the underpinning and it will be able to be ignored.

� Because Magento relies heavily on the Zend Framework as the underpinning and I must use that for frontend session without condition.

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

54.) 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>

� <?php $ref = new Mage_Page_Block_Html_Header(); if($ref->getIsHomePage()) ?> <?php echo $this->getLayout()->createBlock(‘cms/block’)->setBlockId(‘Your_StaticBlock_Id’)->toHtml();?> <?php ?>

� <cms_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>

� <cms_index> <reference name=”homepage”> <block type=”cms/block” name=”home-page-block”> <action method=”setBlockId”><block_id>home-page-block</block_id></action> </block> </reference> <cms_index>

55.) 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/

� <MAGENTOROOT>/media/import/

� <MAGENTOROOT>/import/

� <MAGENTOURL>/

56.) 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.

� subdomain.domain.com needs to be entered in Magento’s app/code/core/Mage/Core/Model/Config.php file, to make session cookies available to other subdomains.

� Allowing access to session cookies from other subdomains is not part of Magento’s core functionality, but it can be achieved using extensions.

� It is not possible to access a Magento site’s cookies on a different subdomain.

57.) 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.”; ?>

� <?php Mage::getSingleton(‘core/session’, array(‘name’=>’adminhtml’) ); $adminsession = Mage::getSingleton(‘admin/session’, array(‘name’=>’adminhtml’)); if($adminsession->isLoggedIn()) echo “<br>”. “Admin Logged in”; else echo “<br>”. “Admin NOT logged in”; ?>

� $sesId = isset($_COOKIE[‘adminhtml’]) ? $_COOKIE[‘adminhtml’] : false ; $session = false; if($sesId) $session = Mage::getSingleton(‘core/resource_session’)->read($sesId); $loggedIn = false; if($session) if(stristr($session,’Mage_Admin_Model_User’)) $loggedIn = true; var_dump($loggedIn);

� $userArray = Mage::getSingleton(‘admin/session’)->getData(); $user = Mage::getSingleton(‘admin/session’); echo $userId = $user->getUser()->getUserId(); echo $userEmail = $user->getUser()->getEmail(); echo $userFirstname = $user->getUser()->getFirstname(); echo $userLastname = $user->getUser()->getLastname(); echo $userUsername = $user->getUser()->getUsername(); echo $userPassword = $user->getUser()->getPassword();

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

Answers:


click for btc👉

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

� <action method=�addJs�> <script>http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js</script> </action>

� <action method=�Jsadd�> <script>http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js</script> </action>

� <action method=�addJs�>http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js</action>

59.) Which of the followings magento features are related to CRM?

Answers:

� Newsletters

� Contact and Transactional Emails

� Poll

� All of above

60.) 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.

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

� It can be done by writing this code on a controller: Mage::transfer(‘data’, $data); and writing this in the block: $data = Mage::registry(‘data’);

� It can be done by writing this code on a controller: Mage::register(‘data’, $data); and writing this in the block: $data = Mage::registry(‘data’);

75. 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 <reference name=”content”> <block type=”core/template” name=”contactForm” template=”contacts/form.phtml”/> </reference>

� By Creating an Widget of Contact form and adding that widget to CMS page

� All of above is correct


You have to wait 15 seconds.
Generating Code...

Post a Comment

Previous Post Next Post