Fix Same ID already exists error in Magento 2

How to Fix Same ID already exists error in Magento 2

Item (Magento\Catalog\Model\Product\Interceptor) with the same “ID” ID already exists. A common source of this error is a duplicate entry in cataloginventory_stock_item.  The mentioned ID was a product that I manually deleted. I checked it twice (in  backend and database) – there is no product with this entity_id. I show you how to solve this error.…

Details
Set Price Format using JavaScript in Magento 2

How to Set Price Format using JavaScript in Magento 2

Sometimes during Magento 2 development, When you pass price value phtml to js at that time, you need to display price with currency from js or you may have some cases where you need to format price using javascript. Convert a plain number into a price format with a currency symbol using any one of…

Details
Magento 2 add ifconfig in override block XML

Magento 2 add ifconfig in override block XML

The use of ifconfig is for condition which is coming from system config values. The value of this will be 0 and 1(boolean). According to that value, the block will be rendered. Here we learn about in Magento 2 add ifconfig in override block XML. Any block can be configured to show or not based…

Details
Magento 2 Get Product Salable Quantity

Magento 2 Get Product Salable Quantity Programmatically

The Salable Quantity first appears in Magento 2.3 release together with the Multi-Source Inventory system. It allows you to manage all your warehouses in one place and avoid dead stocks and out-of-stock situations. You can see the additional column at the product grid – salable quantity. The product grid salable quantity.   Salable Quantity is…

Details
Magento 2 Add Product To Cart With Custom Price

Magento 2 Add Product To Cart With Custom Price

A custom price of the product when Magento 2 add product to cart by using Observe. In many cases, the clients are willing to allow add product to cart at a custom price. This operation already calculated price by Magento. Magento calculates the lowest price from one of the base price, special price, tier price,…

Details
add custom link in navigation

How to Add Custom Link in Navigation Menu in Magento 2?

I explain to add custom link in navigation menu for magento 2. In Navigation Menu, there are categories and subcategories links available. But, sometimes we need to add some custom links in navigation bar. The admin under the Catalog -> Categories menu. By default, this menu will only contain categories and nothing else, and therefore…

Details
Add Dynamic Custom Tab

How to Add Dynamic Custom Tab in Product Page Magento 2

Magento 2 provides much information about the product on the Product details page. Tabs are more useful when a product has multiple types of descriptions and information. We can add a custom tab on the product details page. If you need to add dynamic custom tabs on the product details page then follow the below…

Details
Call phtml File From Helper

Call phtml File From Helper In Magento 2

We can call phtml file form many ways. Here we will show you how to call phtml file From Helper. Helper functions are accessible for all areas of Magento.

Add below code in Data.php at app/code/VendoreName/ModuleName/Helper

Details
Add Custom Select Options Attribute

Add Custom Select Options Attribute in Category Form Magento 2

We learn how to create custom category attributes using InstallData.php in Magento 2. When we develop modules or themes we need some custom attributes in category form for some requirements. We can add different type of category attribute like toggle, select, text, WYSIWYG editor, etc. type files in Category form. We used the InstallData.php file…

Details
Add Store View in Admin

Add Store View in Admin UI Grid For Magento 2

Magento 2 provides set up multiple stores. It is useful when a store owner decides to expand the business or manages multiple stores from a single administration or establishes stores for more than one location. So that’s why developer needs to develop their module which supports multi-store. Sometimes we need to show different store views…

Details