Adobe AD0-E716 Adobe Commerce Developer with Cloud Add-on Exam Practice Test

Page: 1 / 14
Total 69 questions
Question 1

During database migration in the Adobe Commerce Cloud integration environment, a developer experienced a disk space error causing the database import to fail.

How would the developer fix this issue?



Answer : A

The developer can fix this issue by increasing the disk space of the database service. The database service is one of the services that run on the Adobe Commerce Cloud platform and provide functionality for the application. The database service uses MySQL as the database engine and stores data for products, customers, orders, etc. The disk space of the database service determines how much data can be stored and processed by the database. If the disk space is insufficient, the database import can fail with a disk space error. The developer can increase the disk space of the database service by modifying the .magento/services.yaml file and redeploying the environment. Verified Reference: [Magento 2.4 DevDocs]


Question 2

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_delayed has been created as a boolean and 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)

Create a new file etc/catalog_attributes.xmi:

B)

Create a new file etc/extension attributes.xmi:

Create a new file etc/eav attributes.xmi:



Answer : A

To allow the is_delayed EAV attribute to be used in the .phtml cart page, the developer needs to create a new file called etc/catalog_attributes.xmi. This file will contain the definition of the is_delayed attribute.

The following code shows how to create the etc/catalog_attributes.xmi file:

XML

<?xml version='1.0'?>

<catalog_attributes>

<label>Is Delayed</label>

<note>This attribute indicates whether the product is delayed.</note>

<sort_order>10</sort_order>

<required>false</required>

</catalog_attributes>

Once the etc/catalog_attributes.xmi file has been created, the is_delayed attribute will be available in the .phtml cart page. The attribute can be accessed using the getIsDelayed() method of the Product class.

PHP

$product = $block->getProduct();

$isDelayed = $product->getIsDelayed();

The isDelayed variable will contain the value of the is_delayed attribute. If the value of the attribute is 1, then the product is delayed. If the value of the attribute is 0, then the product is not delayed.


Question 3

An Adobe Commerce developer is tasked with creating a custom block that will be displayed on every page in the footer of the site.

After completing and optimizing the development, the developer notices that the block takes too much time to be generated on each page and decides to store it in the system cache after enabling it for all cache groups.

What would be the minimum requirement to achieve this?



Answer : C

To store a block in the system cache, the developer needs to set values for both the cache_lifetime and cache_key data properties of the block. The cache_lifetime property specifies how long the block should be cached, and the cache_key property specifies a unique identifier for the block.

The following code shows how to set the cache_lifetime and cache_key data properties of a block:

PHP

$block->setData('cache_lifetime', 600);

$block->setData('cache_key', 'my_custom_block');

Once the cache_lifetime and cache_key data properties have been set, the block will be stored in the system cache and will not be regenerated on each page load.


Question 4

An Adobe Commerce developer has added a new configuration field to the admin are

a. The path for this option is general/store_information/out_of_hours_phone.

Keeping simplicity in mind, how would the developer ensure this option contains a valid US telephone number?



Question 5

An Adobe Commerce developer is working on a custom gallery extension.

The module uses the Magento\catalog\Model\iinageUploader class for image uploading. The admin controller for custom image uploads is Vendor\CustomGallery\Controller\Adminhtml\Image\Upload.

The images need to be stored in different basePath and baseTmpPath than the default ones.

How can the default imageuploader class be extended and used without affecting the other modules that are already using it?

A)

B)

C)



Answer : B

According to the ImageUploader component guide for Magento 2 developers, the ImageUploader UI component gives users the ability to upload images to the Magento Media Gallery. This component is a variation of the FileUploader component and uses the same configuration settings. The ImageUploader component uses the Magento\catalog\Model\iinageUploader class for image uploading, which has properties such as basePath and baseTmpPath that define where the images are stored. To extend the default imageuploader class and use it without affecting the other modules that are already using it, the developer needs to create a virtual type of this class in their module's di.xml file and specify different values for basePath and baseTmpPath. The developer also needs to inject their virtual type into their admin controller using the imageUploader argument. Therefore, option B is the correct answer, as it shows the correct di.xml and controller code to extend and use the imageuploader class. Verified Reference: https://devdocs.magento.com/guides/v2.3/ui_comp_guide/components/image-uploader/


Question 6

An Adobe Commerce developer is working on a Magento 2 instance which contains a B2C and a B2B website, each of which contains 3 different store views for English, Welsh, and French language users. The developer is tasked with adding a link between the B2C and B2B websites using a generic link template which is used throughout the sites, but wants these links to display in English regardless of the store view.

The developer creates a custom block for use with this template, before rendering sets the translate locale and begins environment emulation using the following code:

They find that the template text is still being translated into each stores language. Why does this occur?



Answer : B

The startEnvironmentEmulation() method resets the translation locale to the one of the emulated stores, which overrides the locale the developer has set when the order of setLocale() and startEnvironmentEmulation() is used as displayed above.

The correct way to achieve the desired result is to use the emulate() method to temporarily modify the translation locale. The following code shows how to do this:

PHP

$this->_translate->emulate('en_US');

// Render the template

$this->_translate->revert();

This code will set the translation locale to English before rendering the template, and then revert the locale back to the default value after the template has been rendered.

The startEnvironmentEmulation() method is used to emulate a different store view or website. This can be useful for testing purposes, or for developing features that need to work in different environments.

The emulate() method is used to temporarily modify the translation locale. This can be useful for rendering templates in a specific language, or for testing features that need to work in different languages.


Question 7
Page:    1 / 14   
Total 69 questions