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 26
You are developing a module and need to add another column to a table introduced by another module MyCompany_MyModule via db schema.
How do you do that?
- A. Create a etc/db_schema_whitelist.json file in your module, add the column and run bin/magento setup:upgrade
- B. Create a etc/db.xml file in your module, add the column and run bin/magento setup:db-schema:upgrade
- C. Create a etc/db_schema.xml file in your module, add the column and run bin/magento setup:upgrade
- D. Run a command: bin/magento setup:db-schema:upgrade <table> <column definition>
Answer: C
NEW QUESTION 27
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 28
A custom module must make changes to the schema following each setup:upgraderun. This must be done
after all other module's schema updates have been applied.
How is this accomplished?
- A. Update the module's setup_priorityin etc/modules.xml
- B. Write a plugin intercepting \Magento\Setup\Model\Installer::handleDBSchemaData
- C. Create a Recurringclass which implements InstallSchemaInterface
- D. Create an UpgradeSchemaAfterclass which implements InstallSchemaInterface
Answer: C
Explanation:
Explanation/Reference: https://www.pierrefay.com/magento2-training/install-upgrade-setup.html
NEW QUESTION 29
You have created a module with a custom ACL resource and want to restrict access to resources of your module.
Which three items are restricted based on ACL role permissions? (Choose three.)
- A. Adminhtml controllers
- B. CLI Commands
- C. Webapi resources
- D. System configuration sections
- E. Storefront login
Answer: A,D,E
Explanation:
Explanation/Reference: https://www.mageplaza.com/magento-2-module-development/magento-2-acl-access-control- lists.html
NEW QUESTION 30
Which two tasks are supported by Magento CLI? (Choose two.)
- A. Customer password reset
- B. Clearing cache
- C. Administrator account creation
- D. Codebase deployment from developer machine to staging server
Answer: B,D
Explanation:
Explanation/Reference: https://www.magestore.com/magento-2-tutorial/3464-2/
NEW QUESTION 31
There are two different configurable products which both share one variation. The shared variation is
represented by the same simple product.
A customer added both configurables to the cart with the same selected variation?
How will they be displayed?
- A. As two separate line items with quantity 1 each
- B. As one line item of the second product with quantity 2
- C. As one line item which lists both configurable products with quantity 1 each
- D. As one line item of the first product with quantity 2
Answer: C
Explanation:
Explanation/Reference: https://firebearstudio.com/blog/the-complete-guide-to-magento-2-configurable-products.html
NEW QUESTION 32
What is the difference between online and offline shipping methods?
- A. Online means that a shipment will have a tracking number, and offline means no tracking numbers are
available - B. Online means that an item's shipping will be processed by the merchant, offline means that it will be
processed by the customer - C. 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 - D. Online means Magento will use a shipping carrier's API to obtain rates, offline means Magento will calculate
the rates internally
Answer: B
Explanation:
Explanation/Reference: https://amasty.com/blog/shipping-magento-2-guide/
NEW QUESTION 33
You are debugging a problem resulting from a recently deployed around plugin. The plugin is intercepting the doSomething method. The aroundDoSomething plugin method is called successfully, but the original doSomething method is no longer being executed as expected.
What is causing this?
- A. The plugin implementation is skipping the execution of its callable argument
- B. The plugin implementation returned something other than its callable argument
- C. The sort order of the plugin is too high and supersedes the priority of the intercepted method
- D. The plugin implementation overlooked using the AbstractPlugin parent class
Answer: A
Explanation:
Explanation/Reference: https://github.com/magento/magento2/issues/11699
NEW QUESTION 34
You have created a custom module which must perform an action immediately after an order is placed, but only
on the store front of the merchant site. You have selected the checkout_submit_all_after as the target event
which the module will observe.
In which file will the event observer be declared?
- A. etc/config.xml
- B. etc/frontend/events.xml
- C. etc/events.xml
- D. etc/frontend.xml
Answer: B
Explanation:
Explanation/Reference: https://magento.stackexchange.com/questions/128548/trigger-event-after-an-order-has-been-
created-saved/128565
NEW QUESTION 35
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
Explanation:
Explanation
https://magento.stackexchange.com/questions/103256/how-to-disable-the-cache-for-the-block-in-magento-2
NEW QUESTION 36
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 37
What is the connection between product attribute sets and categories?
- A. Categories have no connection to product attribute sets, and any product can be assigned to any category
- B. Categories can be connected to multiple product attribute sets, and only products from one of those sets are allowed in the category
- C. Each category is linked to a single product attribute set, and only products from that category's set or any of its parent categories'
- D. Each category is linked to a single product attribute set, and only products from that attribute set are allowed in the category
Answer: A
NEW QUESTION 38
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 39
You are implementing a custom module MyModule, which provides an implementation of
\Psr\Log\LoggerInterface called \MyCompany\MyModule\Logger.
The LoggerInterface has the default preference declared in app/etc/di.xml.
Keeping upgradability in mind, how do you make \MyCompany\MyModule\Logger the default implementation of the LoggerInterface globally?
- A. Overwrite the existing preference for the LoggerInterface in app/etc/di.xml
- B. Declare a new preference for the LoggerInterface in MyCompany/MyModule/etc/di.xml
- C. Declare a new preference for the LoggerInterface in
app/code/myCompany/MyModule/etc/frontend/di.xml - D. Declare a new preference for the LoggerInterface in
app/code/MyCompany/MyModule/etc/global/di.xml
Answer: A
NEW QUESTION 40
Assume that a customer's cart only includes one downloadable product.
What effect will it cause on the quote object?
- A. The quote object will not have any address
- B. The quote object will not have a billing address
- C. The quote object will not have shipping address
- D. The quote object will have a downloadable URL instead of an address
Answer: C
Explanation:
Explanation
NEW QUESTION 41
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 42
You have created a custom module which must perform an action immediately after an order is placed, but only on the store front of the merchant site. You have selected the checkout_submit_all_after as the target event which the module will observe.
In which file will the event observer be declared?
- A. etc/config.xml
- B. etc/frontend/events.xml
- C. etc/events.xml
- D. etc/frontend.xml
Answer: B
NEW QUESTION 43
How can you render a text on a page using only layout xml?
- A. Option D
- B. Option B
- C. Option A
- D. Option C
Answer: B
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.real4prep.com/Magento-2-Certified-Associate-Developer-exam.html