"Magento 2 Developer’s Cookbook"

How to Import Configurable Product with Multiple Configurable Options to Magento 2

- E-Commerce, Fire development, Magento 2

Magento 2 import export debug log

Some Magento 2 users complain that it is impossible to import a configurable product to Magento 2 if it has more than one configurable option. Unfortunately, it is valid for some versions of the platform, in particular, 2.1.3. If you also face this issue, you’ve come to the right place because we shed light on how to import configurable products with more than one configurable option (selectable attribute) to Magento 2 below. Below, you will find solutions provided on StackExchange. Since they are aimed at technical specialists, we also discuss another option that is way more intuitive and user-friendly. More tips are available here: Developer’s Cookbook. Continue Reading

How to write and get config values by scope in Magento 2

- Fire development, Magento 2

Magento 2 import export debug log

In the following article, we’d like to draw your attention to an essential feature of Magento 2 – the ability to write and get config values by scope. Unfortunately, it is less documented than others, but we are here willing to help you! Note that you may need to apply different settings to different stores programmatically. Everything else is mentioned below. For more tips and advice, follow this link: Magento 2 Developer’s Cookbook. Continue Reading

How to get current quote in Magento 2

- E-Commerce, Magento 2

Magento 2 import export debug log

In the following article, we shed light on how to get a current quote in Magento 2. To be more exact – from your Magento 2 shot. Why does one need this action? It is mainly utilized for manipulating a cart before creating an order from it. A current quote object provides you with access to all items and enables doing some checks or manipulations with them. You can find more useful tips here: Magento 2 Cookbook. Continue Reading

How to get a store in Magento 2 programmatically?

- Fire development, Magento 2

Magento 2 Development

In the article below we shed light on how to get a current store in Magento 2 programmatically. The following information is useful when you create a PHP script or Magento 2 module. Sometimes, it is necessary to check, which store is currently active or for which store you need to get or change values. The procedure is quite straightforward: you need only a few lines of code to do that. More tips from Magento 2 cookbook. Continue Reading

How to fix Magento 2 item with the same ID already exists error

- E-Commerce, Magento 2

Magento 2 item with the same ID already exists error

In the following post, we shed light on how to fix the “Item (Magento\…) with the same ID already exists“ error in Magento 2. The problem occurs when you delete a product manually, and the product with this entity_id is no longer available on either the frontend or backend. You can find more information about other Magento 2 errors here: Magento 2 Developer’s Cookbook Continue Reading

How to solve Magento 2 var/generation cannot be deleted problem

Magento 2 import export debug log

You might have already faced the var/generation cannot be deleted warning while setting up a new Magento 2 shop. However, this problem is not serious, and you can easily fix it with almost zero effort. In the following article, we shed light on the solution of the Magento 2 ‘var/generation cannot be deleted’ issue. You can find more tips here: Magento 2 Developer’s Cookbook. Continue Reading

How to get option label from dropdown in Magento 2

- Fire development, Magento 2

get option label from dropdown in Magento 2

A frequent search task among Magento developers is to get an option label from a dropdown. However, it is quite confusing for beginners since the actual value of a drop-down product attribute is a number. Many newcomers expect that it is a text. But there is nothing to worry about. Below, we explain how to get an option label from a dropdown in Magento 2 as well as shed light on everything you need to know to begin working with dropdown product attributes.  More coding tips are available here: Magento 2 Developer’s Cookbook.

Continue Reading

How to get a product by ID in Magento 2

- Fire development, Magento 2

Magento 2 get product by ID

If you want to get a product by ID in Magento 2, the platform offers several different methods to do that. And since it is one of the most frequently used operations in a programmer’s routine, we describe every approach below. Each method is unique and suitable for different use cases. You can utilize them to get products in third-party modules, scripts, or phtml files. Therefore, let’s see how to get products by ID in Magento 2. More coding tips are available here: Magento 2 Developer’s Cookbook. Continue Reading