Magento 2 Certified Associate Developer

本文详细介绍了Magento 2 Certified Associate Developer考试,包括考试费用、重要性及对外包公司的影响。针对考试中的一些错误答案,文章提供了更正,并分享了备考资源。同时,文章还列举了部分考试题目及其解析,涉及Magento 2的URL重写、安装选择、运输地址、ACL限制、定时任务、布局更新等多个方面。
摘要由CSDN通过智能技术生成

Magento 2 Certified Associate Developer,即Adobe整合后的 [AD0-E702]: Adobe Certified Professional-Magento Commerce Developer。考试费用195刀,是系列中最便宜的一项考试。
对于从事Magento2外包的公司,获得Magento2相关的证书,还是很重要的。有证书,则公司更容易接到项目,在项目报价的时候也更有优势。所以,外包公司一般会要求Magento2开发者参加相关考试,有的公司只有通过才报销考试费用,有的公司不管考试通过与否都能报销费用。共同的一点就是,通过认证考试的,一般都能获得加薪。所以,对于在外包公司从事Magento2开发的人员来说,获得认证,还是很有必要的。
题库给出的答案,有部分是错误的,以下答案根据手册和实操结果进行了更正。
另外,https://vceguide.com/上也能找到相同的题目,大部分题目都有人评论给出认为正确的答案,可以参考。


1.Products may be accessed using SEO friendly URLs like /my-product instead of /catalog/product/view/id/{ID} How is this one?
A. An event observer adds RewriteRules to .htaccess on product save
B. Magento\Catalog\Controller\Product\View::loadByUrlKey loads product pages using the url_key attribute value
C. Using a URL Rewrite stored in the database connecting the request path with the target path
D. A plugin on \Magento\UrlRewrite\Controller\Router::match loads products by the url_key attribute
Answer: C
解析:表url_rewrite。

2.You are setting up a brand new Magento installation for a merchant who is migrating from Magento 1 to Magento 2. Keeping in mind upgradability and the need to customize, which one do you choose? A. Create a new Magento instance using composer create-project
B. Clone the magento/magento2 GitHub repository
C. Run php bin/magento setup:migrate command
D. Create a new Magento instance by using the bin/magento install command
Answer: C
解析:ABD明显可以排除。

3.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
Answer: B
解析:如果后台启用Allow Shipping to Multiple Addresses,则购物车的多个商品客户可以发到不同地址,且客户只需支付一次。支付成功后,会根据收货地址拆单,即一个订单只能有一个收货地址。

4.You have created a new section in system configuration under the Catalog tab. How do you restrict an access to the section using Magento ACL?
A. In the system.xml file
B. In the etc/acl.xml file
C. In the etc/adminhtml/routes.xml file
D. In the etc/adminhtml/menu.xml file
答案:A
解析:restrict 限制。通过在section添加子节点resource,可以限制只有拥有该资源权限的用户才可以进入。

5.A module you are working on needs to send a newsletter to all subscribed customers at predefined intervals. Which two actions do you take to make sure the newsletter is sent? (Choose two.)
A. Implement \MyCompany\MyModule\Cron\NewsLetterSender::executeand register it in etc/crontab/di.xml
B. Implement \MyCompany\MyModule\Cron\NewsLetterSender::executeand register it in etc/crontab.xml
C. Make sure bin/magento cron:run is added to the system crontab
D. Register the plugin for \Magento\Customer\Model\Customer::authentication etc/crontab.xml
Answer: BC
解析:定时任务。crontab.xml,cron_groups.xml,cron:run。

6.What is the connection between product attribute sets and categories?
A. Categories have no connection to product attribute sets, and any product can be assigned to any category
B. Each category is linked to a single product attribute set, and only products from that attribute set are allowed in the category
C. Each category is linked to a single product attribute set, and only products from that category’s set or any of its parent categories’
D. Categories can be connected to multiple product attribute sets, and only products from one of those sets are allowed in the category
Answer: A
解析:属性集和产品关联,产品和分类关联,但是属性集和分类之间并没有关联。

7.How can you access the select query of a collection?
A. You can only access the select query after the collection has been loaded by calling the public method query()
B. It is stored in a protected variable $query and can only be accessed from the inside of a collection class
C. You can get it by using public method getSelect() which returns an instance of Magento\Framework\DB\Select
D. The select query is not available in the collection class, it will be generated by the MySQL adapter right before executing a query
Answer: C
解析:$collection->getSelect()

8.You are developing a module MyCompany_StoreInfo to display information about brick and mortar stores on a frontend page. The displayed information varies based on the country of a given store. What two elements automatically render their children? (Choose two.)
A. <block class=”\Magento\Framework\View\Element\AbstractBlock” name=”shop.info.details”/>
B. <block class=”\Magento\Framework\View\Element\Template” name=”shop.info.details”/>
C. <container name=”shop.info.details”/>
D. <block class=”\Magento\Framework\View\Element\Text\ListText” name=”shop.info.details”/>
Answer: CD
解析:实践出真知。container 和 block 的主要区别在于container 下的block会自动渲染,所以C必选。剩余的经过实操,发现D选项符合,具体实现未深入。

9.Assume that $collection is a new instance of a class that extends Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection, and $ids is an array of ids. How do you select a list of records from the database where the record ids are in the $ids list?
A. $collection->addFieldToFilter(‘record_id’,[‘in’=>$ids]);
B. $collection->addFilter($filterBuilder->setType(‘in’)->setValue($ids)->create());
C. $collection->in($ids);
D. $collection->filterIn($ids);
Answer: A
解析:如果搜索条件是EAV的属性,则使用$collection->addAttributeToFilter()。

10.While reviewing a layout file named sales_order_view.xml you notice the element <update handle=”customer_account”/> What is the purpose of this element?
A. Replaces the customer_account handle with sales_order_view
B. Nothing, this element has been deprecated
C. Adds the customer_account handle to the page’s handles list
D. Updates the current page handle to customer_account
Answer: C
解析:相当于在当前布局,引入了一个可共用的布局。


11.You have to install a new module on the production environment. All the module is adding a new product attribute. You enabled maintenance mode, copied the module code, run bin/magento setup:upgradeand, disabled maintenance mode. What two risks does this process pose? (Choose two.)
A. It will clean all caches which will cause a performance degradation
B. The new attribute will be invisible on the storefront until the cache is cleaned manually
C. It will void all active sessions
D. It will clean static assets from the pub/staticfolder
Answer: BC
解析:performance degradation 性能下降。

12.Magento 2’s architecture uses code to bootstrap a custom module that resides in app/code. What two files are required to make a module usable? (Choose two.)
A. Helper/Data.php
B. etc/config.xml
C. etc/module.xml
D. registration.php
Answer: CD

13.How does Magento store customer address attribute values?
A. Customer address is a flat entity, so all values are stored in the customer_address_entity table
B. Customer address is not an entity, so its properties are customer attributes
C. Customer address is an attribute of the customer, so it doesn’t have its own attributes
D. Customer address is an EAV entity, so all values are stored in the customer_address_entity table and related values tables
Answer: D
解析:customer,customer_entity,catalog_product,catalog_category均属于EAV entity。

14.You are developing a module and need to add another column to a table introduced by another module MyCompany_MyModulevia db schema. How do you do that?
A. Create a etc/db_schema.xml file in your module, add the column and run bin/magento setup:upgrade
B. Create a etc/db.xml file in your module, add the column and run bin/magento setup:db-schema:upgrade
C. Run a command: bin/magento setup:db-schema:upgrade <table> <column definition>
D. Create a etc/db_schema_whitelist.json file in your module, add the column and run bin/magento setup:upgrade
Answer: C
解析:

15.You need to add a new text attribute to all products in the Magento store. When this attribute is displayed on the product page, its values must be different depending on the selected language. Keeping simplicity in mind, how do you add this attribute?
A. Use the Magento CLI to create a new custom attribute, then generate dictionaries for all supported languages
B. Use a Data Patch to create a new EAV attribute
C. Add a new column to the catalog_product_entitytable using declarative schema
D. Use the admin panel to create a new extension attribute
Answer: D

16.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
Answer: A
解析:consequence 结果;sequentially 依序。

17.You are adding a child node to the product.info block using the XML:

    <referenceBlock name="product.info">
        <block class="MyCompany\MyModule\Block\Custom"
               name="myblock"
               template="custom.phtml" />
    </referenceBlock>

How will this block be rendered?
A. Child block nodes are automatically rendered as HTML
B. By calling $block->getChildHtml(‘mynewblock’) in the parent block’s template
C. The layout is invalid since block elements cannot be nested
D. Automatically if the block class Custom implements the _toHtml method
Answer: B

18.You are implementing a before plugin in MyCompany_Magic. It will intercept the same method that MyCompany_Admissionis already intercepting using a before plugin: Topmenu::getBlockHtml. Which two actions are required to ensure the new plugin will execute last? (Choose two.)
A. Include a sortOrder=”20” on the new plugin in MyCompany_Magic’s etc/di.xml file
B. Configure plugin sequencing for both plugins in MyCompany_Magic’s etc/plugin_sequence.xml file C. Set a sortOrder=”10” for MyCompany_Admission’s plugin in MyCompany_Magic’s etc/di.xml
D. Add MyCompany_Admission as a dependency in MyCompany_Magic’s etc/module.xml file Answer: CD
解析:B选项排除,D选项正确,剩下二选一。

19.In the module located at app/code/MyCompany/MyModule there is a JS module in the file view/frontend/web/register.js. The Magento base URL is https://magento.host/ and the luma theme with the en_US locate is used. What is the public URL for this file?
A. https://magento.host/pub/static/frontend/Magento/luma/en_US/MyCompany_MyModule/js/register.js
B. https://magento.host/pub/static/frontend/Magento/luma/en_US/MyCompany_MyModule/register.js C. https://magento.host/pub/static/frontend/Magento/luma/en_US/MyCompany_MyModule/web/register.js
D. https://magento.host/app/code/MyCompany_MyModule/view/frontend/web/register.js
Answer: A

20.During a code review of a module MyCompany_PaymentCurrencies you see a configuration field declared in the file etc/adminhtml/system.xml:

<field id="currency" type="select" showInDefault="1" showInWebsite="1" showInStore="0">

</field>

What is the consequence of the attribute showInStore being set to 0?
A. The field value will not be accessible on the store front by calling ScopeConfigInterface::getValue() with a $scopeType argument of ‘store’.
B. The input field will not be visible if a store view scope is selected in the system configuration
C. The input field will only be visible if a website’s default store scope is selected in the system configuration
D. The input field will be disabled if a store view scope is selected in the system configuration
Answer: B


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

$orderRepository->getList($searchCriteraBuilder->addFilter('state','processing'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

liguojia1987

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值