Magento2 Cert questions dump package 3.thelightJune 28, 2019Questions Dump4 CommentsMagento2 Cert questions dump package 3. Try this package to pre-exam cert. It will have you a lot of…Please enter your email: 1. 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? Override the cart/form.phtml template and add logic for the sample product type. Create the layout file, checkout_cart_index.xml, and update the cart page’s uiComponent to appropriately render the sample product type. Create the layout file, checkout_cart_index.xml, and reference the checkout.cart.renderers block and add a block with the as=”sample” attribute. 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. 2. Magento and third-party developers can find it difficult to track and report the dependencies that customized extensions have on other extensions. To address these issues, the Magento system introduces service contracts. What is a Service Contracts – Data interfaces ? set of JS Library that are defined for a module includes js Library set of PHP interfaces that are defined for a module includes data interfaces set of UI Library that are defined for a module includes ui content set of API interfaces that are defined for a module includes web APIs 3. You need to control access to a custom controller action. How do you tell Magento about this new control option? Use the CLI to add the new resource option. In the controller, implement the _isAllowed method. Create etc/acl.xml and add Create etc/adminhtml/acl.xml and add 4. You are building a new module to add extra functionality to the Magento application.You want to works with CustomerData the data stored on the client side. Where initialized sections Cart and Directory-data are on the server side via the classes ? Magento\Checkout\Block\Cart and Magento\Checkout\Block\DirectoryData Magento\Checkout\CustomerData\Cart and Magento\Checkout\CustomerData\DirectoryData Magento\Checkout\Plugin\Cart and Magento\Checkout\Plugin\DirectoryData Magento\Checkout\Api\Cart and Magento\Checkout\Api\DirectoryData 5. You are building CLI that use the console to create a customer account with our custom command as like php bin/magento customer:user:create –customer-firstname=”Mahin” –customer-lastname=”Rahman” –customer-email=”mahin@example.com” –customer-password=”mahin@123″ –website=”1″ using: protected function configure() { $this->setName(‘customer:user:create’) ->setDescription(‘Create new customer’) ->setDefinition($this->getOptionsList()); } protected function getOptionsList(){ return [ ——————]; } Which below Option are not required in blank? (Choose 2) new InputOption(Customer::KEY_FIRSTNAME, null, InputOption::VALUE_REQUIRED, ‘(Required) Customer first name’), new InputOption(Customer::KEY_WEBSITE, null, InputOption::VALUE_REQUIRED, ‘(Required) Website ID’), new InputOption(Customer::KEY_PASSWORD, null, InputOption::VALUE_REQUIRED, ‘(Required) Customer password’), new InputOption(Customer::KEY_SENDEMAIL, 0, InputOption::VALUE_OPTIONAL, ‘(1/0) Send email? (default 0)’) new InputOption(Customer::KEY_LASTNAME, null, InputOption::VALUE_REQUIRED, ‘(Required) Customer last name’), new InputOption(Customer::KEY_EMAIL, null, InputOption::VALUE_REQUIRED, ‘(Required) Customer email’), new InputOption(Customer::KEY_STORE, null, InputOption::VALUE_REQUIRED, ‘(Required) Store ID’), 6. 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 You inject \Magento\Framework\DB\Select instead of the collection and perform the desired query independently of the collection. You inject \Magento\Quote\Api\CartItemRepositoryInterface because low level query customizations are not allowed. You change the argument type to \Magento\Quote\Model\ResourceModel\Quote\Item\CollectionFactory and instantiate the collection using $collectionFactory->create(); You remove the constructor argument and use ObjectManager::getInstance()- >create(\Magento\Quote\Model\ResourceModel\Quote\Item\Collection::class) to instantiate the collection instead. 7. You are customizing the display of product details page. On this page ur customer need to change the url in which the product category name will be appear as http://mystore.com/women/tops-women/helena-hooded-fleece.html , Keeping ,maintainability in mind ,How to get product url with category? Admin -> Stores -> Configuration -> Catalog -> Catalog -> Search Engine Optimization -> “Use Categories Path for Product URLs” set to “Yes” You Can Build category URL path \vendor\magento\module-catalog-url-rewrite\Model\CategoryUrlPathGenerator.php $product->setCategoryId($categoryId)->getProductUrl(); It is not possible to display Categories name on product url 8. What interface should a frontend controllers action implement? \Magento\Framework\App\ActionInterface \Magento\Frontend\Controller\ControllerInterface \Magento\Framework\App\ControllerInterface \Magento\Frontend\Controller\ActionInterface 9. You see this code in etc/adminhtml/routes.xml: You have placed a controller in Controller/Index/Subscribe.php. If you want to create layout XML instructions for this controller, what would be the layout XML’s filename? mymodule_index_subscribe.xml user_subscriptions_index_subscribe.xml mymodule_subscribe_[ACTION NAME].xml user_subscriptions_subscribe_[ACTION NAME].xml 10. You are building CLI that use the console to create a customer account with our custom command, Adding a new command to CLI is based on passing on the argument from the XML level to the class . Dependency Injection comes in handy here. you create the file app/code/Mycompany/Customer/etc/di.xml with the following content: What is the correct in below? Magento\Framework\CommandList\Console Magento\Framework\CommandList Magento\Framework\Console\CommandList Magento\Framework\Console 11. How do you instruct Magento to enable a new module? bin/magento module:enable MyCompany_MyModule Magento automatically enables all new modules. Go to Admin > System > Module Management. Add MyCompany_MyModule to the setup_module table. 12. You are reviewing a module to some special functionality to the Magento 2 application, You see directory /Console, What task you think in this directory contain script for this modules? contains CLI commands contains section files contains any PHP classes exposed to the API open directory /Console & check script what code contaib contains cron job definitions. 13. As you are scanning folder in the vendor/module-catalog directory, you see a directory that is named Ui. What is this folder’s purpose? It contains templates, CSS and JS pertinent to the module. It contains UI component data providers and component information. It is not a normal folder and further investigation is necessary to determine the purpose. It contains the block PHP files that render HTML onto the frontend. 14. You need to add the Google Tag Manager (GTM) to every page. What three steps do you take to accomplish this in MyCompany_MyModule? Add into view/frontend/layout/default.xml. Create view/frontend/layout/default.xml. Copy vendor/module-catalog/view/template/script.phtml to view/template/script.phtml and add GTM script. Run bin/magento create:module:template script.phtml Create view/frontend/templates/script.phtml and add GTM code. 15. You are building an tool that imports products from an ERP. There are 20 columns of additional information that are associated with each product. This extra information must also be associated with an update time to know when to refresh the data. Keeping maintainability in mind, how do you build this into Magento? Utilize an extension attribute. Create 20 EAV attributes and check their updated_at column. Override the Product model and add the fields. Create a separate model and build code to associate the two record types. 16. You are building a new module to add extra functionality to the Magento application. What files are required? registration.php composer.json etc/module.xml etc/config.xml Setup/InstallSchema.php 17. You are reviewing a module to some special functionality to the Magento 2 application, You see directory /CustomerData, What task you think in this directory contain script for this modules? contains view files, including static view files, design templates, email templates, and layout files. Contains section files that works with the data stored on the client side. contains localization files. contains aggregated functionality. 18. You are making some major adjustments to a core Magento class (ClassA). These adjustments are only necessary when utilized from a specific Magento class (ClassB). You have created MyClass that contains the needed customizations. Keeping upgradeability in mind, how do you configure di.xml to make the substitution happen? Ensure that MyClass extends ModuleA and set the , for ModuleB to point to your new class in di.xml. Set a for ModuleA to be replaced by MyClass Create a rewrite node that injects MyClass into ClassB. Create a virtual type that extends ModuleB, specifying an for MyClass. 19. You are updating a module to add extra functionality to the Magento application, Where would Magento look for modules? app/code/VendorName/ModuleName app/vendor/vendor-name/module-name lib/vendor-name/module-name vendor/vendor-name/module-name 20. 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? You create a trait with the common methods and use the trait in the observer classes. You create a regular class implementing the common functionality as public methods and use constructor injection to make them available to the observers. You create an abstract class AbstractObserver with the common methods and extend the observer classes from it. You create a regular class implementing the common functionality as public static methods and call those from the observers. 21. You have created a module to show manufacturer-list, but in your page need to show Pagination that already ready in your block. Keeping maintainability in mind, where you call echo $block->getPagerHtml(); ? /Manufacturer/Block/Index.php /Manufacturer/Controller/Index/Index.php /Manufacturer/view/frontend/templates/content.phtml /Manufacturer/view/frontend/layout/manufacturer_index_index.xml 22. You are trying to determine why a product is not appearing in a category. What table does Magento on the frontend to locate the relationship between a category and its products? catalog_category_product_index catalog_product_parent catalog_category_product_relationship catalog_category_product 23. You have created a module to show manufacturer-list,Your customer need url as www.storeurl/manufacturer which file are mendatory to show correct url? Block: /Manufacturer/Block/Index.php Layout: Manufacturer/view/frontend/layout/manufacturer_index_index.xml Controller: /Manufacturer/Controller/Index/Index.php Layout: Manufacturer/view/frontend/layout/manufacturer.xml Templates:/Manufacturer/view/templates/content.phtml Layout: Manufacturer/view/frontend/layout/index_index.xml 24. 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? stable patch major minor 25. 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) */plugins.xml */config.xml */di.xml */events.xml Loading …What is the color of the snow? This Post Has 4 Comments Krishna 3 Oct 2019 Reply It’s question for magnto 2 Frontend developer certification’s thelight 17 Sep 2020 Reply that is professional question dump from another developer was pass. Narayan 18 Nov 2019 Reply Nice questions thelight 17 Sep 2020 Reply Thanks. I will update javascript question dump in shortest timeLeave a Reply Cancel reply
Krishna
3 Oct 2019It’s question for magnto 2 Frontend developer certification’s
thelight
17 Sep 2020that is professional question dump from another developer was pass.
Narayan
18 Nov 2019Nice questions
thelight
17 Sep 2020Thanks. I will update javascript question dump in shortest time