Exam4Training

Adobe AD0-E704 Adobe Certified Master – Adobe Commerce Architect Online Training

Question #1

You are developing a new payment method. It is required that any new order created with this payment method needs to have a specific custom status. Assume the status has been added to the system already, assigned to the processing state, and the new order state for the payment method is processing.

How do you set the custom status on orders placed with the new payment method?

  • A . Add a custom status code to the Magis the correct way to modify the Ul componeentoSalesModelOrder-Payment class as a $newOrderStatus constructor parameter using di.xml
  • B . Create a system configuration option order.status and set the status code as its value
  • C . Create an observer for the event sales_order_set_status, get the $status parameter and set the new status using $status->setStatus()
  • D . Create a command setOrderStatus and add it to a commandPool with a name set_status

Reveal Solution Hide Solution

Correct Answer: C
Question #2

You are tasked to work on a message queue module.

When looking at the queue configuration you see the following:

Keeping in mind maintainability, you change it to:

What will happen?

  • A . This code will cancel all the topic starting with customer
  • B . This code will not work as message queue does not allow # wildcard
  • C . This code will replace all of the different topics as # is the symbol for everything
  • D . This code will replace only some of the topics

Reveal Solution Hide Solution

Correct Answer: D
Question #3

You are working on a project with a large database with many products, sales rules and CMS pages. The merchant is going to use Magento_Staging for scheduled updates, but they were told that use of Staging will modify all SQL queries and slow down website performance.

What modification does Magento_Staging make to existing SQL queries?

  • A . It creates a copy of the staged table with the staged data and joins the new table to replace original values with the staged ones
  • B . Every query which uses staged entities will have an additional join to the staging_update table filtered by the current version
  • C . Magento.staging does not modify any existing queries so it has no additional impact
  • D . For every query that uses staged entities it adds an additional were statement to filter a row by the current version

Reveal Solution Hide Solution

Correct Answer: D
Question #4

Suppose you need to add a custom css file in layout XML in such a way that it should load asynchronously to improve the page load performance.

What is the correct attribute for this:

  • A . async
  • B . defer
  • C . rel
  • D . ie_condition

Reveal Solution Hide Solution

Correct Answer: B
Question #5

You need to include the customer account menu on a custom storefront page, but only when the method MyCompany\lyModuleViewModelMyView: :hasCustomerMenu() returns true.

How do you accomplish this?

  • A . In the page action controller, inject the Layoutinterface and if hasCustonerMenu() returns true, call $layout->addHandle(‘custooer_account’)
  • B . Create an after plugin for MagentoFrameworkViewUyoutInterface::getOutput() and if hasCustomerMenuO returns true, Call $subject->addHandled customer_account’)
  • C . In the page action controller, if hasCustomer-Menu() returns true, before returning the page result call Spage->addHandleC custon»r_account’)
  • D . In the page’s layout XML file, add <update handle="customer_account" if="MyCompanyMyModuleViewModelMyView::hasCustomerMenu" >

Reveal Solution Hide Solution

Correct Answer: D
Question #6

Suppose you are working on a specific uicomponet form where front-end customers can update their name and phone number only when the admin user sets the editable_field_flag to 1 for his submitted data from the backend.

According to this flag, when loading the data in the form for front-end users, how would you check and customize to enable/disable the name and phone number fields?

  • A . In uicomponet xml, under fieldset node, include the Form Provider Javascript component “Magento_Ui/js/form/provider” and extend it to customize the specific fields when data is being populated by it.
  • B . In uicomponet xml, under fieldset node, include the Form Provider Javascript component “Magento_Ui/js/form/dataProvider” and extend it to customize the specific fields when data is being populated by it.
  • C . In uicomponet xml, under DataSource node, include the Form Provider Javascript component “Magento_Ui/js/form/provider” and extend it to customize the specific fields when data is being populated by it.
  • D . In uicomponet xml, under DataSource node, include the Form Provider Javascript component “Magento_Ui/js/form/dataProvider” and extend it to customize the specific fields when data is being populated by it.

Reveal Solution Hide Solution

Correct Answer: C
Question #7

You are troubleshooting an issue where a related product rule is not showing the product expected by a user.

You run this command:

bin magento cache:clean target_rule

What impact does this have?

  • A . Products to Display calculation will be cleared from the Magento cache
  • B . HTML output of target rule blocks will be cleared from the Magento cache
  • C . Cached select statements will be cleared from the Magento cache
  • D . Cached select statements will be cleared from action_select column of the magento_targetrule table

Reveal Solution Hide Solution

Correct Answer: D
Question #8

You need to build a custom module to add a notice to the Advanced Inventory section on the product form. The notice text can be specified in the system configuration.

How do you implement this?

  • A . You add a plugin on the form MagentoCataiogUiDataProvid«rProductFormProductDataProvider to add a field in the Advanced Inventory section
  • B . YOU add a plugin on MagentoCatalogInventoryUiDataProviderProductFormModifierAdvancedInventory to modify the Section metadata
  • C . You inject a custom block into the reference container in the catalog_product_index layout
  • D . You add a field to product_form. xml as a child of the stock_data fieldset

Reveal Solution Hide Solution

Correct Answer: D
Question #9

When you reference a factory or proxy in a class constructor, these classes are generated by default inside generated directory, if they are not present in codebase.

Which Magento class is resposible for this?

  • A . ObjectManager
  • B . FileManager
  • C . ClassManager
  • D . IntanceManager

Reveal Solution Hide Solution

Correct Answer: A
Question #10

You are implementing a requirement to exclude all shipping rates less than $50 if there is a specific product in the shopping cart.

How do you do this?

  • A . Create an after plugin for the method MagentoshiPpingModeishipPing: : collectives and access the rate result object using the getResuh o method of the Shipping class. You can update the list of rates in the result object.
  • B . Create an observer for the event shipping_rates_collect_after-. In the observer you have access to the rates result object which contains all the rates. You can set a new list of rates to the result object.
  • C . Create an after plugin for the method HageinocheckoutUpishippinginfonaationManageDein::getShippingRates. The method returns a list of rates which you can filter in the plugin.
  • D . Create a shopping cart price rule with a condition of having the product in the cart and an action to exclude shipping rates less than $50.

Reveal Solution Hide Solution

Correct Answer: D

Question #11

You are making a module MyCompany_MyModule and the merchant asks for an attribute that is only available to simple and configurable products. This needs to be defined in the catalog_eav_attribute table.

How can we create this behavior during the creation of this attribute?

A)

B)

C)

D)

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

Reveal Solution Hide Solution

Correct Answer: B
Question #12

You need to create a list of warehouses with a set of details in the configuration values: warehouse name, warehouse postcode. For this, suppose you created a custom configuration file under your module’s etc/warehouses_list.xml.

Now what should be the name of it’s XSD schema for this xml file validation:

  • A . etc/warehouses_list.xsd
  • B . etc/xsd/warehouses_list.xsd
  • C . etc/warehouses/list.xsd
  • D . xsd/warehouses_list.xsd

Reveal Solution Hide Solution

Correct Answer: A
Question #13

Suppose in a store there are 500 categories and it’s increasing as per the need. Let’s say your frontend developer asked you to modify the header and include CSS files on some specific category pages based on the custom category attribute selection from backend.

What should be the acceptable and easiest way to do this, so that no new file creation and code update will be required after implementation:

  • A . create a new layout XML file for the category called catalog_category_view.xml and add the layout modification code
  • B . create a new layout XML file for the category called catalog_category_view_selectable_<Category ID>_CustomLayout.xml and assign it to the needed categories from backend, and add the layout modification code in it.
  • C . create a custom layout handle for the category using observer layout_load_before and add the layout modification code
  • D . create a custom layout handle for the category using observer layout_load_after and add the layout modification code

Reveal Solution Hide Solution

Correct Answer: C
Question #14

You are working on a custom page where the content of a CMS block has to be rendered. You know the merchant is using Staging for CMS blocks. In your code you have access to the $repository object which is an instance of MagentoCmsApiBlockRepositoryInterface. $blockld which is the original block ID, and $current Version which is the current Staging version.

How do you load the CMS block with the right Staging version?

A)

B)

C)

D)

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

Reveal Solution Hide Solution

Correct Answer: D
Question #15

A furniture merchant have 100k products in the store. In a custom product list page, he advised you to enable the caching as per user paginate the products.

So what should the approach to cache the block data as per pagination request:

  • A . In block class toHtml() method, define cache_lifetime, cache_tags and cache_key_<current_page_here>
  • B . In block class _construct() method, define cache_lifetime, cache_tags and cache_key_<current_page_here>
  • C . In block class toHtml() method, set _isScopePrivate property to false as per requested page number.
  • D . In block class _construct() method, set _isScopePrivate property to false as per requested page number.

Reveal Solution Hide Solution

Correct Answer: B
Question #16

You are implementing a custom module MyCompany_MyModule which displays a new link in the Action column in the Orders grid. The purpose of this link is to synchronize the order summary data with an ERP system. You must make permissions to use this link manageable with the Magento ACL.

Which two steps are required to do this?

  • A . Add a plugin On MagentoSalesUiComponentListingColumnViewAction: :prepareDataSource to add link and Check permission
  • B . Add the configuration of the new link with aclResource value for the sales_order_grid. xmi
  • C . Add a controller MyCompanyMyModuleControllerAdminhtmlSynchronizeOrders and specify a valid value for the ADMIN_REROURCE Constant
  • D . Add a plugin on the gridMagentoFrameworkviewEiementUIComponentDataProviderDataProvider to add the link and check permissions

Reveal Solution Hide Solution

Correct Answer: B,C
Question #17

You are working on a module MyCompany_MyModule which adds a select attribute with a few options using the MagentoEavSetupEavSetup: :addAttribute() method in data in data install script.

There is no uninstall script. While debugging, you have uninstalled the module with the command:

bin magento module:uninstall MyCompany_MyModule

Then you reinstalled the module.

What will be the effect on the attribute?

  • A . The attribute remains the same but the attribute options will be duplicated
  • B . The attribute is deleted and created again
  • C . The attribute is updated when attribute options differ
  • D . A duplicate attribute will be created with a different attribute code

Reveal Solution Hide Solution

Correct Answer: A
Question #18

You want to run a script each time after all schema installation and schema upgrade scripts have executed, but before data setup scripts execution.

What do you do?

  • A . You need to run bin magento module:recurring MyCompanyJlyModule each time after bin magento setup:update
  • B . Create a Recurring, php Script in the MyCompany MyModule Setup folder
  • C . Create a RecurringData. php Script in the MyCompany MyModule Setup folder
  • D . Add an event observer for the event setup_upgrade_schema_after

Reveal Solution Hide Solution

Correct Answer: D
Question #19

A merchant has created a segment that applies to registered customers whose gender is female. You then migrate customers by copying data directly from one database to another.

What two ways are used to assign migrated customers with a female gender to the segment?

  • A . They will be automatically assigned by a cron job at the scheduled time
  • B . Run bin Mgento index:reinde. customer_segment
  • C . Click on the Refresh Segment Data button in the Admin
  • D . Re-save the customer segment in the Admin

Reveal Solution Hide Solution

Correct Answer: B,C
Question #20

You are working on a project where many catalog managers often change products in the admin panel.

The merchant is considering changing the indexers mode to "Update on Schedule" from "Update on Save" to achieve better performance. However, the merchant is concerned about data consistency and the probability of the scheduled updates being lost.

How does Magento store the IDs of updated products for reindex in "Update on Schedule" mode?

  • A . Magento is gathering updated IDs using catalog_product_save_commit_after events and publishes them into the Message Queue.
  • B . Magento sets a reindex_required flag on updated products and a later reindex run by the cron will pick up IDs based on that flag.
  • C . Using the Staging update scheduled for every minute, which includes modified products, Magento will automatically reindex affected products when the update is applied.
  • D . Magento enables database triggers which collect updated IDs and saves them in special changelog tables.

Reveal Solution Hide Solution

Correct Answer: C

Question #21

A merchant is planning to create a single scheduled update for one million products. They are wondering about website performance.

What two performance issues will the update cause?

  • A . Magento will index all records in the cataiog_product_entity table regardless of the version so the index tables will be big
  • B . When applying a scheduled update Magento will reindex all affected products
  • C . The catalog_product_entity_* tables will contain all the staged values which slows down all queries related to them
  • D . Magento runs a cron job every minute to generate and maintain preview data

Reveal Solution Hide Solution

Correct Answer: A,B
Question #22

To prevent Cross Site Scripting (XSS) attacks, Magento templates use different methods to escape the output on the website before displaying it to the user.

What three methods does Magento use to prevent this kind of attack?

  • A . Sblock->escapeData()
  • B . Sblock->escapeOutput()
  • C . Sblock->escapeHtmlAttr()
  • D . $block->escapeHtml()
  • E . $block->escapeUrl()

Reveal Solution Hide Solution

Correct Answer: B,C,D
Question #23

You are debugging an issue where the staged product custom attribute value is not displayed properly. The attribute backend type is varchar.

How does Magento store scheduled values for varchar attributes?

  • A . By creating a new record in the cataiog_product_entity table with the same entity_id and different rowjd and it creates a new record in the catalog_product_entity_varchar table connected to the new row-id
  • B . By creating a new record in the table cataiog_product_entity_varchar with a new row_id connected to the same entity_id
  • C . By creating a new table cataiog_product_entity_varchar_<version> where the scheduled attribute value is located
  • D . By creating a new website called staging_<version and saving the new attribute value for that website in the catalog_produt_entity_varchar table with the same entity_id

Reveal Solution Hide Solution

Correct Answer: A
Question #24

You are working on a Magento module for a merchant that does business in the UK. This module exposes a REST API endpoint for sending text messages to customers. There is an app based on this REST API which allows admin users to stay in touch with the customers. You would like to restrict the admin’s ability to send text messages after work hours.

Keeping simplicity in mind, how do you implement this?

  • A . Use the built-in scheduled ACL functionality to configure allow-deny rules in the admin panel
  • B . Add the check directly to the service method implementation
  • C . Implement a cron job to change the admin permissions twice a day for everyone who has these permissions set
  • D . Add aclResolver="MycompanyMyModuleModelPathToAc1Resolver" declaration for the relevant methods in webapi. xbI

Reveal Solution Hide Solution

Correct Answer: D
Question #25

You are integrating an external system from which products and categories will be synchronized with Magento.

To keep the category tree synchronized, an identifier attribute needs to be added to the catalog_category entity. The identifier value is generated by the external system as an unsigned 3 byte integer and is global in scope. Your code will run many concurrent queries to select categories based on this ID in order to synchronize changes.

Keeping performance in mind, what attribute backend type do you choose when creating the EAV attribute?

  • A . int
  • B . varchar
  • C . static
  • D . text

Reveal Solution Hide Solution

Correct Answer: A
Question #26

Suppose you want to develope a custom extension that should provide product_redirect_links to amazon.com, ebay.com and other sites. Suppose this must be added using extension_attribute feature to make that availbe for product repository and services, then what are the customizations needed to develope it: Choose 2

  • A . In your custom module, create etc/extension_attributes.xml, and define needed attribute_code under
    extension_attributes for=”MagentoCatalogApiDataProductInterface”
  • B . In your custom module create, etc/di.xml and add plugin code to join product_redirect_links attribute to ProductRepositoryList
    <type name="MagentoCatalogApiProductRepositoryInterface"> <plugin name="joinExternalLinksToProductRepositoryList" type="MagentoExternalLinksModelPluginProductRepository"/> </type>
  • C . In your custom module create Setup/InstallSchema.php and add requried product attribute create code and run setup:upgrade.
  • D . None of these

Reveal Solution Hide Solution

Correct Answer: A,B
Question #27

A merchant complains about the related accessory products, which they assigned to the virtual product, not being visible on the store front.

What is the reason for this?

  • A . Related products association must be explicitly activated in the admin panel
  • B . Browser cache refresh is required
  • C . Virtual products do not support related products
  • D . Related products are out of stock

Reveal Solution Hide Solution

Correct Answer: A
Question #28

Suppose you are asked to disable/remove the customer review related functionalities. You can not disable the review module directly because the customer module depends on it.

What is the possible way to remove all HTML outputs of the review module, from the frontend and backend?

  • A . Turn-off Review module output globally by extending <Magento_install_dir>/vendor/magento/module-backend/etc/config.xml
  • B . Turn-off Review module output globally by extending <Magento_install_dir>/vendor/magento/module-backend/etc/module.xml
  • C . Create plugin or Override the class MagentoFrameworkViewElementAbstractBlock and toHtml() method, and implement the logic to return empty data in case of review module’s block instance is present.
  • D . Create plugin or Override the class MagentoBackendBlockTemplate and isOutputEnabled() method, and implement the logic to return false value in case of review module’s block instance is present.

Reveal Solution Hide Solution

Correct Answer: A
Question #29

You are debugging a problem with a shopping cart price rule which gives free shipping for the whole cart if the subtotal is greater than $100. You are seeing that when a custom shipping method is selected, the shipping price is still present even though the subtotal is greater than $100.

How do you fix this problem?

  • A . Create an option allow_freeshiping in the system configuration of the shipping method and set its value to 1
  • B . Add the shipping method’s code to the price rule action
  • C . Modify the carrier class to process the free_shipping flag of the quote items
  • D . Add the shipping method’s code to the price rule condition

Reveal Solution Hide Solution

Correct Answer: A
Question #30

When your class will be instantiated all the dependencies injected in your class constructor will also get instantiated, and it will trigger a chain reaction of object creation, this can really slow down the process.

What could be the solution of above problem?

  • A . Use Proxy classes with help of di.xml
  • B . Use VitualType classes with help of di.xml
  • C . Use Dependecy Injection with help of di.xml
  • D . Use factory classes instead of Model.

Reveal Solution Hide Solution

Correct Answer: A
Exit mobile version