Summer Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ecus65

Magento Magento-2-Certified-Associate-Developer - Magento 2 Certified Associate Developer Exam

Your module adds a new controller class which will return a JSON response.

What will be the return type of the execute method?

A.

You should implement a new API endpoint instead of returning JSON from a controller

B.

The string value of \Zend_Json::encode()

C.

An instance of \Magento\Framework\Controller\Result\Json

D.

No return needed, an object that can be converted to JSON must be set as the Response body

You are working on a custom web API endpoint and have configured it in etc/webapi.xml. This config is cached as part of the config_webservice cache type.

Keeping performance in mind, how do you refresh the cached version of this config using Magento CLI?

A.

cache:clean config_webservice

B.

cache:refresh config_webservice

C.

cache:flush

D.

cache:purge

You are working on a new entity called vendor. You implemented the model, resource model and collection. You want to ensure that standard model events will be fired for your model, so an observer can be created for the events vendor_save_after, vendor_save_commit_after and others.

How do you do that?

A.

Create an entry in etc/di.xml and add the argument eventPrefix with the value of vendor

B.

Declare the $_eventPrefix property in your vendor model and set it to vendor

C.

You must implement all appropriate methods and fire the events manually

D.

Ensure that the primary key in the corresponding table is named vendor_id

Your module, MyCompany_MyModule, is using the frontName mymodule. You need to locate the class responsible for the frontend path /mymodule/custom.

What file contains the controller class for the frontend path /mymodule/custom?

A.

Controller/Custom/Index.php

B.

Controller/Custom.php

C.

Controller/MyModule/Custom/Index.php

D.

Controller/Frontend/MyModule/Custom.php

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::execute and register it in etc/crontab/di.xml

B.

Implement \MyCompany\MyModule\Cron\NewsLetterSender::execute and 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::authenticate in etc/crontab.xml

How do you persist an entity to the database?

A.

Calling the store() method on the entity’s model

B.

Calling the update() method on the entity’s collection

C.

Calling the persist() method on the entity’s repository

D.

Calling the save() method on the entity’s repository

What is the difference between online and offline shipping methods?

A.

Online means that a shipment will have a tracking number, and offline means no tracking numbers are available

B.

Online means Magento will use a shipping carrier’s API to obtain rates, offline means Magento will calculate the rates internally

C.

Online means that an item’s shipping will be processed by the merchant, offline means that it will be processed by the customer

D.

Online means that it will be sent to the customer using a shipping carrier, offline means the customer will pick up the order in person

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

A client has asked you to include category url keys in product URLs.

How is this done?

A.

Create an observer for controller_action_postdispatch_catalog_product_view

B.

This is not possible because products can belong to multiple categories

C.

Set the configuration value of catalog/seo/product_use_categories to Yes

D.

Create an after plugin on \Magento\UrlRewrite\Controller\Router::generateRewrite

A Magento industry partner shipping provider has tasked you to build their integration module called MyCompany_ShippingProvider.

Where do you define the class that provides options for the select field that enables or disables the provider in the file etc/adminhtml/system.xml?

A.

Magento\Config\Model\Config\Option\Yesno

B.

Magento\Config\Model\Config\Source\Yesno

C.

Magento\Config\Model\Config\Frontend\Yesno

D.

Magento\Config\Model\Config\Backend\Yesno