Free Magento 2 Certified Associate Developer Exam Braindumps (page: 12)

Page 12 of 26

You have been asked to display details from the customer's latest order on the customer's account dashboard (customer/account/). You create a new custom template to show the information.

How do you obtain an order repository so you can fetch an order?

  1. Create a view model and specify an OrderRepositoryInterface argument in the _construct method
  2. In your template, add the following:$orderRepository=ObjectManager::getInstance()- >get(OrderRepositoryInterface::class);
  3. In your block, add a method with the following:return ObjectManager::getInstance()- >get(OrderRepositoryInterface::class);
  4. In your template, add the following:$orderRepository = new OrderRepository();

Answer(s): C



You are creating a new page layout for your custom module.
What is the primary difference between container and block elements?

  1. They extend different abstract classes
  2. A container's children are rendered automatically
  3. Only containers can be removed by name or alias
  4. A block's position within the layout can be altered

Answer(s): B



A merchant tasks you to keep sales managers out of the system configuration backend pages.
How do you do that using the admin interface?

  1. You remove access to the restricted pages from each user's ACL settings
  2. You create a role with limited permissions and assign all sales manager users to the new role
  3. This is not possible in a native Magento instance and requires customization
  4. You create a role with access to the system configuration pages and assign it to all users except the sales managers

Answer(s): B



How do you obtain customer information in a JavaScript module?

  1. Magento does not expose customer information in JavaScript for security reasons
  2. By sending an AJAX request to the url: /customer/account/info/?json=1
  3. By using customerData.get(`customer') call, where customerData is an instance of Magento_Customer/js/customer-data
  4. Customer information is available in localStorage and be retrieved by calling window.localStorage.getItem(`customer')

Answer(s): C



Page 12 of 26



Post your Comments and Discuss Magento Magento 2 Certified Associate Developer exam with other Community members:

Durga commented on May 17, 2023
Please upload quetions
Anonymous
upvote