How to get stock name by website code in Magento 2?

This article is useful when your system has an inventory module enabled and uses multiple sources and stock functionality for a given website.

To Retrieve the Stock name by Website code, You need to use the interface Magento\InventorySalesApi\Api\StockResolverInterface.

Given Interface is responsible for getting the linked stock-related information for a certain sales channel. Continue reading “How to get stock name by website code in Magento 2?”

How to fetch current stock id value from current website in Magento 2?

Magento with multiple stocks available at the website level and if you want to get the current stock ID value dynamically in Magento, you can fetch the value by using Magento inventory module functionality.

Retrieving stock ID will be helpful while you are using multi-source functionality in your website.

Let’s say your stock ID name is UK-stock (ID: 4) and you want to fetch the ID at any specific place in your code level, You can get it by using the GetStockIdForCurrentWebsite class. Continue reading “How to fetch current stock id value from current website in Magento 2?”

How to upgrade Magento security patch (-p*) version in magento 2?

In the Magento codebase, the Adobe team regularly releases security patches for the ongoing Magento version.

To upgrade the latest Magento security patch, you need to do just a little bit of changes to the composer.json file to secure your store.

It’s better to upgrade the security patch version while Adobe announced the release of new security patches. Continue reading “How to upgrade Magento security patch (-p*) version in magento 2?”