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?
A) Create a view model and specify an OrderRepositoryInterface argument in the _construct method
B) In your template, add the following: $orderRepository=ObjectManager::getInstance() ->get(OrderRepositoryInterface::class) ;
C) In your block, add a method with the following: return ObjectManager::getInstance() ->get(OrderRepositoryInterface::class) ;
D) $orderRepository = new OrderRepository() ;
Correct Answer:
Verified
Q64: You need to add a new text
Q65: You got a notification about error that
Q66: You are adding a new menu item
Q67: During a code review of a module
Q68: You added a plugin declaration to MyCompany/MyModule/etc/di.xml:
Q70: How can you render a text on
Q71: How do you obtain customer information in
Q72: You are reviewing a theme in app/design/frontend/MyCompany/MyTheme
Q73: In a code review of a merchant's
Q74: Where do you change the frontName for
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents