32
votes
inventory_stock_1 doest exist on Magento 2.3
You need elevated permissions to use the CREATE ALGORITHM bit
This can and will stop an import in it's tracks.
Instead use this statement to create the view
CREATE
OR REPLACE
VIEW `...
22
votes
Magento 2: Programmatically Updating Inventory
If you are using the @giel-berkers solution, you may need to set isInStock also, because it will not be automatically sets.
So, the following code was useful for me:
public function __construct(
\...
16
votes
Accepted
inventory_stock_1 doest exist on Magento 2.3
I got the solution for this, you need to create a view table inventory_stock_1 for your catalog in database.
Here is the command you need to run in your DB SQL. Make sure to update 3 things in below ...
10
votes
How to get product stock status on the listing page in Magento 2?
You can try the following code
public function __construct(
\Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry
) {
$this->stockRegistry = $stockRegistry;
}
// you can pass $...
9
votes
How to get product stock status on the listing page in Magento 2?
If you are using the only simple products in your system then using the Stock Status field check then Product status is Ok.
But when you have a configurable or bundle or group product then it is not ...
8
votes
Magento 2: Programmatically Updating Inventory
One thing the other answers missed is that if you setQty($qty), it will apply the exact value you provide. But if a sale was made for that product a moment before your save, the original qty could ...
7
votes
Accepted
Magento 2 stock inventory is not being updated
Check below settings.
Admin > Store > Configuration > Catalog > Inventory > Stock option > Decrease Stock When Order is Placed Set it to yes.
If you have a multi-website or multi-store then change ...
7
votes
Accepted
Magento 2.3 Saleable stock qty does not equal Global Attribute Qty
Check inventory_reservation:
https://github.com/magento-engcom/msi/wiki/Salable-Quantity-Calculation-and-Mechanism-of-Reservations
If you don't want to use MSI (and stick to CatalogInventory_* from 2....
7
votes
Accepted
Magento 2.3 inventory index gives The product that was requested doesn't exist. Verify the product and try again
Recently we experienced this very issue too. Solution in our case was making sure the inventory_source_item MySQL table does not contain any defunct SKU's. To lookup corrupted records in said table, ...
6
votes
Magento 2 stock inventory is not being updated
check your stock setting in admin panel
Advance Inventory->manage stock set to yes if you want to reduce quantity
6
votes
Magento Inventory Reservation Compensation command not working
This command is waiting for you to tell it what compensation to create. See https://devdocs.magento.com/guides/v2.3/inventory/inventory-cli-reference.html for more detail, but generally, what you want ...
6
votes
Accepted
"Only 0 Left" message has suddenly appeared after 2.4.2 upgrade
This is a bug affecting configurable products introduced by the new Magento_InventoryConfigurableProductFrontendUi module in Magento 2.4.2. You can read more about the issue here: https://github.com/...
5
votes
Accepted
How is the qty loaded from database?
$products = Mage::getModel('catalog/product')
->getCollection()
//->addAttributeToSelect('*')
->addAttributeToSelect(array('name', 'thumbnail', 'weight' ,'price','description'))
...
5
votes
Accepted
Magento-2 get all products having product qty less than 5 only
Try this:
use Magento\Framework\App\Bootstrap;
require DIR . '/../app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$obj = $bootstrap->getObjectManager();
$state = $obj->get(...
5
votes
Can we clear inventory_reservation table. Magento2.3.1
In Magento 2, main quantity which you see in the qty field of the product might be different than salable quantity. Customers can buy buy products according to salable quantity only. Salable quantity ...
4
votes
Magento 2: Programmatically Updating Inventory
$objectManager = $bootstrap->getObjectManager();
$stockRegistry = $objectManager->create('Magento\CatalogInventory\Api\StockRegistryInterface');
$stockItem = $stockRegistry->...
4
votes
Accepted
How can I get all email which are all under condition back in stock email alert?
When a customer clicks on Sign up to get notified when this product is back in stock, the customer id is saved in the product_alert_stock table.
You can get the customer id using this model:
$model =...
4
votes
Magento 2: Low Stock Notification Email to Admin
In magento direct email not sending to the admin. Magento show low stock report at Reports > Product > Low stock
For Magento 2.2.x Admin Low Stock Notification email Free extension available in ...
4
votes
Accepted
Show available inventory on configurable product magento 2
Finally I found a way to show awailable QTY:
Override configurable.js:
vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js
Add :
jQuery('.myli').css('display','none')...
4
votes
How to Track Inventory for Bulk Product
Potatoes sold as 5lb, 25lb or 100lb packages.
Like you said set the actual product will be the one with the lowest weight.
**(Potatoes 5lb)**
This is qty = 1(or you can consider 1 qty = 1lb
and ...
4
votes
Store level Inventory for individual product Magento 2.2.0
Untill magento 2.2.6 you can not assign / allocate inventory on store level or website level basis. inventory is managed globaly so you will have single inventory across all stores / websites.
...
4
votes
inventory_stock_1 doest exist on Magento 2.3
Find data patches name from patch_list table
Magento\InventoryCatalog\Setup\Patch\Schema\CreateLegacyStockStatusView
Delete or rename it.
run upgrade command
php bin/magento s:upg
This issue may ...
4
votes
Accepted
Magento 2 how to get Multi source inventory names website wise?
I did below as a solution:
use Magento\Inventory\Model\ResourceModel\Source\Collection as InventoryCollection;
use Magento\Framework\Api\SortOrderBuilder;
use Magento\InventoryApi\Api\...
4
votes
Disable stock check / decrease when shipping an order in Magento 2.3.1
~Update ~ Crim is correct. The solution is to disable Magento MSI completely. This is what I ended up doing in my case and works.
You're not the only retailer with this issue. After spending some ...
4
votes
How to get product stock status on the listing page in Magento 2?
Inject \Magento\CatalogInventory\Model\Stock\StockItemRepository $stockItemRepository, in constructor
e.g:
protected $_stockItemRepository;
public function __construct(
\Magento\...
4
votes
Accepted
Salable quantity of 0 but still showing in stock?
I was facing the same issue in one of my projects recently. In my case the client wanted to display stock availability label (i.e. Instock/Outofstock) on category pages as well. That is not available ...
4
votes
Accepted
Magento2: Product Stock Bulk Update API
The endpoint you added in your post works properly for me :| I am not sure which is the problem on your environment, but I suggest you check the log files, surely there must be something in there. And ...
3
votes
Magento 2: Programmatically Updating Inventory
Magento2 also come up with Multi stock feature so to update on particular stock source you can follow this solution
https://magento.stackexchange.com/questions/272296/how-to-set-qty-to-product-on-msi-...
3
votes
Accepted
How to update multiple rows of a table in a single query?
Your best bet is likely to use an insert query with the ON DUPLICATE KEY UPDATE command, like this:
INSERT INTO `cataloginventory_stock_item` (item_id, qty, is_in_stock) VALUES
(1, 1, 1),
/*...
3
votes
Accepted
How Magento\CatalogInventory\Model\Stock\Item can be replaced in Constructor (DI)
protected $stockItemFactory;
public function __construct(
...
\Magento\CatalogInventory\Model\Stock\ItemFactory $stockItemFactory,
....
) {
....
$this->stockItemFactory = $...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
inventory × 369magento2 × 107
stock × 84
magento-1.9 × 58
product × 44
cataloginventory × 27
configurable-product × 23
out-of-stock × 23
quantity × 22
msi × 22
magento2.3 × 21
multi-source-inventory × 21
catalog × 16
database × 14
orders × 13
api × 13
magento-1.7 × 12
magento-1.8 × 12
stock-status × 10
multistore × 9
rest-api × 9
module × 8
event-observer × 8
magento-1 × 8
bundled-product × 8