Updated Oct-2021 Test Engine or PDF for the Magento Magento-2-Certified-Associate-Developer test to help you quickly prepare for the Magento exam!
Full Magento-2-Certified-Associate-Developer Practice Test and 105 unique questions with explanations waiting just for you, get it now!
NEW QUESTION 19
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
NEW QUESTION 20
You are writing a customization for the customer module. You need to make sure the configuration files from your module are loaded after the customer module's configuration.
Where should the dependency be declared?
- A. etc/config.xml
- B. etc/module.xml
- C. etc/di.xml
- D. composer.json
Answer: D
NEW QUESTION 21
You are reviewing a theme in app/design/frontend/MyCompany/MyTheme and see the file etc/view.xml.
What is the function of this file?
- A. It configures Grunt to compile assets for the theme
- B. It informs Magento that the theme is present and available for use
- C. It stores theme and image configuration values
- D. It specifies the applicable CSS files for the theme
Answer: C
NEW QUESTION 22
How do you add a new link into the My Account sidebar?
- A. By creating a new UI component
- B. By adding the new section into the customer_account table in the database
- C. By creating a child of the My Account UI component
- D. By using a layout update
Answer: B
Explanation:
Explanation/Reference: https://webkul.com/blog/account-navigation-link-magento2/
NEW QUESTION 23
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
Explanation:
Explanation/Reference: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/xml-instructions.html
NEW QUESTION 24
How do you pass an array ['one', 'two] as a parameter to you block using the layout XML arguments directive?
- A. Option A
- B. Option D
- C. Option B
- D. Option C
Answer: A
Explanation:
Explanation/Reference: https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/layouts/xml-instructions.html
NEW QUESTION 25
You have created a new block and will be adding this block on every page. The block contains user-specific
information and cannot be cached. The block is added to the default.xml with:
What does this accomplish?
- A. All store front pages are no longer cacheable
- B. FPC will cache the block content for all cacheable pages
- C. FPC will be bypassed for this block and all other page content will be cached
- D. The block will be loaded on the store front using AJAX
Answer: A
NEW QUESTION 26
A client has asked you to include category url keys in product URLs.
How is this done?
- A. Create an after plugin on \Magento\UrlRewrite\Controller\Router::generateRewrite
- B. Set the configuration value of catalog/seo/product_use_categories to Yes
- C. This is not possible because products can belong to multiple categories
- D. Create an observer for controller_action_postdispatch_catalog_product_view
Answer: A
NEW QUESTION 27
You are working on a new entity called vendor. You implemented the model, resource model and collection. You want to ensure that standard model events will be fired for your model, so an observer can be created for the events vendor_save_after, vendor_save_commit_after and others.
How do you do that?
- A. Create an entry in etc/di.xml and add the argument eventPrefix with the value of vendor
- B. Ensure that the primary key in the corresponding table is named vendor_id
- C. You must implement all appropriate methods and fire the events manually
- D. Declare the $_eventPrefix property in your vendor model and set it to vendor
Answer: D
NEW QUESTION 28
You are adding a new menu item to the admin backend which will link to a custom backend page.
The declaration of the route:
What do you specify as the menu item action attribute value so it links to /admin/mycompany/mymodule/?
- A. It is not possible without extending the adminhtml route in routes.xml
- B. action="adminhtml/mycompany/mymodule/"
- C. action="mycompany/mymodule/"
- D. action="admin/mycompany/mymodule/"
Answer: C
NEW QUESTION 29
What are two functions of a resource model? (Choose two.)
- A. It loads lists of entity models
- B. It is made available in the Magento API for the purpose of data manipulation
- C. It executes create, retrieve, update and delete actions for an entity
- D. It maps an entity to one or more database rows
Answer: C,D
Explanation:
Explanation
https://devdocs.magento.com/guides/v2.4/architecture/archi_perspectives/persist_layer.html
NEW QUESTION 30
A merchant tasks you to keep sales managers out of the system configuration backend pages.
How do you do that using the admin interface?
- A. You create a role with limited permissions and assign all sales manager users to the new role
- B. You remove access to the restricted pages from each user's ACL settings
- C. You create a role with access to the system configuration pages and assign it to all users except the sales managers
- D. This is not possible in a native Magento instance and requires customization
Answer: A
NEW QUESTION 31
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 32
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 33
You are working on a Magento store which will be selling in two countries. Each country has its own set of payment methods.
How do you organize the project to support this requirement?
- A. Create one website, two store views
- B. Create one website, two payment scopes
- C. Create two websites, two store views
- D. Create one website, one store view
Answer: B
Explanation:
Explanation
NEW QUESTION 34
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. Magento throws an exception because you cannot instantiate an interface
- B. Magento finds all classes that implement \Magento\Store\Model\StoreManagerInterface (ordered alphabetically) and injects the first class.
- C. If no $storeManager is provided, Magento's code generator creates a shell concrete class based on
\Magento\Store\Model\StoreManagerInterface - 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: D
Explanation:
Explanation
https://devdocs.magento.com/guides/v2.4/extension-dev-guide/depend-inj.html
NEW QUESTION 35
How do you pass an array ['one', 'two] as a parameter to you block using the layout XML arguments directive?
- A. Option A
- B. Option D
- C. Option B
- D. Option C
Answer: A
NEW QUESTION 36
In a custom module you are adding a new field to the store configuration. The field will set the value for the configuration path mycompany/mymodule/myoption.
How do you supply the default value for that configuration option?
- A. In the system/mycompany/group/mymodule/field/myoption node in the etc/system.xml file
- B. In the system/section/group/field/value node in the etc/adminhtml/system.xml file
- C. In the config/default/mycompany/mymodule/myoption node in the etc/config.xml file
- D. In the menu/default/section/group/field node in the file etc/adminhtml/menu.xml
Answer: C
NEW QUESTION 37
You are setting up a brand new Magento installation for a merchant who is migrating from Magento 1 to Magento 2.
Keeping in mind upgradability and the need to customize, which one do you choose?
- A. Create a new Magento instance by using the bin/magento install command
- B. Create a new Magento instance using composer create-project
- C. Run php bin/magento setup:migrate <path-to-m1-installation> <new-version> command
- D. Clone the magento/magento2 GitHub repository
Answer: C
NEW QUESTION 38
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.)
- A. $collection->joinAttribute('origin', 'catalog_product/origin', 'origin',
- B. $collection->addFieldToFilter('origin', "California");
- C. $collection->addAttributeToSelect('origin', "California");
- D. 'California");
$collection->addAttributeToFilter('origin', "California");
Answer: C,D
NEW QUESTION 39
What is the difference between online and offline shipping methods?
- A. Online means that it will be sent to the customer using a shipping carrier, offline means the customer will pick up the order in person
- B. Online means Magento will use a shipping carrier's API to obtain rates, offline means Magento will calculate the rates internally
- C. Online means that a shipment will have a tracking number, and offline means no tracking numbers are available
- D. Online means that an item's shipping will be processed by the merchant, offline means that it will be processed by the customer
Answer: B
NEW QUESTION 40
How does Magento store customer address attribute values?
- A. Customer address is an attribute of the customer, so it doesn't have its own attributes
- B. Customer address is an EAV entity, so all values are stored in the customer_address_entity table and
related values tables - C. Customer address is a flat entity, so all values are stored in the customer_address_entity table
- D. Customer address is not an entity, so its properties are customer attributes
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
Which two ways does Magento persist category relationships in the database? (Choose two.)
- A. Using slash-separated values in the path field
- B. Using comma-separated values in the parent-ids field
- C. in the table catalog_category_index
- D. in the parent_id field
Answer: C,D
NEW QUESTION 43
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 44
......
Full Magento-2-Certified-Associate-Developer Practice Test and 105 unique questions with explanations waiting just for you, get it now: https://www.pdf4test.com/Magento-2-Certified-Associate-Developer-dump-torrent.html

