Magento 2 practice questions
- You added 3 product to the cart. What is the price will be final?
BasePrice - 50
SpecialPrice - 60
TierPrice for 2 products and more - 57
CatalogPrice Rule applied for 10% discount
- A customer wants to change the 404 pages completely
How to perform it?
- A customer wants to change the 404 pages content
What is the easiest way to do it?
- What is Magento vault?
- To create a new configuration type(Choos 4):
- The store owner has custom system of rewards for the customer. They want to add Balance with reward points to the Customer Account Dashboard.
How do you customize it?
- An order has the additional attribute "Extended Guarantee Period". You want to show it as a column inside order history in Account Dashboard.
How to add it?
- You want to sell a set of furniture. It is possible to order a table with adjustable size and color, change amounts and color of chairs.
Which is the product type you choose?
- You added a **configurable** product to the cart.
You see configurable thumbnails image in cart.
How to change it?
- You added a **grouped** product to the cart. You see simple thumbnails image in cart. However want to see the same image for each option.
How to change it?
- What the requirement for adding an extension attribute to an entity?
- You created a plugin for some method. Your business logic require doesn't call the original callable(proceed) method.
What happened? (choose 2)
- Where are the locations of a template in Magento 2? (Choose 2)
- How templates are initiated?
- Which products attributes are static? (choose 3)
- Which products attributes are static? (choose 2)
- Where Magento 2 storing category name?
- In your module, you use constant MagentoCatalogModelProductType::TYPE_SIMPLE.
Which type of dependency you should set in composer.json
- You inherited a class from 3rd party module.
Which type of dependency you should set in composer.json?
- You extended layout of 3rd party module.
Which type of dependency you should set in composer.json?
- You use the method from the 3rd party module. But you check if module enabled.
Which type of dependency you should set in composer.json?
- You created a plugin for ProductRepositroyInterface.
Which type of dependency you should set in composer.json?
- How to upgrade Magento 2 CE for specific version locally(in developer mode) (Choose 2)
- What is different between **entitytype_save_after** and **entitytype_save_commit_after**? (Choose 2)
- You want to prevent the collection loading in the specific method.
You have some condition(for example Customer Groupe)
What is the best way to customize it
```
public function loadingFoo($bar)
{
return $this->collection->load();
}
```
- You want to add your custom data to MagentoCheckoutModelCompositeConfigProvider:getSerializedCheckoutConfig.
What is the best way to customize it?
- What are GDPR and CCPA?
- How to create a Custom Order Status? (choose 2)
- You have form input in UI component form.
How to add validation?
- How to add a custom shipping carrier?(choose 2)
- How to provide data from backend to UI component?
- How can you restrict access to extension attributes?
- What do extension attributes allow? (choose 2)
- What do extension attributes allow? (choose 2)
- You creating customer address custom attributes. Which config you should add that allows you to edit the attribute in admin? (choose 2)
- You want to filter data from ProductRepository::getItems()
What will you do?
- By default you have product url:
**Example**: http://mystore.com/helena-hooded-fleece.html
You have requirement including category path for all products
**Example**: http://mystore.com/clotheth/hooded/helena-hooded-fleece.html
- What does FrontController do in Magento2?
- How to add a custom router?(choose 2)
- What is the first argument in plugins?
- How to get original arguments in After Plugin?
- Magento area types are(choose 3):
- What pattern are you use each time when you adding something to di.xml
- How to reduce a performance impact for classes with a big amount of dependencies in a 3rd party modules?
- Preferable way customizing Magento_Checkout/js/view/shipping in Magento checkout
- You want to convert data to lower case before an EAV attribute for ProductEntity saves.
What will you choose?
- You want to validate data before an EAV attribute for CategoryEntity saves.
- What steps you should perform for adding viewModel to the block.(choose 2)
- You need access to some data in myTemplate.phtml.
What is the recommended approach?
- How to get viewModel in a template?
- A customer wants to add an extra block to product detailed page after **SKU**
- How to create a new indexer?(choose 3)
- How to use a Content Delivery Network for Media Files?
- What is the difference between varchar and static attributes?
- What minimum requirements for creating a custom block?
- Where do you set default config values for system configs?
- You added to default.xml
```
<referenceBlock name="content">
<block name="myHeavyBlock" cacheable="false" template="havyBlocks/template.phtml"/>
</referenceBlock>
```
All pages become very slow. What happened?
- You want to add a discount when customers order more than 3 products.
How to do it?
- Differences between developer and production mode? (choose 3)
- How to ship an item to a different location?
- Does Magento 2 use cookies out of the box?
- Can Magento 2 work without cookies?
- What kind of **Catalog Input Type for Store Owner** must you set to make the attributes filterable in Layered Navigation? (Choose 2)
- What kind of **Catalog Input Type for Store Owner** must you set to make the attributes filterable in Layered Navigation? (Choose 3)
- Advantages of using EAV for a merchant
- Does Magento 2 support SOAP?
- What interface should implement Each Action class?
- 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?
Question from https://u.magento.com/free-study-guide
- 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_idprogrammatically.
In which type of setup script do you create the EAV attribute?
Question from https://u.magento.com/free-study-guide
- You are facing a bug, which is supposedly caused by the customization of MagentoCatalogApiProductRepositoryInterface::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)
Question from https://u.magento.com/free-study-guide
- You are implementing customization of the sales management within a module MyCompany_MySalesProcess. You have created several event observers to add 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?
Question from https://u.magento.com/free-study-guide
- You are creating a new module to extend the functionality of the Magento application.
What files are required?
- What are the correct ways to call and initialize JavaScript in *.phtm templates?(choose 2)
- A customer asked you to add the VAT number field to the shipping address form on checkout.
What steps should you perform to achieve this? (choose 3)
- Which Magento 2 products are composite? (choose 3)
- The existing page layout does not meet your requirements. You created a new page layout *3-columns-double-footer*.
Should you do something else to get your page in the layouts list?
- How to add and display a category attribute? (choose 2)
- Keeping maintainability in mind, how do you add a new link to the customer account sidebar?
- What ways are possible to wrap a block with an HTML tag?
- What are valid plugin types? (choose 3)
- Keeping maintainability in mind, how do you customize the format of addresses in emails?
- What is the purpose of the getFlatColumns method in an EAV's Source model?
- What only happens in the Production deploy mode?
- You are configuring a new entry in etc/adminhtml/system.xml that is a select / dropdown type.
What must the class for the source model extend or implement?
- Magento uses the concept of service contracts to create a blueprint for modules to communicate with each other.
Where are these service contracts stored in a module?
- You need to add a fee (additional to tax and shipping) to every order placed.
In what file do you specify the new total?
- UpgradeSchema.php only provides one method: upgrade.
What method do you use to determine what code to execute for what method?
- You are customizing a third-party module and need to prevent an event handler from triggering.
Keeping upgradeability in mind, how do you do this?
- What additional tools are available in the backend and not in frontend? (choose 3)
- You have created a custom theme and need to customize the view/frontend/templates/product/list.phtml file in the Magento_Catalog module.
Where do you place this file inside your theme?
- What category path is the category that is the closest to the top of the tree, but still is visible on Layered Navigation?
- How do you create a new cache type?
- You are tasked with installed a new 3-party module to show product promotions to a customer.
What two steps do you take to make the module active? (choose 2)
- Where are admin uiComponents located?
- What files are required for a new custom theme? (choose 2)
- You performing a code review on an existing module.
You see some interesting files in the Setup/ folder.
What files in the Setup/ does Magento understand? (choose 3)
- You need to create a custom price calculator for simple products.
You have already creates the new price model.
Keeping simplicity in mind, what additional steps do you take to implement this? (choose 2)
- You need to make some modifications to an entity before it is saved to the database.
Your tool of choice is a plugin.
What are requirements for a plugin? (choose 3)
- You need to programatically create a new customer attribute that would be editable in admin panel.
What steps are required to do this? (choose 2)
- You are adding an extension attribute to the CustomerInterface class.
You have specified data for the extension attribute, but when you check the database, nothing has been saved.
Why is that?
- What Magento layout XML instructions instruct Magento to render HTML output?
- You are inspecting an existing Magento installation. Where do modules that affect the functionality of the Magento application reside? (choose 2)
- As you create a controller in Magento's adminhtml area, you must configure it to respond appropriately to the ACL. Keeping simplicity in mind, what steps do you take to implement this?
- What is the difference between setting cacheable="false" on a block in layout XML attribute and the block's getCacheLifetime() === null?
- When setData (' some', 'value') is called on an EAV entity and the entity is saved to the database?
- Applying the shopping cart rule's action affects the quote item by setting the quote item's...
- How to make attributes be able to be used in catalog price rules?
- What is the minimum PHP version required for magento 2.2 installation?
- Can a customer include an image with their product review?
- Choose the correct relationship between tax and discount in magento
- Which product types implement a parent-child relationship between product entities?(choose 3)
- As you are assessing a 3rd-party module, you see this file: /Setup/InstallSchema.php. What is the intended purpose of this file?
- Which tags below are not used in email template? (choose 2)
- Which element below has effect on Tax and price of product when customer checkout?
- A gift card is a product type?
- Are you required to include VAT in consumer purchases?
- Which of the following operations is most impacted (in time required) by a large number of products and stores?
- What is the factors that make Magento website slow?
- How do you enable customer comments on orders in Magento 2?
- If your client has two websites that sell different products yet wants to share a Magento installation for Admin purposes, you will need to set up:
- The final price for the product on the product view page is....
- Assume you have saved a product in the Catalog. Will your last changes be taken into account for rule-based related products?
- Does Magento 2 have a “Saved Credit Card" payment method?"
- How to set order for a magento collection? (choose 2)
- How can Customer Groups impact prices? Select all that apply. (choose 3)
- What is a database sharding?
- How to insert static block in template file(.phtml)?
- How do you enable Google Analytics eCommerce tracking in Magento?
- How to get product collection which IDs are in array(16,17,18,20) ?
- Discount "To fixed Ammount" 10$ means:
- In Magento. when is order closed?
- Magento 2 includes a responsive theme (Luma). Responsive web design is:
- Magento has several ways to notify a custom module when changes are made in the database. What are they? (choose 3)
- In Magento Enterprise, banners can be displayed based on (select all that apply):
- What can be done with etc/di.xml? (choose 3)
- What does the EU cookie law require with regards to cookie consent?
- What framework does Magento 2 use for its REST API?
- What is the address in which tax is calculated?
- What is omnichannel retailing?
- What is a billing agreement?
- What is the difference in the effect of calling the invoice capture () method versus the invoice pay () method?
- What change does Magento 2 introduce in regards to creating an account during checkout?
- What is the difference between grand_total and base_grand_total?
- To change the checkout mode from GUEST to REGISTER and vice versa, which event is needed?
- What are the default required attributes for creating a product?
- What file in the etc/ folder do you need to create to instantiate an extension attribute?
- To delete button that is available on the system's form as button Back, Save, Save and Continue, Delete - we use the following way
- What types of subject does Magento create cache for?(Choose 2)
- What is the order to generate 3 events: (1)sales_order_place_after, (2)sales_convert_quote_to_order,(3)sales_order_save_before
- Where do you specify whether or not a customer can checkout as a guest?
- What is the Visual Merchandiser?
- Where can the PayPal express checkout button be displayed (choose 2)
- When declaring a field in system configuration in Magento ( in file system.xml), which input types need to declare source_model? ( Choose 2)
- What is true for configuration cron "1 1 1 * *" in Magento?
- What Magento classes implement MagentoFrameworkControllerResultInterface (choose 3)
- What two places can change inventory levels?
- What kind of subject is used to provide data, called from layout file?
- What product types do not need to ship?(choose 2)
- When does an inventory level decrease through the ordering process?
- When customers translate one word in three following position: table translation, i18n, which position will be displayed?
- What type of authentication does Magento 2's API use?
- When we creates an attribute (price format) to product, where is it stored?
- Where do you configure design options in Magento 2?
- What key feature was added to Magento 2 CE?
- Your client has a single catalog but sells on two different domains.
While the design and product selection are different between two sites, the biggest difference between the two sites happens to be the shipping and payment methods. What would be better?
- Which entity collects the grand_total and base_grand_total that the different total models collect?
- You have an instance of the ProductCollection. What method do you call to load a subset of attributes for each product?
- You are trying to figure out why some products have disappeared. One step in this process would be to rerun the index process. What is the command for this?
- Which one of the following class types directly charges a credit card when capturing an invoice in Magento admin?
- Which statement correctly describes order state and order status?
- Which one of the following EAV attribute types may be used for layered navigation in native Magento?
- Which of following caches are in Magento 2.2 Community? (choose 7)
- Which table to store the relationship data between configurable product and it's simple product?
- You have built a customization that changes a template in another 3rd-party module. That change is not taking effect. You check to ensure the template file path is correct—it is. Which two things are the problem? (choose 2)
- Which of the following is NOT a native shipping method?
- You are evaluating a 3rd-party module and you see some custom functionality that is executed in an observer of the checkout_cart_add_product_complete.It is obvious that this is supposed to run every time a product is added to the cart. Is there a problem?
- You have been tasked with writing an addition to Magento's CLI that will synchronize the database with an external source. Which directory should you put your new CLI command into?
- There are some products, that always were visible. After product import, they disappeared on frontend. What is possible reason they are not shown in categories? (choose 3)
- You are creating an implementation of the grid UI component for a listing of product promotions in the backend. Where do you put it?
- Your client current sells in North America with an English web site but would like to branch out internationally with a Spanish and French website. To maintain one admin panel for all languages and the same theme, you need to set up
- Which of the following features does Magento Community NOT have (when compared with Magento Commerce)?
- Which tag below is used to check config in layout?
- You want to prevent execution of some method. What is the best way?
- How to convert attribute value on save (e.g. from 1,2,3 to 1_2_3) taking into account the best practice, in case of invalid input exception needs be thrown?
- How to eliminate performance degradation when using constructor dependency injection?
- How to add product attribute that would store a static block reference ?
- What is the relationship between block and template (choose 3)
- Customer use a multi currency on website, but need to have a default price in the order export. What you need to get it in the generated file?
- Customer has one website and English, Italy, Spain stores. He wants to add a 20% discount for all products on Spain store:
- What is the minimum requirement to create a CLI command?
- Customer has own ERP. Customer wants to get data about invoice in his own ERP. What approach you will choose?
- How to get path to module directory?
- Customer wants to sale only one quantity of each product per one customer. So the one customer can buy 2 different products, but each item couldn't have quantity more then 1.
- Which entity types support an EAV functionality?(choose 3)
- Customer wants to show a welcome message with a user's name on all pages in the header.
- You need to add a sensitive configuration setting to store password. Where your customizations will be taking into account security?
- You need to add a sensitive setting. How to do it? choose 2
- What is purpose of the category with ID 0?
- Describe 2 cases when need to create your own block class
- You have already implemented custom module, but now you need to add new order attribute, to save the custom data
- You need to handle url like `https://domain1.com/rest/v1/custom`. How to do it?
- you are going to create console command that will use configs but your websites has many stores. How will you resolve config geting:
- you have webshope under developement. you are going to upgrade magento to new version. specify steps to do it:
- your webshop sells cars parts. customer wants to display all manufacturer list on cart page per each product.
- Custom data is saved into database from ERP API. You have a block that renders that info on all pages on front. On some pages it is correct, on some is not.
When some changes are done in API, it talks Magento about it. What is wrong?
- There is plugin where it a product final price is needed. You expects the $product to be an instance of ProductInterface. But It doesn't have method getFinalPrice.
MagentoCatalog module's class realizes that interface and it has a method getFinalPrice().
- You have a text attribute. Your managers have access to edit products. Sometimes the value of attribute contain extra spaces when is rendered on front. How would you fix it?
- You need to show some additional data when it calls API method on a customerRepository, but not save it in database. What you will do? choose 3
- You installed new module, added plugin, but it doesn't work.
Class:
```
final class zz{
final protected function a (){};
public function authirize (){};
private function b (){};
}
```
- 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?
- What interface should a frontend controllers action implement?
- 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?
- You are building a new module to add extra functionality to the Magento application.
What files are required?
- You are building a new module that needs to utilize a custom URL path like: /maps/{MAP_ID}
What steps do you take to accomplish this?
- You need to add a residential / commercial destination selector to the shipping address on the checkout.
What are the steps needed to add this selector?
- Magento's JavaScript application has a means to instantiate a object through RequireJS. What is the correct node to do this?
- Which native Magento products are also composite products?
- You need to create a variation of the 2columns-left page layout. This new layout is named text.
How do you instruct Magento regarding the new layout type?
- You are troubleshooting a product with a price of $25.
The special price is $20 and is active through 2017.
The tiered pricing has a discount for 2 or more products at $22.00.
Additionally, a catalog price url applies a 10% off discount.
What is the final price that is shown on the product page?
- How do you make a new category attribute available to be edited in the admin panel?
- What ways are possible to wrap a block with an HTML tag?
- What are valid plugin types:
- Keeping maintability in mind, how do you customize the format of addresses in emails?
- What only happens in the Production deploy mode?
- You are configuring a new entry in etc/adminhtml/system.xml that is a select / dropdown type.
What must the class for the source model extend or implement?
- You need to add a fee (additional to tax and shipping) to every order placed.
In what file do you specify the new total?
- You are customizing a third-party module and need to prevent an event handler from triggering.
Keeping upgradeability in mind, how do you do this?
- Magento's Product repository uses the getList($filter) method retrieve a list of products.
As you are preparing to retrieve a list of products, you need to specify what products to retrieve.
Which of the following classes will help you formulate the filter?
- What additional tools are available in the backend and not in frontend?
- At what URL would you visit the controller listed above
You see code in `etc/frontend/routes.xml`
```
<route id="mymodule" frontendName="user-subscriptions">
<module name="MyCompany_MyModule" />
</route>
```
You have placed a controller in
`Controller/Index/Subscribe.php`
At what URL would you visit the controller listed above?
- You are tasked with building a new module to show product promotions to a customer. What two steps do you take to make the module active?
- How do you create a new cache type?
- What files are required for a new theme?
- A module contains the following files:
```
ModuleA/
|-- etc/
|-- di.xml
|-- frontend/
|-- di.xml
```
When a visitor is browsing the frontend of the website, what happenes if a similar XML directive is specified in both di.xml files above?
- You need to create a custom price calculator for simple products. You have already creates the new price model.
Keeping simplicity in mind, what additional steps do you take to implement this?
- Where are admin uiComponents located?
- You need to make some modifications to an entity before it is saved to the database. Your tool of choice is a plugin.
What are requirements for a plugin?
- You need to programmatically create a new customer attribute.
What steps are required to do this?
- You are inspecting an existing Magento installation.
Where do modules that affect the functionality of the Magento application reside?
- As you create a controller in Magento's adminhtml area, you must configure it to respond appropriately to the ACL.
Keeping simplicity in mind, what steps do you take to implement this?