ASSOCIATE DEVELOPER EXAM TEST POOL-02 (MAGENTO 2 CERTIFIED)

Descripción

This only my study notes, questions will NOT be found on the final exam. They might be similar. 60 questions 90mi 68% to pass Based on Magento Open Source (2.3) and Magento Commerce (2.3),
Miska Red
Test por Miska Red, actualizado hace más de 1 año
Miska Red
Creado por Miska Red hace más de 4 años
2707
3

Resumen del Recurso

Pregunta 1

Pregunta
You are customizing a third-party module and need to prevent an event handler from triggering. Keeping upgradeability in mind, how do you do this?
Respuesta
  • Create an observer in events.xml with the same name and specify the disabled="true" attribute.
  • Create a plugin that will disable the 3rd-party's event observer method.
  • Override the event observer's class.
  • Comment the observer from the 3rd-party's module.

Pregunta 2

Pregunta
When writing a model triad (model, resource model, collection), what is the correct way to save a model to the database?
Respuesta
  • Call the save method in the resource model class.
  • Call the save method in the collection class.
  • Call the save method in the model class.
  • Call the save method in the repository.

Pregunta 3

Pregunta
When creating a new data provider collection for a uiComponent, what class must you extend?
Respuesta
  • Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult
  • Magento\Framework\View\UiComponent\ViewCollection
  • Magento\Framework\ViewDataProvider\UiComponent\CollectionProvider
  • Magento\Framework\UiComponent\ComponentCollection

Pregunta 4

Pregunta
You are tasked with creating a widget that will render a product’s price using the Magento price rendering system. How do you do this?
Respuesta
  • Retrieve the product.price.render.default block and call the render method.
  • Use the protected property, $priceRenderer injected in the $context in the Template.
  • Trigger the catalog_product_render_price event, attaching the product as event data.
  • Use dependency injection to get an instance of the Magento\Framework\Pricing\Renderer class and call the renderPrice method.

Pregunta 5

Pregunta
What must be done differently to properly generate a URL in the Magento backend?
Respuesta
  • Generate the URL from an instance of \Magento\Backend\Model\UrlInterface.
  • Ensure that the controller is configured for the correct ACL path.
  • Instead of calling the getUrl() method, you must call the getBackendUrl() method
  • Nothing: generating URLs in the frontend and backend are the same.

Pregunta 6

Pregunta
You need to add a residential / commercial destination selector to the shipping address on the checkout.What are the steps needed to add this selector? 2
Respuesta
  • Add new column to the sales_order_address table.
  • Create a checkout_index_index.xml file and add the uiComponent details.
  • Add a Javascript mixin to render the selector.
  • Override \Magento\Block\Checkout\ShippingAddress and add a getter for the selector value.

Pregunta 7

Pregunta
Keeping maintainability in mind, how do you add a new link to the customer account sidebar?
Respuesta
  • Create customer_account.xml and add a block to the customer_account_navigation.
  • Create a plugin for the customer Navigation class.
  • Create customer_account_index.xml and add the link to the uiComponent configuration in jsLayout
  • Create customer_account_index.xml and add a block to the sidebar container.

Pregunta 8

Pregunta
You need to implement a fallback for VAT ID validation to prevent downtime should the validator service be unavailable. How do you add the fallback?
Respuesta
  • Create an after plugin for Magento\Customer\Model\Vat::checkVatNumber method.
  • Override the Magento\Quote\Model\VatValidator::validate method.
  • Observe the customer_validate_vat_id_after event.
  • Change the Stores > Configuration > Customer > VAT Validation Fallback method to be “Regex”

Pregunta 9

Pregunta
You need to add a date column to a uiComponent in a Magento admin grid. What three actions must you take to successfully implement this? 3
Respuesta
  • Specify the Date module for the class attribute.
  • Set the date type for the dataType setting.
  • Specify the date component for the component attribute.
  • Utilize the date node type.
  • Add a data/config/dateFormat node.

Pregunta 10

Pregunta
You have created a custom customer attribute that displays the last time that the customer made a purchase, stored in UTC. This attribute needs to be visible in the Customer grid. The column is visible, but, when it is loaded, only the date is visible—not the time. You have verified that both the date and time are stored in the database. Keeping user experience in mind, what is the solution?
Respuesta
  • Add a new column to the customer_listing uiComponent and specify the date column type.
  • Override the customer uiComponent data provider and format the data as a string.
  • Change the backend_type from date to datetime.
  • Set the grid_column_type to be datetime in the customer_eav_attribute table.

Pregunta 11

Pregunta
A root category is associated with which scope:
Respuesta
  • Store
  • Website
  • Global
  • Store View

Pregunta 12

Pregunta
You wish to create a custom 404 page that only displays for specific URLs. This was necessary because of the Magento 1 to Magento 2 migration and the need to redirect URLs from the old site to the new site. This custom 404 page should only appear once all other routers have not matched the URL. Keeping maintainability in mind, how do you implement this?
Respuesta
  • Create a router that watches for the noroute action; if it matches, forward the front controller to a custom controller.
  • Create a plugin for the dispatch method in vendor/magento/framework/App/FrontController.php.
  • Create an observer for the front_controller_match_after event.
  • Create a layout XML file cms_noroute_index.xml and place updates in it.

Pregunta 13

Pregunta
When should static files be placed in a theme rather than in a specific module?
Respuesta
  • When the files are general files that affect all the pages (ex: logo image).
  • When the files apply to a specific application feature (ex: price box size on the product view page).
  • It is better to place all static files in a module rather than in a theme – it makes the overall structure better.
  • It is better to place all static files in a theme rather than in a module, as having all the files in one place makes them easier to manage.

Pregunta 14

Pregunta
You wish to create a new router which below steps are need ? (select 3)
Respuesta
  • Inject new item under routerList argument of Magento\Framework\App\RouterList type via di.xml
  • Create router file (by using match method implements \Magento\Framework\App\RouterInterface).
  • Return instance of \Magento\Framework\App\ActionInterface
  • inject an instance of \Magento\Framework\Event\ManagerInterface into constructor

Pregunta 15

Pregunta
What ways are possible to wrap a block with an HTML tag? 2
Respuesta
  • Layout XML container
  • Add the tag to the template.
  • Listen to the core_block_html_output_after event.
  • Add a plugin for the afterHtml method.

Pregunta 16

Pregunta
You are adding an extension attribute to the CustomerInterface class. You have specified data for the extension attribute, but when you check the database, nothing has been saved. Why is that?
Respuesta
  • Extension attribute data is not automatically persisted to the database.
  • You need to ensure that the extension attribute getter and setter exists in CustomerExtensionInterface.
  • You need to add a <persist/> node to the extension attribute XML details.
  • The appropriate columns in customer_entity have not been created.

Pregunta 17

Pregunta
You are creating a new store configuration entry. As part of the requirements, this entry must only be visible in the global and website scopes. What is the purpose of this limitation?
Respuesta
  • A primary use of the global and website scopes is to enable/disable features.
  • The global and website scopes cannot be overridden by store scopes.
  • The store scope is only available when a specific store is selected.
  • The store scope must have a default value set—no default value is appropriate here.

Pregunta 18

Pregunta
You are connecting Magento customers with a Customer Relationship Manager (CRM). You need to associate each customer’s CRM unique ID, CRM notes and a list of their current opportunities. This information must always available for each Customer object. You have configured the interface, class implementation and set up extension_attributes.xml What two steps remain to access this data? 2
Respuesta
  • Use after plugins in customer repository and collection.
  • Ensure the extension attributes property is an object.
  • Specify a extensionAttributeLoader in the db_schema.xml
  • Create an observer for the customer_load_after event.

Pregunta 19

Pregunta
You are assisting a merchant setting up a Cart Price Rule. They wish to apply free shipping to specific items in the cart (and not the entire cart). How do you implement the filter for the specific products?
Respuesta
  • Create Conditions rules for the specific requirements.
  • Use the Actions rules for the specific requirements.
  • Add a Product filter to the Apply To rules for the specific requirements.
  • This is not possible without a 3rd-party customization.

Pregunta 20

Pregunta
You are tasked with creating a new EAV attribute. What steps do you take to be able to call the addAttribute method? 2
Respuesta
  • Create a new data patch.
  • Inject and use an instance of EavSetup.
  • Utilize the module’s UpgradeData class.
  • Use the ModuleDataSetup class.

Pregunta 21

Pregunta
You are customizing a Magento website that will be connected to an ERP through the REST API. Also on this website, you have written a way for a customer to add comments to the order. These comments need to be sent to the ERP. Keeping maintainability in mind, how do you accomplish this?
Respuesta
  • Add an extension attribute to OrderInterface
  • Create a new REST API endpoint to fetch the comments per order.
  • Ensure the comments key is in the Order model’s $data array.
  • Override the Order model to add a getComments method.

Pregunta 22

Pregunta
How do you make a new category attribute available to be edited in the admin panel?
Respuesta
  • Add the new attribute to the category_form.xml uiComponent.
  • This is done automatically.
  • Create a plugin for the `Form` class that renders the category form and add the extra field.
  • In the data setup script, add the attribute to the category's default attribute set.

Pregunta 23

Pregunta
You have injected \Magento\Framework\Api\SearchCriteria into the constructor method. You then wrote the following code in a method: 1: $search = $this->searchCriteria->setSortOrders([‘entity_id ASC’]); 2: $this->productRepository>getList($search); When running this code, you get an error: Fatal error: Uncaught TypeError: Argument 1 must be an instance of SortOrder, string given. What are two errors present in the examples given?
Respuesta
  • Sort order should not be specified as a string.
  • SearchCriteriaBuilder should be used instead of SearchCriteria.
  • One line 2, when loading $search, you need to use $search->getCriteria().
  • Sort orders must be added one at a time with the addSortOrder method.

Pregunta 24

Pregunta
You need to locate several products. You run this code: $productRepository->getList($criteriaBuilder->addFilter(‘type_id’, ‘bundle’)->getItems(); However, you get an error: Type SearchCriteriaInterface expected. What is the solution?
Respuesta
  • Call the ->create() method after addFilter().
  • Run bin/magento setup:di:compile.
  • Create a custom wrapper for SearchCriteriaBuilder to utilize classes in your module.
  • Don’t use a SearchCriteriaBuilder. Instead, inject a SearchCriteriaInterface.

Pregunta 25

Pregunta
For fraud prevention purposes, you need to notate the IP address from which a user adds an item to their cart. Which event will allow you access to every cart addition?
Respuesta
  • sales_quote_add_item
  • sales_quote_product_add_after
  • checkout_cart_add_product_complete
  • cart_add_item_after

Pregunta 26

Pregunta
You are building a customization for Magento sites that must change the template for the customer account order history view. How do you accomplish this?
Respuesta
  • Override \Magento\Sales\Block\Order\History and specify a new $_template variable.
  • In sales_order_history.xml add: <referenceBlock name=”sales.order.history”><arguments><argument name=”template” xsi:type=”string”>...</argument></arguments>
  • Create an after plugin for the \Magento\Sales\Block\Order\History::setTemplate.
  • In sales_order_history.xml add: <referenceBlock name=”sales.order.history” template=”...”/>

Pregunta 27

Pregunta
Front Controller: Creating the List of Routers . Where is located in <magento_installation_dir>-----?
Respuesta
  • /lib/internal/Magento/Framework/App/FrontController.php
  • /app/code/Magento/Framework/App/FrontController.php
  • /vendor/Magento/Framework/App/FrontController.php
  • /app/design/Magento/Framework/App/FrontController.php

Pregunta 28

Pregunta
What is the default router in Magento 2?
Respuesta
  • Magento\Framework\App\Router\DefaultRouter
  • Magento\Core\App\Router\Base
  • Magento\Cms\Controller\Router
  • Magento\UrlRewrite\Controller\Router
  • Magento\DesignEditor\Controller\Varien\Router\Standard

Pregunta 29

Pregunta
Where CMS router, which processes CMS pages in Magento 2.?
Respuesta
  • Magento\Cms\Controller\Router
  • Magento\UrlRewrite\Controller\Router
  • Magento\DesignEditor\Controller\Varien\Router\Standard
  • Magento\Framework\App\Router\DefaultRouter

Pregunta 30

Pregunta
URL Processing: Base Router URL Composition For example, the URL: http://magento-installation.com/catalog/product/view/id/1 Write structure of the URL, as accepted by the router?
Respuesta
  • $baseUrl/$frontName/$controllerName/$actionName/$otherParams
  • $baseUrl/$controllerName/$frontName/$actionName/$otherParams
  • $baseUrl/$frontName/$routerName/$actionName/$otherParams
  • $baseUrl/$frontName/$modelName/$actionName/$otherParams
Mostrar resumen completo Ocultar resumen completo

Similar

PROFESSIONAL DEVELOPER TEST POOL-1 (MAGENTO 2 CERTIFIED )
Miska Red
SOLUTION SPECIALIST TEST-01 (MAGENTO 2 CERTIFIED )
Miska Red
Cloud Developer Exam Test-01(MAGENTO 2 CERTIFIED Professional )
Miska Red
PROFESSIONAL DEVELOPER TEST POOL-1 (MAGENTO 2 CERTIFIED )
Станислав Матявин
Magento 2 Cloud
Oleksiy P
PROFESSIONAL DEVELOPER TEST POOL-1 (MAGENTO 2 CERTIFIED )
Dario Dorfelli
MAGENTO 2 CERTIFIED SOLUTION SPECIALIST PRACTICE TEST
Pankaj Sharma
PROFESSIONAL DEVELOPER TEST POOL-1 (MAGENTO 2 CERTIFIED )
test test
SOLUTION SPECIALIST TEST-01 (MAGENTO 2 CERTIFIED )
Khrystyna Balog
Magento 2 Certified Professional Front End Developer Exam Questions
Benoit Alix
ÁFRICA
Ulises Yo