In a custom module, an Architect wants to define a new xml configuration file. The module should be able to read all the xml configuration files declared in the system, merge them together, and use their values in PHP class.
Which two steps should the Architect make to meet this requirement? (Choose two.)
Answer : C, E
Based on these definitions, I would say that two possible steps that the Architect should make to meet the requirement are:
1. Create a Data class that implements ''\Magento\Framework\Config\Data''
2. Make a Reader class that implements ''\Magento\Framework\Config\Reader\Filesystem''
These steps would allow the custom module to read all the XML configuration files declared in the system, merge them together, and use their values in PHP class.
An Adobe Commerce Architect runs the PHP Mess Detector from the command-line interface using the coding standard provided with Adobe Commerce. The following output appears:
The Architect looks at the class and notices that the constructor has 15 parameters. Five of these parameters are scalars configuring the behavior of Kyservice.
How should the Architect fix the code so that it complies with the coding standard rule?
Answer : A
The best way to fix the code so that it complies with the coding standard rule is to introduce a new class accepting those five scalars and use it in the constructor and the remaining logic of Myservice. This will reduce the number of different classes, interfaces, and scalar types used as parameters in the constructor and other methods to less than 13, which is the limit set by the coding standard. Additionally, any extra code that is not necessary can be removed to reduce the general complexity of the class and improve readability.
A merchant asks for a new category attribute to allow uploading an additional mobile image against categories. The merchant utilizes the content staging and preview feature in Adobe Commerce and wants to schedule and review changes to this new mobile image field.
A developer creates the attribute via a data patch and adds it to view/adminhtml/ui_component/category_form.xml. The attribute appears against the category in the main form, but does not appear in the additional form when scheduled updates are made.
To change this attribute when scheduling new category updates, which additional action should the Architect ask the developer to take?
Answer : B
This is because, in order to change the attribute when scheduling new category updates, the attribute must be added to the view/adminhtml/ulcomponent/catalogstagingcategoryupdateform.xml file in order to be displayed in the additional form when scheduling updates. This additional form is used to set the values for the category attributes when scheduling updates.
1: https://docs.magento.com/user-guide/v2.3/cms/content-staging-category.html
An Adobe Commerce store owner sets up a custom customer attribute "my.attribute" (type int).
An Architect needs to display customer-specific content on the home page to Customers with "my.attribute" greater than 3. The website is running Full Page Cache.
Using best practices, which two steps should the Architect take to implement these requirements? (Choose two.)
Answer : A, C
To display customer-specific content on the home page to Customers with ''my.attribute'' greater than 3, you need to use the following steps:
Use customer-data JS library to retrieve ''my.attribute'' value. The customer-data JS library allows you to access the customer data stored in the local storage of the browser. You can use the get() method to get the value of ''my.attribute'' for the current customer.
Add a new context value of ''my.attribute'' to Magento\Framework\App\Http\Context. The HTTP context is a mechanism that allows you to vary the cache of a page based on some parameters. By adding a new context value of ''my.attribute'', you can cache separate versions of the home page for customers with different values of ''my.attribute''.
Add a custom block and a phtml template with the content to the cms_index_index.xml layout. This step will create a block that will display the customer-specific content on the home page. You can use the phtml template to check the value of ''my.attribute'' and render the content accordingly.
: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/cache/page-caching/public-content.html : https://devdocs.magento.com/guides/v2.3/howdoi/checkout/checkout_customize.html
An Adobe Commerce Architect designs a data flow that contains a new product type with its own custom pricing logic to meet a merchant requirement.
Which three developments are valid when reviewing the implementation? (Choose three.)
Answer : A, C, F
To create a new product type with its own custom pricing logic, you need to consider the following developments:
Content of the etc/product_types.xml file. This file will define the name, label, modelInstance, and priceModel of the new product type. The modelInstance will specify the custom type model that extends from the abstract Product Type model. The priceModel will specify the new price model that extends \Magento\Catalog\Model\Product\Type\Price.
Custom type model extended from the abstract Product Type model. This model will implement the logic and behavior of the new product type, such as how to prepare product for cart, how to process buy request, how to check product options, etc.
New price model extended \Magento\Catalog\Model\Product\Type\Price. This model will implement the custom pricing logic for the new product type, such as how to calculate final price, tier price, minimal price, etc.
1: https://meetanshi.com/blog/create-custom-product-type-in-magento-2/
The development of an Adobe Commerce website is complete. The website is ready to be rolled out on the production environment.
An Architect designed the system to run in a distributed architecture made up of multiple backend webservers that process requests behind a Load Balancer.
After deploying the system and accessing the website for the first time, users cannot access the Customer Dashboard after logging in. The website keeps redirecting users to the sign-in page even though the users have successfully logged in. The Architect determines that the session is not being saved properly.
In the napp/etc/env.php\ the session is configured as follows:
What should the Architect do to correct this issue?
Answer : B
When using multiple backend servers behind a load balancer, the session data must be stored in a shared location that is accessible by all servers. Otherwise, the session data will be inconsistent and users may experience issues such as being logged out unexpectedly. Redis is a recommended option for storing session data in a distributed architecture, as it provides fast and reliable access to the data. The session host value in the env.php file must point to the Redis instance that is used for session storage. Reference: https://devdocs.magento.com/guides/v2.4/config-guide/redis/redis-session.html
An Architect wants to create an Integration Test that does the following:
* Adds a product using a data fixture
* Executes $this->someLogic->execute($product) on the product
* Checks if the result is true.
Sthis->someLogic has the correct object assigned in the setup () method-Product creation and the tested logic must be executed in the context of two different store views with IDs of 3 and 4, which have been created and are available for the test.
How should the Architect meet these requirements?