Skip to main content
Share Your Experience: Take the 2024 Developer Survey
11 votes
Accepted

Magento 2.3 - How to fetch stock statuses of all the stores

Intro MSI stock works differently from the previous CatalogInventory stock. To explain how to get the stock properly i first need to explain how MSI works. However i will state this beforehand, it is ...
Stephan's user avatar
  • 126
7 votes

Why are there 3 identical tables in Magento2?

the cataloginventory_stock_status is the one that is used for reading in the frontend. In order to not interfere with the table reads, when the stock index is running it is writing in the _tmp and/or ...
Marius's user avatar
  • 198k
7 votes

Magento 2 : We cant place the order : SQLSTATE[HY000]: General error: 1449 The user specified as a definer your_db_user@% does not exist

After migrating the site I got the above error on placing the order. The user that was trying to access the DB is an old server DB user which didn't exist in the new server. I searched for the user in ...
Mrugesh Mistry's user avatar
6 votes

Magento 2 - How to set a maximum order qty of individual products?

For Magento 2.1.x Goto Admin -> Stores -> Configuration For individual settings, go to product details Click Advanced Inventory
Sohel Rana's user avatar
  • 35.9k
5 votes

cataloginventory_stock_status entry issue Magento 2

I got an issue. I found website_id = 1 instead of 0 in cataloginventory_stock table. I change website id to 0.
Nimesh Patel's user avatar
5 votes

Magento 2 : We cant place the order : SQLSTATE[HY000]: General error: 1449 The user specified as a definer your_db_user@% does not exist

As far as I'm aware they've created only one view table If you use mysqldump you end up with this CREATE ALGORITHM=UNDEFINED DEFINER=`dbusername`@`localhost` SQL SECURITY INVOKER VIEW `...
Dominic Pixie's user avatar
4 votes

Slow Save Order Due To Re-Index

The only solution to deal with this problem is to put all indexers into the background. Re-indexation might not only make your store slow but also introduces a chance of deadlock when two concurrent ...
Ivan Chepurnyi's user avatar
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. ...
Naveed Asim's user avatar
  • 3,637
3 votes

Store level Inventory for individual product Magento 2.2.0

You cannot do this in 2.2.0 without custom extensions. On the database level a product has only global inventory settings stored in cataloginventory_stock_item table. I'd suggest to look for multi-...
Александр Егоров's user avatar
3 votes

Magento 2.1 Override Catalog Inventory

Magento2 uses the \Magento\CatalogInventory\Api\StockRegistryInterface to get stock information of a product: $stockItem = $this->stockRegistry->getStockItem($product->getId()); You should ...
Stijn Duynslaeger - Echron's user avatar
3 votes
Accepted

Magento 2 MSI - How to listen the event of all source item stock update API

Add an after plugin to \Magento\InventoryApi\Api\SourceItemsSaveInterface::execute API
Igor Minyaylo's user avatar
3 votes
Accepted

inventory_source_item and cataloginventory_stock_item data is not same

The answer is 'yes and no' :) YES: If you are using the enabled MSI functionalities with the default stock and default source only, then, when you update a product's qty, the same qty will be ...
Diana's user avatar
  • 5,182
2 votes

Email for Low Stock Products

You can create a module that has an observer and depending on where you want to check the inventory, observer those events, like product_save_after and checkout_submit_all_after events. An observer ...
djfordz's user avatar
  • 342
2 votes

Email for Low Stock Products

Unfortunately Magento does not support email notifications for out of stock products. However, there is an RSS feed available out of the box in the backend to be notified about low stock products: ...
Raphael at Digital Pianism's user avatar
2 votes

SOAP V2 query returns empty array

I had a similar problem. My situation was different in a few respects: I'm using the V1 API. I'm passing SKUs instead of product IDs. Here was my original code: $skus = ['SKU001', 'SKU002', 'SKU003'...
Ian Phillips's user avatar
2 votes

Disable "Only X left Threshold" Qty from Showing on Store

The easiest way to disable this message in Magento 2 is to just set the threshold to -1 under Stores > Settings > Configuration > Catalog > Inventory > Stock Options > Only X left Threshold.
Jason Carter's user avatar
2 votes

Disable all Mage_CatalogInventory features

@Pawel some of dependencies you mention are fake ones. For example, Mage_Checkout and Mage_XmlConnect modules don't use any logic from Mage_CatalogInventory module. Mage_Rss uses only one class ...
Wojtek Naruniec's user avatar
2 votes

How to show only in stock products?

I can see that your code does not contain any stock filter you can use this bit of code on the collection $oCollection = Mage::getModel('cataloginventory/stock_item') ->...
Riddhish Bhayani's user avatar
2 votes
Accepted

Is there any observer like 'cataloginventory_stock_item_save_commit_after' in magento 2?

In Magento 2 basically it happens Dynamically with afterSave() method public function afterSave() { $this->cleanModelCache(); $this->_eventManager->dispatch('model_save_after', ['...
amith lal's user avatar
  • 790
2 votes
Accepted

Magento 2: Remove 'low stock' label from product image

You can Turn off Low Stock Label via admin Stores > Configuration > CleverSoft Themes > Theme Settings > Product Labels. You may need to reindex the data and flush the cache Let me know ...
Manoj Deswal's user avatar
  • 5,805
2 votes

Store level Inventory for individual product Magento 2.2.0

If you upgrade to 2.3 or 2.3.1 you can then set store stock on a website level using the new MSI stock system without the need for third party modules such as Wyomind. I have just replaced the ...
stephenhill's user avatar
2 votes
Accepted

Magento 2 - How to set a maximum order qty of individual products?

As mentioned in the answer below, the max qty allowed for a simple product can be controlled through Magento 2 by changing the Maximum Qty Allowed in Shopping Cart in the Advanced Inventory panel at ...
Noemi Quezada's user avatar
2 votes
Accepted

404 error while updating Product inventory by rest API Magento 2.3.1

We have fixed a similar issue by adding the following in .htaccess file inside public_html <Limit GET POST PUT OPTIONS> Require all granted </Limit> <LimitExcept GET POST PUT OPTIONS&...
Vivek Vijayan's user avatar
2 votes

Magento 2 : We cant place the order : SQLSTATE[HY000]: General error: 1449 The user specified as a definer your_db_user@% does not exist

Please follow the below steps to fix this issue: mysqldump -uroot -p --triggers --add-drop-trigger --no-create-info --no-data --no-create-db --skip-opt test > /tmp/triggers.sql Note: Here test is ...
Himmat Paliwal's user avatar
2 votes
Accepted

How to automatically change the status to In Stock if products are added to the product

I assume you know the necessary files for creating a module, one all basic files generated, create below files: Vendor/Module/etc/events.xml <?xml version="1.0" ?> <config xmlns:...
Natha Odedara's user avatar
1 vote
Accepted

How to programatically transfer qty from one to other source

Try following way: use Magento\InventoryCatalogAdminUi\Observer\SourceItemsProcessor; Di: private $sourceItemsProcessor; public function __construct( SourceItemsProcessor $sourceItemsProcessor ...
Sohel Rana's user avatar
  • 35.9k
1 vote

Magento 2 How to set product minimum quantity selected to minimum qty configured in the Advanced Inventory product level

go to Catalog > Inventory > Product Stock Options. In Product Stock Options, find 2 sections: Maximum Qty Allowed in Shopping Cart and Minimum Qty Allowed in Shopping Cart. In Maximum Qty ...
Aditya Shah's user avatar
  • 7,617
1 vote
Accepted

What is the usage of itemId inside Update inventory REST API?

If you see the method declaration in StockRegistryInterface.php /** * @param string $productSku * @param \Magento\CatalogInventory\Api\Data\StockItemInterface $stockItem * @return int * @throws \...
Prasanta Hatui's user avatar
1 vote
Accepted

How to update Qty on product save action?

If it not must be catalog_product_save_before, try catalog_product_save_after instead and this: public function setQty(Varien_Event_Observer $observer) { $stockQty = 999; $product = $observer-...
sv3n's user avatar
  • 11.7k
1 vote
Accepted

Magento inventory

Magento Already have a function to copy one cart to another. See the sample snippet. $cart = Mage::getModel('sales/quote')->loadByCustomer($superUser); $quote = Mage::getModel('sales/quote')->...
Schrödinger's Cat's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible