Exam4Training

Adobe AD0-E709 Adobe Commerce Developer Expert Online Training

Question #1

When paying by Bank Transfer, there is a requirement to send an email to customer service with payment details, after the order is placed successfully.

Which two events can be used to send an email during the order placement process? (Choose two.)

  • A . sales_order_payment_pay
  • B . sales_model_service_auote_submit_before
  • C . sales_model_service_quote_submit_success
  • D . sales_order_place_after

Reveal Solution Hide Solution

Correct Answer: A,D
Question #2

Which two techniques can be used to protecta storefront POST action against Cross Site Request Forgery (CSRF) attacks? (Choose two.)

  • A . The form sending data to that action needs to include a fornjtey parameter with a valid form key and the action must instantiateManentoFramworkDataForumKeyFormkeyValidator validate it.
  • B . The action needs to implement MgentoFrameworkAppCSrfAwareActioninterface and include the validateForCsrf method implementing the actual protection logic.
  • C . The form sending data to that action needs to include a form_key parameter with a valid form key which will automatically be used in a built-in CSRF validation.
  • D . The action needs to implement
    MagentoFrameworkAppActionvHttpPosTActioninterface to trigger built-in CSRF
    validation.

Reveal Solution Hide Solution

Correct Answer: B,D
Question #3

An Adobe Commerce developer has been asked to modify the PageBuilder slider content type to allow a new custom content type (other than slide) to be assigned as a child. The developer has already created the new content type called improved.slider_slide their module. They now need to create a new view/adminhtml/pagebuilder/content_type/slider.xml file in their module to allow the new content type to be a child of slider content types.

What is the correct xml to accomplish this?

A)

B)

C)

  • A . Option A
  • B . Option B
  • C . Option C

Reveal Solution Hide Solution

Correct Answer: A
Question #4

When creating a new payment method, the Adobe Commerce developer adds the dependency injection configuration for payment method facade in the modules etcdi.xml.

What is required for the custom payment methods Value Handlers pool?

  • A . A default handler must be defined.
  • B . A country handler must be defined
  • C . An offline payment handler must be defined.

Reveal Solution Hide Solution

Correct Answer: B
Question #5

An Adobe Commerce Developer has created a new custom block extending MagentoFrameworkviewElementAbstractBlock and has set the cache_lifetime data property for the block so that the output gets cached.

The block is inserted into the sidebar, and displays differing content depending on which currency is being used. The developer finds that the block is displaying the same content for all currencies, depending on which currency is viewed first after the cache has been flushed.

How would the developer resolve this?

  • A . Implement the MagentoFrameworkDataObjectldentityinterface class, as well as a getldentities() method, returning the current currency code.
  • B . Override the getCacheKeyinfo() function adding the current currency code to the returned array.
  • C . In the constructor, add the current currency code as a cache tag using $thismetaDataCcache_tags’’, CURRENCY_CODE ]) .

Reveal Solution Hide Solution

Correct Answer: B
Question #6

An Adobe Commerce developer has a requirement to add some settings which are unique to a specific system and it will be dumped to app/etc/env.php when theCLI command php bin/magento app:config:dump is used.

How would the developer achieve this?

A)

B)

C)

  • A . Option A
  • B . Option B
  • C . Option C

Reveal Solution Hide Solution

Correct Answer: B
Question #7

An Adobe Commerce developer has created a before plugin for the save () function within the magentoFrameworkAppCacheProxy class. The purpose of this plugin is to add a prefix on all cache identifiers that fulfill certain criteria.

Why is the plugin not executing as expected?

  • A . Another around ptugm defined for the same function does not call the callable.
  • B . Cache identifiers are immutable and cannot be changed.
  • C . The target class implements MagentoframeworKObjectManagerNointerceptablelnterface .

Reveal Solution Hide Solution

Correct Answer: C
Question #8

An Adobe Commerce developer wants to cover their custom modules with Integration Tests. However, the project they are working on includes a 3rd party module that introduces a new search engine which needs to be used in Integration Tests as well. To do so. catalog/search/engine in the core.config_data table needs to be set to the customSearchEngine on the default scope.

Theyalready created a phpunit.xml file in [m2 base dir/dev/tests/integration by copying unmodified content of phpunit.xml.dist from the same directory and will be using it for their tests.

How do they make sure that this setting is used for all the Integration Tests in their project using best practices?

  • A . Modify the phpunit.xml file they will be using and add the following node inside the phpunit node:

  • B . Modify or create a magento base dir] dev/test/integration/etcconfig-global.php file and ensure that it contains the following content:

  • C . Include the following annotationin class-level docboack for event integration test class in the project:

Reveal Solution Hide Solution

Correct Answer: B
Question #9

An Adobe Commerce developer has been tasked to create a new rest API endpoint to get a list of items for a CustomEntity. When testing the endpoint, it throws an exception.

This is the code the developer has written forMyVendorModuleApiCustomEntityRepositoryInterface:

And this is the implement method within MyVendorMyModulemodelCustomEntityRepository:

What is wrong with the code?

  • A . The @return annotation is missing in the MyVendorMyModuleApiCustomEntityRepositoryInterface::getList function.
  • B . The implemented getlist function is returning an array, it should return an instance of MyVendorMyModuleApiDataCustomerEntitySearcResultslnterface .
  • C . MagentoFrameworkApiSerchCriteriaInterface $searchCriteria is not a valid parameter for the getList function.

Reveal Solution Hide Solution

Correct Answer: C
Question #9

An Adobe Commerce developer has been tasked to create a new rest API endpoint to get a list of items for a CustomEntity. When testing the endpoint, it throws an exception.

This is the code the developer has written forMyVendorModuleApiCustomEntityRepositoryInterface:

And this is the implement method within MyVendorMyModulemodelCustomEntityRepository:

What is wrong with the code?

  • A . The @return annotation is missing in the MyVendorMyModuleApiCustomEntityRepositoryInterface::getList function.
  • B . The implemented getlist function is returning an array, it should return an instance of MyVendorMyModuleApiDataCustomerEntitySearcResultslnterface .
  • C . MagentoFrameworkApiSerchCriteriaInterface $searchCriteria is not a valid parameter for the getList function.

Reveal Solution Hide Solution

Correct Answer: C

Question #9

An Adobe Commerce developer has been tasked to create a new rest API endpoint to get a list of items for a CustomEntity. When testing the endpoint, it throws an exception.

This is the code the developer has written forMyVendorModuleApiCustomEntityRepositoryInterface:

And this is the implement method within MyVendorMyModulemodelCustomEntityRepository:

What is wrong with the code?

  • A . The @return annotation is missing in the MyVendorMyModuleApiCustomEntityRepositoryInterface::getList function.
  • B . The implemented getlist function is returning an array, it should return an instance of MyVendorMyModuleApiDataCustomerEntitySearcResultslnterface .
  • C . MagentoFrameworkApiSerchCriteriaInterface $searchCriteria is not a valid parameter for the getList function.

Reveal Solution Hide Solution

Correct Answer: C
Question #9

An Adobe Commerce developer has been tasked to create a new rest API endpoint to get a list of items for a CustomEntity. When testing the endpoint, it throws an exception.

This is the code the developer has written forMyVendorModuleApiCustomEntityRepositoryInterface:

And this is the implement method within MyVendorMyModulemodelCustomEntityRepository:

What is wrong with the code?

  • A . The @return annotation is missing in the MyVendorMyModuleApiCustomEntityRepositoryInterface::getList function.
  • B . The implemented getlist function is returning an array, it should return an instance of MyVendorMyModuleApiDataCustomerEntitySearcResultslnterface .
  • C . MagentoFrameworkApiSerchCriteriaInterface $searchCriteria is not a valid parameter for the getList function.

Reveal Solution Hide Solution

Correct Answer: C
Question #9

An Adobe Commerce developer has been tasked to create a new rest API endpoint to get a list of items for a CustomEntity. When testing the endpoint, it throws an exception.

This is the code the developer has written forMyVendorModuleApiCustomEntityRepositoryInterface:

And this is the implement method within MyVendorMyModulemodelCustomEntityRepository:

What is wrong with the code?

  • A . The @return annotation is missing in the MyVendorMyModuleApiCustomEntityRepositoryInterface::getList function.
  • B . The implemented getlist function is returning an array, it should return an instance of MyVendorMyModuleApiDataCustomerEntitySearcResultslnterface .
  • C . MagentoFrameworkApiSerchCriteriaInterface $searchCriteria is not a valid parameter for the getList function.

Reveal Solution Hide Solution

Correct Answer: C
Question #14

Implement the getidentities() method to return the concatenation of a chosen key and the id of the entity.

Reveal Solution Hide Solution

Correct Answer: A,C
Question #15

An Adobe Commerce developer is working on a module to manage custom brand entities and wants to replicate the following SQL query using SearchCriteria:

Which snippet of code would produce the desired SQL query?

A)

B)

C)

  • A . Option A
  • B . Option B
  • C . Option C

Reveal Solution Hide Solution

Correct Answer: A
Question #16

An Adobe Commerce developer is tasked to add a file field to a custom form in the administration panel, the field must accept only .PDF files with size less or equal than 2 MB.

So far the developer has added the following code within the form component xmlfile, inside the filedsetnode:

How would the developer implement the validation?

A)

B)

C)

  • A . Option A
  • B . Option B
  • C . Option C

Reveal Solution Hide Solution

Correct Answer: A
Question #17

An Adobe Commerce developer has created a new shipping carrier.

Everything has been implemented and the collectRates() and getAlloweMethods() functions can be seen below:

  • A . Given the above code, what would be the displayed cost of the shipping method and final amount charged to the customer?
  • B . The shipping method would display $0 but customers would pay a $10 handling fee for their order.
  • C . The shipping method would display $10 and customers would pay $10 for using the new shipping method.
  • D . The shipping method would display SO and customers would pay $0 for using the new shipping method.

Reveal Solution Hide Solution

Correct Answer: A
Question #18

An Adobe Commerce developer is creating a module (Vendor_ModuleName) to be sold on

the Marketplace. The new module creates a database table using declarative schema and now the developer needs to make sure the table is removed when the module is disabled.

What must the developer do to accomplish this?

  • A . Add a schema patch thatimplements MogentoFrameworkSetupPatchPatchRevertableInterface and drops the table in the revert function.
  • B . There is nothing further the developer needs to do. The table will be removed when the when bin/magento module:uninstall Vendor_ModuleName is run.
  • C . There is nothing further the developer needs to do. The table will be removed when the module is disabled and bin/Magento setup :upgrade is run.

Reveal Solution Hide Solution

Correct Answer: C
Question #19

An Adobe Commerce developer is asked to restrict access onboth the admin menu item Custom_Reports: :Financial and the admin pagecustomreport/financial/index attached to the menu.

The developer has added the resource Customreports/financial in etc/ael.xml. and the following code on etc/adninhtml/nenu.xml :

Given that const ADMIN_RESOURCE was NOT set on the controller of customreports-financial/index and the secret key is not enabled in the URL which users can access the page?

  • A . Only admin users with Custom_Reports::financial resource access.
  • B . Only admin users with ALL resources access.
  • C . All admin users.

Reveal Solution Hide Solution

Correct Answer: A
Question #20

An Adobe Commerce developer wants to add a custom product attribute to the website which will sync to their ERP.

The developer has created a data patch and added the following code to add the attribute:

The attribute is created successfully and it is listed in the attribute grid. But on the website, there are multiple attribute sets and the developer wants the newly created attribute to be visible in all the attribute sets.

In order to set the attribute to all the attributes sets, how will the developer change the code to add the attribute?

  • A . Add a property ‘group’ => ‘General’ in the add Attribute method.
  • B . Add a property attribute. group’ => ‘general’ in the add Attribute method.
  • C . Add a properly ‘attribute. set’ -> ‘all’ in the add Attribute method.

Reveal Solution Hide Solution

Correct Answer: A

Question #21

An Adobe Commerce developer creates a new website using a data patch. Each website will have unique pricing by website. The developer does not have visibility into the production and staging environments so they do not know what the configuration currently is.

How would they ensure the configuration is deployed and consistent across all environments?

  • A . Create a custom module and override the value in config.xml:

  • B . Run the CLI command below and commit the changes to the repository;

  • C . Run the CLI command below and commit the changes to the repository:

Reveal Solution Hide Solution

Correct Answer: B
Question #22

An Adobe Commerce Developer is tasked with writing an importer for a custom entity. After the work is complete and deployed, they start receiving complaints from their client that the importer does not work and fails every time they use it.

The developer realizes that the client is importing a file which does not match the format required for the importer to process correctly.

What two features would the developer add to this importer to prevent this? (Choose two.)

  • A . Set up an example file and inject it into the ExampleFileProvider .
  • B . Set up a try/catch in the importer to display a warning the file is not in the correct format.
  • C . Set up validation by implementing a validateRow method in their importer.
  • D . Set $needColumnCheck = true; and add column names to the $validColumnNames class properties.

Reveal Solution Hide Solution

Correct Answer: C,D
Question #23

A message queue currently has queue/consumer-wait-for-messages set to true, which allows the consumer process to run until a message is inserted into the queue. A piece of functionality is driven by data stored in the model.MagentoVariable\Modelvariable and this value is only loaded once during the consumer run. If the variable is updated we want the consumer to restart so that the new value is loaded into memory without having to reload the variable on each message consumed.

The Adobe Commerce developer has created an after plugin on the Magentovariablevariable::save() function.

How would the developer use the plugin to trigger the consumer restart?

  • A . Set the global cache key trigger_consumer_resart to 1.
  • B . Call the function MagentoFrameWorkMessageQueueConstomers triggerRest art Interface: trigger () .
  • C . Call the function MagentoFrameworkMessageQueuePoisonPillPoisoninterface::put() .

Reveal Solution Hide Solution

Correct Answer: A
Question #24

An Adobe Commerce developer added a new API method to search and retrieve a list of Posts for a custom Blog functionality.

This is the content of the module’s etc/webapi.xml file:

The new code has been deployed to production and the merchant is using https: //merchant.domain.com/swagger to review the new endpoint, but it is not visible in swagger.

What would be a reason for this?

  • A . Since the new endpoint is not anonymous, the merchant needs to enter a valid integration token in swagger in order to see the new method.
  • B . The webapi.xml file should be moved into the etc/webapi_rest/webapi.xml file.
  • C . The @return annotation is missing in the MyVendorBlogApiPost Repositoryinterfacec

Reveal Solution Hide Solution

Correct Answer: B
Question #25

A client has requested a new field on the admin product edit page for simple products that displays a list of links to parent products to which the simple product belongs.

According to best practices, how would an Adobe Commerce developer implement this?

  • A . Add a customblock to the layout handle catalog_product_edit that displays in the content and display the links m a template file.
  • B . Utili2e a product creation form modifierclass that extends the class MagentoCatalogUiDataProviderSProductFornModifierADstractNodifier .
  • C . Extend the Ul component defined in proauct_fom.Mil and add the field with a custom class.

Reveal Solution Hide Solution

Correct Answer: B
Question #26

A logistics company with an Adobe Commerce extension sends a list of reviewed shipment fees to all its clients every month in a CSV file. The merchant then uploads this CSV file to a "file upload" field in admin configuration of Adobe Commerce.

What are the two requirements to display the "file upload’ field and process the actual CSV import? (Choose two.)

  • A . Create an observer that listens to the adminhtml_config_system_save_after

  • B . Add a new field in etc.adminhtml/system.xml in my_Module with the file type:

  • C . Add a custom backend model which extends /MagentoFrameworkAppConfigValue and call afterSave:

  • D . Add a new field in etc/adminhtmlsystem.xml in My_Module with a new custom type:

Reveal Solution Hide Solution

Correct Answer: B,C
Question #27

There is an integration developed using a cron service that runs twice a day. sending the Order ID to the integrated ERP system if there are orders that are able to create an invoice. The order is already loaded with the following code:

$order =$this->orderRepository->get($orderid);

In order to verify if the store has invoices to be created, what implementation would the Adobe Commerce developer use?

A)

B)

C)

  • A . Option A
  • B . Option B
  • C . Option C

Reveal Solution Hide Solution

Correct Answer: B
Question #28

An Adobe Commerce developer is tasked with adding an new export option for the order grid, they have added the following code for the export button within sales_order_grid.xml

Upon testing, they are getting redirected, what would be a cause for this error?

  • A . The Layout cache needs to be refreshed.
  • B . The developer has to add a formkey for the new export option.
  • C . The option’s url attribute is not valid.

Reveal Solution Hide Solution

Correct Answer: B
Question #29

An Adobe Commerce developer has added an iframe and included a JavaScript library from an external domain to the website.

After that they found the following error in the console:

Refused to frame IURLJ because it violates the Content Security Policy directive.

In order to fix this error, what would be the correct policy ids to add to the csp_whitelist.xmi file?

  • A . default-src and object-src
  • B . frame-src and script-src
  • C . frame-ancentors and connect-src

Reveal Solution Hide Solution

Correct Answer: A
Question #30

A Data Patch in a module being investigated implements MagentoFrameworkSetupPatchPatchversionlnterface and contains a getversion method which returns the string ‘2.4.2’.

What is the implication of this when php bin/magento setup:upgrade is run?

  • A . The patch will only apply if the version specified in the data_version column of the setbpjnodule table for our module is lower than ‘2.4.2’.
  • B . The patch will only apply if the version specified in the data_version column of the setup_module table for our module is higher than ‘2.4.2’.
  • C . The patch will only apply if the current version of the Magento Framework is ‘2.4.2’, and likely contains code that is incompatible with later versions.

Reveal Solution Hide Solution

Correct Answer: A

Question #31

CORRECT TEXT

An Adobe Commerce developer wants to generate a list of products using ProductRepositoryinterface and search for products using a supplier_id filter for data that is stored in a standalone table (It. not in an EAV attribute).

Keeping maintainability in mind, how can the developer add the supplier ID to the search?

  • A . Add a custom filter to the virtual type
  • B . MegentoCatalogmodelApiSearchCriteriaCollectionProfessorProductFilterProcessor for supplier_id field. In the custom filter, apply the needed join and filter to the passed $collection.
  • C . Write a before plugin on MagentoCotalogModelProductRepository: getlist()and register the search criteria passed. Write an event observer to listen for the event catalog_product_collection_load_before – Iterate through the registered search criteria, and if found, apply the neededjoin and filter to the event’s $collection .
  • D . Write a before plugin on MagentoFremeworkapiSearchCriteriaCollectionProcessorinterface::process() . Iterate through the $searchCriteria provided for supplier_id, and if found, apply the neededjoin and filler to the passed $collection .

Reveal Solution Hide Solution

Correct Answer: B
Question #32

An Adobe Commerce developer has created a process that exports a given order to some external accounting system. Launching this process using the Magento CLI with the command php bin/tagento "/.module:order:process –oruer_id-<order_id> is required. Example: php bin/magento ny_module:order:proeess –order_id=1245.

What is the correct way to configure the command?

A)

B)

C)

  • A . Option
  • B . Option
  • C . Option

Reveal Solution Hide Solution

Correct Answer: B
Question #33

An Adobe Commerce developer is asked to implement a 15% surcharge for all users from a Wholesale’ customer group.

Keeping best practices in mind, what is a correct way to accomplish this?

  • A . Create a Cart Price Rule that applies only to the "Wholesale’ group. Specify no conditions for the rule, and in the Actions section, specify for the rule to apply a "Percent of product price discount", with the Discount Amount’ field set to -15 .
  • B . Create an Observer to the catalog_product_get_final_price event. Check if the current customer is in the ‘Wholesale’ group, and if so. retrieve the product from the $product->setEvent() data and call
    4product->set0ata(‘final_price’, $product->getData(‘final_price") ‘’ 1.15) .
  • C . Declare a new total collector class to calculate the modified total if the current user is in the group, register it in the module’s etc/sales.xml file, modify the checkout_cart_index.xmland checkout_index_index.xml layouts to include a new child in
    the totals block.

Reveal Solution Hide Solution

Correct Answer: C
Question #34

An Adobe Commerce developer is asked to change the tracking level on a custom module for free downloading of pdf and images.

How will he developer configure tracking_level parameter, in di,xml to have a value of 4 for Download class and classes that extend Download?

  • A . Configure the parameter on the all child classes and set the parent attribute on one of them.

  • B . Configure the parameter on parent class, as it will be propagated on descendant classes.

  • C . Configure the parameter on a child class and add parent attributes as it will be propagated to siblings and parent.

Reveal Solution Hide Solution

Correct Answer: A
Question #35

An Adobe Commerce Developer wishes to add an action to a pre-existing route, but does not wish to interfere with the functionality of the actions from the original route.

What must the developer do to ensure that their action works without any side effects in the original module?

  • A . In the route declaration, use the before or after parameters to load their module in before or after the original module.
  • B . Inject the new action into the standard router constructor’s Sactionlist parameter.
  • C . Add the action into to the Controllers/front.name/ in My_Module. Magento will automatically detect and use it.

Reveal Solution Hide Solution

Correct Answer: A
Question #36

An Adobe Commerce Developer is tasked with creating a custom module which implements a new product type. Upon completion, they find that any quantity information they enter against the product does not get saved, and reverts back to 0.

How would they go about correcting this?

  • A . In the modules ete/product_types.xml file, set the isQty-"true" property on their product type declaration node.
  • B . Add a <stockmodel> node inside their product type declaration in the etc/product_types.xml file, with an instance attribute pointing a class extendingMagentoCatalogModelProducttypeStock .
  • C . Implement MagentoInventoryCatalogApiApiDefaultStockProviderlnterface on their product type class and implement the required methods.

Reveal Solution Hide Solution

Correct Answer: A
Question #37

An Adobe Commerce developer is tasked with adding custom data to orders fetched from the API While keeping best practices in mind, how would the developer achieve this?

  • A . Create an extension attribute on MagentoSelesApiDataOrderInterface and an after plugin on MagentoSalesModelOrder: :getExtensionAttributes() to add the custom data.
  • B . Create a before plugin on MagentoSalesModelResourceModeOrderCollection:: load and alter the query to fetch the additional data. Data will then be automatically added to the items fetched from the API.
  • C . Create an extension attribute on MagentoSalesApIDataOrderinterface and an after plugin on MagentosalesApiorderRespositoryinterface on get() and getlist () to add the custom data.

Reveal Solution Hide Solution

Correct Answer: A
Question #38

An Adobe Commerce developer is developing a custom module. As part of their implementation they have decided that all instances of their CustomModuleModelExample class should receive a new instance of MagentoFilestemadapterlocal.

How would the developer achieve this using di. xml?

A)

B)

C)

  • A . Option A
  • B . Option B
  • C . Option C

Reveal Solution Hide Solution

Correct Answer: A
Question #39

A customer is creating a new website, store and store view that will have a new category structure.

How would an Adobe Commerce developer implement this?

  • A . All stores have unique category structures, select which root category to duplicate to the new store during creation.
  • B . Create a new root category in the admin and then select it when creating the website.
  • C . Create a new root category in the admin and then select it when creating the store.

Reveal Solution Hide Solution

Correct Answer: A
Question #40

An Adobe Commerce developer is developing a class that is executed in both the frontend and crontab areas. When executed in the frontend MagntoCustomerModelsession::getCu5tonteria() is called but when executed in the crontab this section of code is skipped.

Keeping performance and best practices in mind, what would be the best approach to achieve this?

  • A . Inject the MagentoCustomerModelSessionProxy class in the constructor of their class and call the getCustomer id function wherever required in the class.
  • B . Declare MagentoCustomerModelSession in the constructor dependency of their class and declare a proxy in the di.xml. Then call the getCustomerid function wherever required in the class.
  • C . Declare MagentoCustomerModel.session in the constructor of their class dependency and call the getCustomrid() function wherever required.

Reveal Solution Hide Solution

Correct Answer: B

Question #41

When building a custom page we need to get a collection of data. To determine how many items are in this collection, the Adobe Commerce developer uses $collection->count() . This sometimes is slow and causes some delay.

What is the reason?

  • A . The collection is loaded first and then the number of items in the collection are returned.
  • B . Before the collection is loaded, the framework performs left joins for all related attributes
    are added to the query.
  • C . The framework internally uses SELECT count(-) and that is slower than loading the collection.

Reveal Solution Hide Solution

Correct Answer: B
Question #42

The developer is required to convert a modules database scripts from old install/upgrade setup files to a data patches format and does not want to apply database changes that were already done by install/upgrade scripts.

The current module version is 1.5A

What would be the recommended solution to skip changes that were already applied via old format (install/upgrade scripts)?

  • A . This is not possible. A module cannot implement both data patch and install scripts.
  • B . Inside apply() method, check for module version and run the code it version is less than 134,
  • C . Implement PatchVersioninterface and return 1.5.4 on the getversion() method.

Reveal Solution Hide Solution

Correct Answer: C
Question #43

An Adobe Commerce Developer is tasked with creating a module which generates a sitemap by cron. While writing the module, they realize they will need to use environment emulation to ensure the data is generated from a frontend perspective. They notice that the Emulation: :startEnvironmentEmulation() method accepts a $force parameter.

Why would this be set to true?

  • A . To reset the environment emulation configuration to the current store.
  • B . To emulate a new environment while already emulating a different one.
  • C . To ignore any exceptions which may otherwise get thrown during emulation.

Reveal Solution Hide Solution

Correct Answer: A
Question #44

There is the task to create a custom product attribute that controls the display of a message below the product title on the cart page, in order to identify products that might be delivered late.

The new EAV attribute is.deloyed has been created as aBooleanand is working correctly in the admin panel and product page.

What would be the next implementation to allow the is_delayed EAV attribute to be used in the .phtml cart page such as $Block->getProduct()->getIsDelayed() ?

A)

B)

C)

  • A . Option A
  • B . Option B
  • C . Option C

Reveal Solution Hide Solution

Correct Answer: B
Question #45

An Adobe Commerce Developer is tasked with creating a custom form which submits its data to a (rontend controller. They have decided to create an action and have implemented themagntoFrameworkAppAction|HttpPostInterface class, but are not seeing the data being persisted in the database, and an error message is being shown on the frontend after submission.

After debugging and ensuring that The data persistence logic is correct, what may be cause and solution to this?

  • A . Magento does not allow POST requests to a frontend controller, therefore, the submission functionality will need to be rewritten as an API endpoint.
  • B . The developer forgot to implement a ValidatePostData() method in their action. They should implement this method: all non-validated POST data gets stripped out of the request and an error is thrown.
  • C . Form key validation runs on all non-AJAX POST requests, the developer needs to add the form_key to their requests.

Reveal Solution Hide Solution

Correct Answer: B
Question #46

A client wants to change the look and behavior of the products thumbnails in the products grid on the admin panel.

Which code would be added to the module’s view/adminhtml/ui_component/product_listing.xmlfile?

A)

B)

C)

  • A . option A
  • B . option B
  • C . option C

Reveal Solution Hide Solution

Correct Answer: A
Question #47

An integration named Marketing is created on the Adobe Commerce instance. The integration has access on Magento_Customer::customer resources and the access token is xxxxxx .

How would the rest API be called to search the customers?

  • A . Passing integration name and access token as http auth credentials:

  • B . Using integration name as username and access token as password, get the admin token
    (YYYYYY) via:

  • C . Using the integration access token as Bearer

Reveal Solution Hide Solution

Correct Answer: C
Question #48

When using the traditional Magento frontend, an Adobe Commerce developer is tasked to create a before plugin every time that the totals information loads on the cart page summary.

Considering performance, where would the di .xml be added?

  • A . etc/di.wni
  • B . etc/frontend/di.xml
  • C . etc/webapi_rest/di.xml

Reveal Solution Hide Solution

Correct Answer: B
Question #49

A product has some stock and quantity in the Sources panel in its edit view m the admin:

But when trying to add this product to the cart on the frontend. the following error is displayed:

"The requested qty is not available".

Why was this error received?

  • A . The sales channel tor the current website is disabled.
  • B . The total quantity of this product in all active quotes has reached its available stock.
  • C . The number of reservations for this product has already reached its available stock.

Reveal Solution Hide Solution

Correct Answer: C
Question #50

An Adobe Commerce developer adds a new extension attribute to add an array of values to the invoices that are fetched through the APIs.

After a while, their technical manager reviews their work and notices something wrong with the extension_attributes.xml file that the developer created in their module: extension_attributes for="MagentoSalesHotelOrderInvoiceRepository"> attribute code"my_code" type=string]’’> </extension_attribute>

What is the problem with this xml snippet?

  • A . The extension attribute references the repository instead of the interface it implements (MagentoSalesApiinvoiceRepositoryinteface
  • B . The type is wrong, string[] should be replaced with array.
  • C . The extension attribute references the wrong interface it should have referenced the MagentoSalesAPiInvoiceinterface.

Reveal Solution Hide Solution

Correct Answer: C

Question #50

An Adobe Commerce developer adds a new extension attribute to add an array of values to the invoices that are fetched through the APIs.

After a while, their technical manager reviews their work and notices something wrong with the extension_attributes.xml file that the developer created in their module: extension_attributes for="MagentoSalesHotelOrderInvoiceRepository"> attribute code"my_code" type=string]’’> </extension_attribute>

What is the problem with this xml snippet?

  • A . The extension attribute references the repository instead of the interface it implements (MagentoSalesApiinvoiceRepositoryinteface
  • B . The type is wrong, string[] should be replaced with array.
  • C . The extension attribute references the wrong interface it should have referenced the MagentoSalesAPiInvoiceinterface.

Reveal Solution Hide Solution

Correct Answer: C
Question #50

An Adobe Commerce developer adds a new extension attribute to add an array of values to the invoices that are fetched through the APIs.

After a while, their technical manager reviews their work and notices something wrong with the extension_attributes.xml file that the developer created in their module: extension_attributes for="MagentoSalesHotelOrderInvoiceRepository"> attribute code"my_code" type=string]’’> </extension_attribute>

What is the problem with this xml snippet?

  • A . The extension attribute references the repository instead of the interface it implements (MagentoSalesApiinvoiceRepositoryinteface
  • B . The type is wrong, string[] should be replaced with array.
  • C . The extension attribute references the wrong interface it should have referenced the MagentoSalesAPiInvoiceinterface.

Reveal Solution Hide Solution

Correct Answer: C
Question #50

An Adobe Commerce developer adds a new extension attribute to add an array of values to the invoices that are fetched through the APIs.

After a while, their technical manager reviews their work and notices something wrong with the extension_attributes.xml file that the developer created in their module: extension_attributes for="MagentoSalesHotelOrderInvoiceRepository"> attribute code"my_code" type=string]’’> </extension_attribute>

What is the problem with this xml snippet?

  • A . The extension attribute references the repository instead of the interface it implements (MagentoSalesApiinvoiceRepositoryinteface
  • B . The type is wrong, string[] should be replaced with array.
  • C . The extension attribute references the wrong interface it should have referenced the MagentoSalesAPiInvoiceinterface.

Reveal Solution Hide Solution

Correct Answer: C
Question #50

An Adobe Commerce developer adds a new extension attribute to add an array of values to the invoices that are fetched through the APIs.

After a while, their technical manager reviews their work and notices something wrong with the extension_attributes.xml file that the developer created in their module: extension_attributes for="MagentoSalesHotelOrderInvoiceRepository"> attribute code"my_code" type=string]’’> </extension_attribute>

What is the problem with this xml snippet?

  • A . The extension attribute references the repository instead of the interface it implements (MagentoSalesApiinvoiceRepositoryinteface
  • B . The type is wrong, string[] should be replaced with array.
  • C . The extension attribute references the wrong interface it should have referenced the MagentoSalesAPiInvoiceinterface.

Reveal Solution Hide Solution

Correct Answer: C
Question #55

Create a data patch copying those exceptions to their original destinations like vendor/magento/ framework /except Ion/ to replace original files.

Reveal Solution Hide Solution

Correct Answer: A,B
Question #56

An Adobe Commerce developer is being tasked with creating a new cron job to run a method that has already been written.

What are the minimally required steps to accomplish this?

  • A . Create crontab.xml and cron_groups.xml files to assign the new job to a cron group.
  • B . Create a crontab.xml file and set a schedule for the new cron job.
  • C . Create a crontab.xml file and a new system configuration in system.xml for the schedule.

Reveal Solution Hide Solution

Correct Answer: C
Question #57

An international merchant is complaining that changes are taking too long to be reflected on the frontend after a full product import.

Thinking it may be database issues, the Adobe Commerce developer collects the following entity counts;

• Categories: 900

• Products: 300k

• Customers: 700k

• Customer groups: 106

• Orders :1600k

• Invoices: 500k

• Creditmemos: 50k

• Websites: 15

• Stores: 45

What is a probable cause for this?

  • A . The combination of the number of orders, customers, invoices and creditmemos is too big. This leads to a huge amount of values being stored in the customer grid index which is too large to be processed at a normal speed.
  • B . The combination of the number of products, customer groups and websites is too big. This leads to a huge amount of values being stored in the price index which is too large to be processed at a normal speed.
  • C . The combination of the number of products, categories and stores is too big. This leads to a huge amount of values being stored in the flat catalog indexes which are too large to be processed at a normal speed.

Reveal Solution Hide Solution

Correct Answer: A
Question #58

An Adobe Commerce developer is being tasked with storing additional data for products added to the cart in the quote. A newcolumn should be added to the Quote_item table to store the value-Following best practices, how would the developer extend the database to accomplish this?

A)

B)

C)

  • A . Option
  • B . Option
  • C . Option

Reveal Solution Hide Solution

Correct Answer: A
Question #59

What are two functions of a resource model? (Choose two.)

  • A . It executes create, retrieve, update and delete actions for an entity
  • B . It loads lists of entity models
  • C . It is made available in the Magento API for the purpose of data manipulation
  • D . It maps an entity to one or more database rows

Reveal Solution Hide Solution

Correct Answer: A,D
A,D

Explanation:

https://devdocs.magento.com/guides/v2.4/architecture/archi_perspectives/persist_layer.ht ml

Question #60

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 which lists both configurable products with quantity 1 each
  • C . As one line item of the first product with quantity 2
  • D . As one line item of the second product with quantity 2

Reveal Solution Hide Solution

Correct Answer: A

Question #61

You need to add the Google Tag Manager (GTM) to every page.

What three steps do you take to accomplish this in MyCompany_MyModule?

  • A . Add into view/frontend/layout/default.xml.
  • B . Create view/frontend/layout/default.xml.
  • C . Create view/frontend/templates/script.phtml and add GTM code.
  • D . Run bin/magento create:module:template script.phtml
  • E . Copy vendor/module-catalog/view/template/script.phtml to view/template/script.phtml and add GTM script.

Reveal Solution Hide Solution

Correct Answer: A,B,C
Question #62

A merchant requires the ability to configure contact information for their brick and mortar stores as a CSV file upload. The module already exists and contains an etc/adminhtml/system.xml file where the new field can be added.

How do you specify the class that will process the uploaded file?

  • A . <upload_model>MagentoConfigModelConfigUploadFile</upload_model>
  • B . <frontend_model>MagentoConfigModelConfigFrontendFile</frontend_model>
  • C . <backend_model>MagentoConfigModelConfigBackendFile</backend_model>
  • D . <source_model>MagentoConfigModelConfigSourceFile</source_model>

Reveal Solution Hide Solution

Correct Answer: C
Question #63

As you are scanning folder in the vendor/module-catalog directory, you see a directory that is named Ui.

What is this folder’s purpose?

  • A . It contains UI component data providers and component information.
  • B . It contains templates, CSS and JS pertinent to the module.
  • C . It contains the block PHP files that render HTML onto the frontend.
  • D . It is not a normal folder and further investigation is necessary to determine the purpose.

Reveal Solution Hide Solution

Correct Answer: A
Question #64

How many shipping addresses may be selected for an order during the checkout process?

  • A . One shipping address per line item is possible
  • B . Only one shipping address per order is possible
  • C . One shipping addresses per unit of quantity is possible
  • D . One shipping address per product type is possible

Reveal Solution Hide Solution

Correct Answer: C
Question #65

You have created a module controller that responds to the following URL:

/mycompany/product/load/id/123.

Which two methods will load the product model by ID as specified in the URL? (Choose two.)

  • A . MagentoCatalogModelResourceModelProduct::load($productModel, $id)
  • B . MagentoCatalogModelResourceModelProductCollection::load()->fetchById($id)
  • C . MagentoCatalogModelResourceModelProductCollection::fetchItemById($id)
  • D . MagentoCatalogApiProductRepositoryInterface::getById($id)

Reveal Solution Hide Solution

Correct Answer: A ,D
Question #66

A custom module needs to log all calls of MagentoCustomerApiAddressRepositoryInterface::save().

Which mechanism do you use?

  • A . An observer on the customer_address_repository_save event, which is automatically fired for every repository save
  • B . A proxy configured to intercept all calls to any public method and log them
  • C . An extension attribute configured in the extension_attributes.xml
  • D . A plugin declared for the save() method

Reveal Solution Hide Solution

Correct Answer: D
Question #67

The module MyCompany_MyModule provides custom admin interface pages.

Access to these pages should only be granted to specific users.

You add the required configuration to the module’s acl.xml file, but the setting does not seem to work as expected.

How do you visually check if Magento evaluates your ACL resource as expected?

  • A . Write a plugin for the class MagentoFrameworkAclLoaderInterface::populateAcl() and echo out the loaded roles
  • B . Inspect the output of the CLI command bin/magento admin:role:resources C all
  • C . In the browser, open the admin User Roles page. Choose a role and inspect the tree of available resources
  • D . Inspect the response of a GET request to the webapi endpoint http://example.com/rest/V1/acl/resources

Reveal Solution Hide Solution

Correct Answer: C
Question #68

Your module adds a new controller class which will return a JSON response.

What will be the return type of the execute method?

  • A . You should implement a new API endpoint instead of returning JSON from a controller
  • B . The string value of Zend_Json::encode()
  • C . An instance of MagentoFrameworkControllerResultJson
  • D . No return needed, an object that can be converted to JSON must be set as the
    Response body

Reveal Solution Hide Solution

Correct Answer: C
Question #69

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 B
  • C . Option C
  • D . Option D

Reveal Solution Hide Solution

Correct Answer: A
Question #70

A Magento industry partner shipping provider has tasked you to build their integration module called MyCompany_ShippingProvider.

Where do you define the class that provides options for the select field that enables or disables the provider in the file etc/adminhtml/system.xml?

  • A . <option_model>MagentoConfigModelConfigOptionYesno</option_model>
  • B . <source_model>MagentoConfigModelConfigSourceYesno</source_model>
  • C . <frontend_model>MagentoConfigModelConfigFrontendYesno</frontend_model>
  • D . <backend_model>MagentoConfigModelConfigBackendYesno</backend_model>

Reveal Solution Hide Solution

Correct Answer: B

Question #71

A custom module is performing an optimized custom query for quote items.

The class applies the query customizations on the select object of a quote item collection instance.

You are tasked to resolve an issue where the query sometimes does not deliver the expected results. You have debugged the problem and found another class is also using a quote item collection and is loading the collection before the custom module.

How do you resolve the issue, keeping maintainability in mind?

  • A . You change the argument type toMagentoQuoteModelResourceModelQuoteItemCollectionFactory and instantiate the collection using $collectionFactory->create();
  • B . You remove the constructor argument and use ObjectManager::getInstance()->create(MagentoQuoteModelResourceModelQuoteItemCollection::class) to instantiate the collection instead.
  • C . You inject MagentoFrameworkDBSelect instead of the collection and perform the desired query independently of the collection.
  • D . You inject MagentoQuoteApiCartItemRepositoryInterface because low level query customizations are not allowed.

Reveal Solution Hide Solution

Correct Answer: A
Question #72

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 remove access to the restricted pages from each user’s ACL settings
  • B . You create a role with limited permissions and assign all sales manager users to the new role
  • C . This is not possible in a native Magento instance and requires customization
  • D . You create a role with access to the system configuration pages and assign it to all users except the sales managers

Reveal Solution Hide Solution

Correct Answer: B
Question #73

A merchant tasked you to add an input field for notes to the Customer Account Information backend page.

Which three actions do you specify in a module’s Data Patch to add a customer notes attribute? (Choose three.)

  • A . $cache->clean([‘eav’, ‘db_ddl’]);
  • B . $customerSetup->addAttribute(‘customer’, ‘notes’, $options);
  • C . $customerSetup->getConnection()->addColumn(‘customer_entity’, ‘notes’, $columnSpecs);
  • D . $notesAttribute->setData(‘used_in_forms’, [‘adminhtml_customer’]);
  • E . $customerSetup->addAttributeToSet(‘customer’, $attributeSetIdCustomer, $groupId, ‘notes’);

Reveal Solution Hide Solution

Correct Answer: BDE
Question #74

You want to remove a column introduced by a third-party extension via declarative schema.

How do you do that?

  • A . Create the etc/db_schema.xml file and specify disable=”true” on the column
  • B . Modify the original etc/db_schema.xml file and remove the column from there
  • C . Create a SchemaPatch file and remove the column programmatically
  • D . Copy the etc/db_schema.xml file into your module and remove the column from your copy

Reveal Solution Hide Solution

Correct Answer: D
Question #75

You need to find all orders in the processing state. You have written the code:

How do you resolve the exception?

  • A . Use dependency injection to load an instance of the SearchCriteria class
  • B . Change the getList parameter to: $searchCriteraBuilder->addFilter(‘state’,’processing’)->create()
  • C . Clear generated code to get a new version of SearchCriteriaBuilder
  • D . Specify a preference in di.xml to map SearchCriteriaBuilder to SearchCriteriaInterface

Reveal Solution Hide Solution

Correct Answer: B
Question #76

How do you add a foreign key to an existing table created by another module?

  • A . Create etc/db_schema.xml file with the table node and constraint child node
  • B . Run the command bin/magento setup:db-schema:upgrade <table> <constraint declaration>
  • C . This can only be done with raw SQL in a Schema Patch file
  • D . Create the etc/db_constraints.xml file and specify foreign key there in the constraint node

Reveal Solution Hide Solution

Correct Answer: A
A

Explanation:

https://magento.stackexchange.com/questions/192317/magento-2-how-to-add-foreign-key-in-update-schema

Question #77

A third-party module uses a layout update that changes the template path for a core block from product/view/addto/compare.phtml of the Magento_Catalog module to custom/view/addto/compare.phtml of your custom module. The merchant has a customized version of this template in their custom theme.

What is a consequence of this setup?

  • A . If the custom module is removed, the custom template will no longer apply
  • B . This setup will throw an IllegalStateException
  • C . If a preference for the core block is set, the template will no longer apply
  • D . If another module is installed which also customizes the same core template, the templates will be rendered sequentially

Reveal Solution Hide Solution

Correct Answer: A
Question #78

You see this code in etc/adminhtml/routes.xml:

<route id="mymodule" frontName="user-subscriptions">

<module name="MyCompany_MyModule" />

</route> You have placed a controller in Controller/Index/Subscribe.php.

If you want to create layout XML instructions for this controller, what would be the layout XML’s filename?

  • A . mymodule_index_subscribe.xml
  • B . mymodule_subscribe_[ACTION NAME].xml
  • C . user_subscriptions_index_subscribe.xml
  • D . user_subscriptions_subscribe_[ACTION NAME].xml

Reveal Solution Hide Solution

Correct Answer: A
Exit mobile version