Steps Necessary To Pass The Magento-2-Certified-Associate-Developer Exam from Training Expert Pass4Leader [Q34-Q53]

Share

Steps Necessary To Pass The Magento-2-Certified-Associate-Developer Exam from Training Expert Pass4Leader

Valid Way To Pass Magento Certified Developer's  Magento-2-Certified-Associate-Developer Exam

NEW QUESTION 34
The module MyCompany_MyModule will add a new page in the admin interface to display a custom entity in a grid.
You created a controller for this grid
\MyCompany\MyModule\Controller\Adminhtml\CustomEntity\Index
Which two actions are required to make the new page accessible at the
https://your.store.base.url/admin/my_module/custom_entity URL? (Choose two.)

  • A. Register my_module route in MyCompany/MyModule/etc/adminhtml/routes.xml
  • B. Specify the my_module/custom_entity URL using a @route annotation in the action controller execute() method
  • C. Create a new menu item in MyCompany/MyModule/etc/adminhtml/menu.xml
  • D. Register my_module route for the AdminRouter in MyCompany/MyModule/etc/adminhtml/di.xml

Answer: A,B

 

NEW QUESTION 35
In layout files you can change al element's order on a page. This can be done using one of the following:
* <move> instruction
* before and after element attributes?
How are two methods different?

  • A. The move instruction allows altering an element's parent node
  • B. They are the same, both provide access to the same functionality
  • C. Elements are renamed by default when using the move instruction
  • D. Before and after attributes can only be used with referenceContainer and referenceBlock

Answer: A

 

NEW QUESTION 36
In layout files you can change al element's order on a page. This can be done using one of the following:
<move> instruction
before and after element attributes?
How are two methods different?

  • A. The move instruction allows altering an element's parent node
  • B. They are the same, both provide access to the same functionality
  • C. Elements are renamed by default when using the move instruction
  • D. Before and after attributes can only be used with referenceContainer and referenceBlock

Answer: D

 

NEW QUESTION 37
A merchant requires the ability to configure contact information for their brick and mortar stores as a CSV file upload. The module already exists and contains an etc/adminhtml/system.xml file where the new field can be added.
How do you specify the class that will process the uploaded file?

  • A. <source_model>\Magento\Config\Model\Config\Source\File</source_model>
  • B. <backend_model>\Magento\Config\Model\Config\Backend\File</backend_model>
  • C. <upload_model>\Magento\Config\Model\Config\Upload\File</upload_model>
  • D. <frontend_model>\Magento\Config\Model\Config\Frontend\File</frontend_model>

Answer: B

 

NEW QUESTION 38
You need to find all orders in the processing state. You have written the code:

When you run the code, you get the following exception:

How do you resolve the exception?

  • A. Change the getList parameter to: $searchCriteriaBuilder->addFilter('state', 'processing')->create()
  • B. Clear generated code to get a new version of SearchCriteriaBuilder
  • C. Specify a preference in di.xml to map SearchCriteriaBuilder to SearchCriteriaInterface
  • D. Use dependency injection to load an instance of the SearchCriteria class

Answer: A

Explanation:
Explanation/Reference:

 

NEW QUESTION 39
During a code review of a module MyCompany_PaymentCurrencies you see a configuration field declared in the file etc/adminhtml/system.xml:

What is the consequence of the attribute showInStore being set to 0?

  • A. The input field will be disabled if a store view scope is selected in the system configuration
  • B. The field value will not be accessible on the store front by calling ScopeConfigInterface::getValue() with a $scopeType argument of 'store'.
  • C. The input field will only be visible if a website's default store scope is selected in the system configuration
  • D. The input field will not be visible if a store view scope is selected in the system configuration

Answer: D

 

NEW QUESTION 40
You are adding an entry to the backend menu. To do so you open a core etc/adminhtml/menu.xml file as a reference. In the file you see the node:

What is the result of specifying resource="Magento_Catalog::catalog"?

  • A. The menu item will only be visible if the class method specified by the resource returns a true value
  • B. The menu item will only be visible to users who are assigned to a role with access to the matching ACL resource
  • C. The resource is used to locate the correct translation for the attributes listed in title="..."
  • D. The last selected menu item for a user is stored in the DB so the previously visited page can be restored on the next login

Answer: B

 

NEW QUESTION 41
You are adding a child node to the product.info block using the XML:

How will this block be rendered?

  • A. Automatically if the block class Custom implements the _toHtml method
  • B. Child block nodes are automatically rendered as HTML
  • C. The layout is invalid since block elements cannot be nested
  • D. By calling $block->getChildHtml('mynewblock') in the parent block's template

Answer: D

 

NEW QUESTION 42
You have been given the task of importing products from an external source. You decide to create a custom
module to do this. The class handling the import creates a product for each record, sets the data on it and
saves it to the database.
What do you inject into a constructor to represent each product you create?

  • A. \Magento\Catalog\Api\Data\ProductInterface
  • B. \Magento\Catalog\Model\Product
  • C. \Magento\Catalog\Model\ProductBuilder
  • D. \Magento\Catalog\Api\Data\ProductInterfaceFactory

Answer: D

Explanation:
Explanation/Reference: https://magento.stackexchange.com/questions/102922/programmatically-create-a-simple-product-
in-magento-2

 

NEW QUESTION 43
You are implementing a before plugin in MyCompany_Magic. It will intercept the same method that MyCompany_Admission is already intercepting using a before plugin: Topmenu::getBlockHtml
Which two actions are required to ensure the new plugin will execute last? (Choose two.)

  • A. Configure plugin sequencing for both plugins in MyCompany_Magic's etc/plugin_sequence.xml file
  • B. Include a sortOrder="20" on the new plugin in MyCompany_Magic's etc/di.xml file
  • C. Add MyCompany_Admission as a dependency in MyCompany_Magic's etc/module.xml file
  • D. Set a sortOrder="10" for MyCompany_Admission's plugin in MyCompany_Magic's etc/di.xml

Answer: C,D

 

NEW QUESTION 44
\Magento\Sales\Model\Api\OrderRepositoryInterface::getList accepts a SearchCriteriaInterface to filter and sort
information.
What class assists in creating an instance for SearchCriteriaInterface?

  • A. \Magento\Sales\Model\Order\SearchCriteria
  • B. \Magento\Framework\Api\SearchCriteriaBuilder
  • C. \Magento\Backend\Api\SearchCriteriaGenerator
  • D. \Magento\Framework\Api\SearchCriteriaFactory

Answer: B

Explanation:
Explanation/Reference: https://github.com/magento/magento2/blob/2.3/lib/internal/Magento/Framework/Api/
SearchCriteriaInterface.php

 

NEW QUESTION 45
What is a valid use case for an around plugin?

  • A. The arguments of the before plugins must be modified
  • B. The execution of the before and after plugins must be suppressed
  • C. The execution of the pluginized method must be suppressed
  • D. The arguments of the after plugins must be modified

Answer: B

 

NEW QUESTION 46
The constructor function for \Magento\Catalog\Model\Category contains this excerpt:

With the automatic dependency injection that Magento provides, how is the StoreManagerInterface resolved?

  • A. If no $storeManager is provided, Magento's code generator creates a shell concrete class based on
    \Magento\Store\Model\StoreManagerInterface
  • B. Magento throws an exception because you cannot instantiate an interface
  • C. Magento finds all classes that implement \Magento\Store\Model\StoreManagerInterface (ordered alphabetically) and injects the first class.
  • D. Magento looks to the di.xml files in the entire system for a preference node for \Magento\Store\Model
    \StoreManagerInterface. This class is constructed and injected

Answer: A

 

NEW QUESTION 47
You are adding a new entry to the backend menu that appears after
Marketing > SEO & Search > Site Map
You see the existing site map menu item is declared by the node:

What two actions do you take to configure the new menu entry location? (Choose two.)

  • A. Specify sortOrder="100"
  • B. Specify parent="Magento_Backend::marketing_seo"
  • C. Specify item XML in the file etc/adminhtml/menu/marketing/seo/menu.xml
  • D. Specify parent="Magento_Sitemap::catalog_sitemap"

Answer: A,C

 

NEW QUESTION 48
A merchant sells shoes with multiple variations such as a color and size. A shoe is represented by a configurable product. There are seven different colors and four sizes.
What is the minimal amount of simple products that represent a combination of color and size needs to be created in order to make a shoe salable?

  • A. Each color and size must have at least one representation, so a minimum of seven products is needed
  • B. A simple product for every combination must be created
  • C. One simple product that represents a combination of color and size is enough
  • D. A product may be purchased even without any combination available. The color and size may be adjusted during order fulfillment

Answer: C

 

NEW QUESTION 49
In the module located at app/code/MyCompany/MyModule there is a JS module in the file view/frontend/web/register.js. The Magento base URL is https://magento.host/ and the luma theme with the en_US locate is used.
What is the public URL for this file?

  • A. Option
    https://magento.host/pub/static/frontend/Magento/luma/en_US/MyCompany_MyModule/web/register.js
  • B. Option
    https://magento.host/app/code/MyCompany_MyModule/view/frontend/web/register.js
  • C. Option
    https://magento.host/pub/static/frontend//Magento/luma/en_US/MyCompany_MyModule/js/register.js
  • D. Option
    https://magento.host/pub/static/frontend/Magento/luma/en_US/MyCompany_MyModule/register.js

Answer: C

 

NEW QUESTION 50
A merchant requires the ability to configure contact information for their brick and mortar stores as a CSV file upload. The module already exists and contains an etc/adminhtml/system.xml file where the new field can be added.
How do you specify the class that will process the uploaded file?

  • A. <source_model>\Magento\Config\Model\Config\Source\File</source_model>
  • B. <backend_model>\Magento\Config\Model\Config\Backend\File</backend_model>
  • C. <upload_model>\Magento\Config\Model\Config\Upload\File</upload_model>
  • D. <frontend_model>\Magento\Config\Model\Config\Frontend\File</frontend_model>

Answer: B

Explanation:
Explanation/Reference: https://www.magestore.com/magento-2-tutorial/file-upload-in-magento-2-store-configuration/

 

NEW QUESTION 51
You have added a new attribute origin of the type varchar to the product entity.
Which two calls will filter a product collection with origin set to "California"? (Choose two.)
$collection->addFieldToFilter('origin', "California");

  • A. $collection->addAttributeToSelect('origin', "California");
  • B. $collection->addAttributeToFilter('origin', "California");
  • C. $collection->joinAttribute('origin', 'catalog_product/origin', 'origin',
  • D. 'California");

Answer: B,C

 

NEW QUESTION 52
You have created a new section in system configuration under the Catalog tab:

How do you restrict an access to the section using Magento ACL?

  • A. Option D
  • B. Option B
  • C. Option A
  • D. Option C

Answer: B

 

NEW QUESTION 53
......

All Magento-2-Certified-Associate-Developer Dumps and Magento 2 Certified Associate Developer Exam Training Courses: https://www.pass4leader.com/Magento/Magento-2-Certified-Associate-Developer-exam.html