Magento Commerce Developer

1 You are building an extension that will be sold on the Magento Marketplace. This extension depends on Magento_Catalog. How is a Magento database upgrade performed?(数据库如何执行升级)
A. Automatically when a new module version is detected(检测到)
B. Manually on the CLI
C. Manually in the Admin UI
D. When the cache is cleared and the module change is pr

2 You’re tasked with investigating(调查) a custom page layout declared in MyCompany/MyModule that isn’t loading. You’ve determined(确定) that this is the result of your XML configuration. Which 2 files do you investigate to locate the issue?
A. MyCompany/MyModule/view/frontend/layouts.xml
B. MyCompany/MyModule/view/frontend/layout/page.xml
C. MyCompany/MyModule/view/page_layout/custom.xml
D. MyCompany/MyModule/view/frontend/page_layout/custom.xml

3 A merchant would like to manually specify the order of products per category. How is this done?
A. This requires a customization.
B. There is a position field on the category management page which allows you to define the order of a product in the category.
C. There is a position field on the product management page which defines a position of the product in all categories.
D. Custom ordering is disabled by default, but can be enabled in System Configuration.

4 What happens when a customer adds two of the same simple products with different custom options to the cart?
A. They will be shown as one line item which lists both variations alongside their quantities.
B. An exception will be thrown because multiple variations of custom options for a simple product cannot be added to the cart.
C. They will be shown as two separate line items.
D. Magento will replace the first variation with the second one.

答案:B,AD,B,C
解析:
在这里插入图片描述


NO.1 Magento allows you to specify custom values per store for product attributes created in the admin panel. Which architectural pattern makes it possible?
A. Entity Attribute Value
B. Store Manager
C. Extension Attribute
D. Dependency Injection

NO.2 In a custom module you are adding a new field to the store configuration. The field will set the
value for the configuration path mycompany/mymodule/myoption. How do you supply the default value for that configuration option?(如何提供默认值)
A. In the system/mycompany/group/mymodule/field/myoption node in the etc/system.xml file
B. In the system/section/group/field/value node in the etc/adminhtml/system.xml file
C. In the config/default/mycompany/mymodule/myoption node in the etc/config.xml file
D. In the menu/default/section/group/field node in the file etc/adminhtml/menu.xml

NO.3 How do you add a new link into the My Account sidebar?
A. By creating a child of the My Account UI component
B. By creating a new UI component
C. By using a layout update
D. By adding the new section into the customer_account table in the database

NO.4 What order operation is available in the My Account section in the storefront?
A. Refund
B. Edit order
C. Reorder
D. Invoice

NO.5 You are facing a bug, which is supposedly caused by the customization of
\Magento\Catalog\Api\ProductRepositoryInterface::save(). To resolve the issue, you decide to find all logic which customizes this method. Which two places do you search for customization declarations? (Choose 2)
A. */config.xml
B. */events.xml
C. */di.xml
D. */plugins.xml

NO.6 What are two functions of a resource model? (Choose two.)
A. It executes create, retrieve, update and delete actions for an entity
B. It maps an entity to one or more database rows
C. It loads lists of entity models
D. It is made available in the Magento API for the purpose of data manipulation

NO.7 You want to remove a column introduced by a third-party extension via declarative schema.
How do you do that?
A. Copy the etc/db_schema.xml file into your module and remove the column from your copy
B. Modify the original etc/db_schema.xml file and remove the column from there
C. Create the etc/db_schema.xml file and specify disable=“true” on the column
D. Create a SchemaPatch file and remove the column programmatically

NO.8 You have created a new product type, sample, and need to customize how it renders on the shopping cart page. Keeping maintainability in mind(牢记可维护性), how do you add a new renderer?
A. Override the cart/form.phtml template and add logic for the sample product type.
B. Create the layout file, checkout_cart_index.xml, and reference the checkout.cart.renderers block
and add a block with the as=“sample” attribute.
C. Create the layout file, checkout_cart_item_renderers.xml, reference the
checkout.cart.item.renderers block and add a new block with an as=“sample” attribute.
D. Create the layout file, checkout_cart_index.xml, and update the cart page’s uiComponent to
appropriately render the sample product type.

NO.9 A module declares the route: <route id=“mymodule” frontName=“custom”>
What is the layout handle of the storefront path /custom/feature/?
A. custom_feature
B. mymodule_feature_index
C. custom_feature_index
D. mymodule_feature

NO.10 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/app/code/MyCompany_MyModule/view/frontend/web/register.js
D. https://magento.host/pub/static/frontend/Magento/luma/en_US/MyCompany_MyModule/web/register.js

答案:
A,C,C,C,BC
AB,A,C,B,A
解析:
NO.6 https://devdocs.magento.com/guides/v2.4/architecture/archi_perspectives/persist_layer.html


Question 1

A merchant asks you to create a module that is able to process URLs with a custom structure that can contain any combination of a product type code, a partial name, and a 4-digit year in any order.
The request path will look like this: /product/:type-code/:name-part/:year
Which layer in the Magento request processing flow is suited for this kind of customization?
A. Front controller
B. Router
C. Action controller
D. HTTP Response

Question 2
While integrating(集成) a merchant’s product information management system with Magento, you create a module MyCompany_MerchantPim that adds a catalog product EAV attribute pim_entity_id programmatically(以编程方式).
In which type of setup script do you create the EAV attribute?
A) Setup/InstallSchema.php
B) Setup/UpgradeSchema.php
C) Setup/InstallEntity.php
D) Setup/UpgradeData.php

Question 3
You are facing a bug, which is supposedly caused by the customization of \Magento\Catalog\Api\ProductRepositoryInterface::save().
To resolve the issue, you decide to find all logic which customizes this method. Which two places do you search for customization declarations? (Choose 2)
A. */di.xml
B. */config.xml
C. */events.xml
D. */plugins.xml

Question 4
You are implementing a customization of the sales management within a module MyCompany_MySalesProcess. You have created several event observers to add the custom functionality. Each observer is a separate class, but they require some common functionality.
How do you implement the common functionality in the event observers, keeping maintainability and testability in mind?
A. You create a trait with the common methods and use the trait in the observer classes.
B. You create an abstract class AbstractObserver with the common methods and extend the observer classes from it.
C. You create a regular class implementing the common functionality as public static methods and call those from the observers.
D. You create a regular class implementing the common functionality as public methods and use constructor injection to make them available to the observers.

Question 5
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.

public function __construct(
 \Magento\Quote\Model\ResourceModel\Quote\Item\Collection $collection
) {
 $this->collection = $collection;
}
public function fetchData()
{
 $select = $this->collection->getSelect();
 // code modifying $select
 return $this->collection->getData();
}

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 to \Magento\Quote\Model\ResourceModel\Quote\Item\CollectionFactory and instantiate the collection using $collectionFactory->create();
B. You remove the constructor argument and use ObjectManager::getInstance()->create(\Magento\Quote\Model\ResourceModel\Quote\Item\Collection::class) to instantiate the collection instead.
C. You inject \Magento\Framework\DB\Select instead of the collection and perform the desired query independently of the collection.
D. You inject \Magento\Quote\Api\CartItemRepositoryInterface because low level query customizations are not allowed.

Question 6

In a custom module you implement the interface \Magento\Framework\App\Config\DataInterface.

/**
 * Configuration data storage
 *
 * @api
 */
interface DataInterface
{
  public function getValue($path);
  public function setValue($path, $value);
}

What version constraint(约束) for magento/framework do you add to your module’s composer.json file?
A. major(主要)
B. minor(次要)
C. patch(补丁)
D. stable(稳定)

答案:C,D,AC,D,A,B
解析:
问题1,https://devdocs.magento.com/guides/v2.4/extension-dev-guide/routing.html
问题2,InstallSchema和UpgradeSchema主要用于更新表结构;InstallData和UpgradeData主要用于更新表数据。题干要求在新模块添加产品属性,首选InstallData;因备选答案没有,所以选UpgradeData。
问题4,如Helper。
问题6,https://devdocs.magento.com/guides/v2.4/extension-dev-guide/versioning/dependencies.html


1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看REAdMe.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看REAdMe.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看READme.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

liguojia1987

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

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

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

打赏作者

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

抵扣说明:

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

余额充值