Questions tagged [stock]

Denotes questions related to stock management and configuration on Magento

Filter by
Sorted by
Tagged with
73 votes
9 answers
64k views

Magento 2 How to unlock reindex process

I'm making some tests in Magento reindex process and I locked the stock index process. How can I unlock this process? Design Config Grid index has been rebuilt successfully in 00:00:02 Customer ...
33 votes
7 answers
97k views

How to get stock quantity of each product in Magento 2

How to get stock quantity of each product in list.phtml in Magento 2 ?
21 votes
2 answers
20k views

Why is disabled status 2 instead of 0?

A question for any magento devs: Why is it that an enabled product has status 1, while a disabled product has a status of 2? Usually, "enabled" or "active" or whatever gets the status 1, while the ...
  • 1,096
17 votes
3 answers
12k views

Handling multiple stock locations or warehouses

The Magento database contains the table cataloginventory_stock with a single entry in there called 'Default'. I know this is the place to start for handling multiple stock locations. I'm wondering ...
  • 3,057
12 votes
4 answers
49k views

Get product stock quantity in magento

I need to get product stock quantity for the item, how to get that $products = Mage::getModel('catalog/product')->getCollection(); $products->addAttributeToSelect(array('name', 'thumbnail', '...
12 votes
1 answer
2k views

Why does Magento have a stock index?

I might be being a bit short sighted but I can't find the reasoning behind Magento having a stock index when cataloginventory_stock_status and cataloginventory_stock_status_idx are identical in ...
  • 550
11 votes
1 answer
5k views

The purpose of the table cataloginventory_stock

I see that in the default Magento versions 1.0 to 1.8 (ce) There is a table called cataloginventory_stock that contains only one record. stock_id stock_name 1 Default Related to this, ...
  • 196k
10 votes
1 answer
11k views

Magento 1: Relationship Between `qty` in Stock Item, and Stock Status Tables

In Magento 1, Inventory information is stored in a Stock Item object. Each Stock Item object is associated with a product object. Magento persists Stock Item objects to the ...
9 votes
2 answers
1k views

Product collection problem - incorrect pricing data or not showing out of stock items

I am retrieving a product collection based on the current category. I need this collection to contain both in and out of stock products, and I also need the pricing data to be displayed correctly. My ...
  • 652
8 votes
1 answer
5k views

magento 2 event cataloginventory_stock_item_save_after

I need to detect whenever the inventory level of a product changes. As there is cataloginventory_stock_item_save_after in magento 1.x wanto to implemet same in magento 2.1 <event name="...
  • 173
7 votes
1 answer
97 views

Product with different sub qty levels

Trying to currently work this out and understand it isn't default magento. I have a product (Red Shoe) and I need to record the qty of different values of the product for example Red Shoe is made up ...
6 votes
4 answers
24k views

Magento easy way to show out of stock in configurable product (greyed out)

this may be a simple question for some - but we havent used stock extensions before. My question: how can we easily, simply, add the ability to - instead of hiding out of stock simple products (as ...
  • 5,342
6 votes
2 answers
15k views

Magento 2: Set product stock programmatically

I have to setup Product 'in stock' and update Quantity programmatically. Here is my code I am trying: $product->setData('is_in_stock', 1); $product->setData('qty', 5); $product->save();
6 votes
2 answers
8k views

Differences between some stock methods

Modifying product page I have encountered some methods touching stock and product availibility: $_product->isSaleable()); $_product->isSalable()); $_product->isAvailable()); $_product->...
6 votes
2 answers
12k views

change stock availability programmatically

How I can change stock availability ie in stock and out of stock of product programmatically using product ID?
  • 1,649
6 votes
1 answer
3k views

how does magento check if a configure/grouped product is out of stock in the catalog/search

in the setup of magento i have i have set backorders to be on but i only needed them on so that out of stock items could be added to the cart from an order editor i've been making changes to magento ...
  • 686
6 votes
2 answers
3k views

How do I post JSON to a web API method?

I want to send a JSON string via API, and then parse the JSON in code. I don't want Magento to try to convert my JSON parameter to a PHP object. I'm trying to add this to the stock registry API. ...
  • 529
6 votes
3 answers
5k views

Product stock is not saved when creating a product programmatically

I'm creating products programatically on Magento CE 1.8.1. The form works fine except every once in a while we get a nasty error that comes and goes away, and does not affect all users. :"SQLSTATE[...
  • 1,414
6 votes
1 answer
192 views

Stock / Inventory management

I am new to Magento extension development and looking for a way to implement a connection to our WMS. I have done some tutorials on extension development, but am a little stuck on where or how to make ...
6 votes
0 answers
190 views

Add product stock information to product repository

When working with the ProductRepository in Magento 2 and the results of the getList method what is the "best" way to add extra information to the results? For example in the default 2.1.7 setup you ...
5 votes
5 answers
11k views

Showing Salable QTY in frontend Magento 2.3

We are currently showing our available qty in stock on the frontend of each product using the following code: <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $...
  • 107
5 votes
2 answers
5k views

Get stock values for bundled product in product grid

We use several bundled products, and I'm having trouble displaying the stock value on the product grid. I don't even need values, just in stock or out of stock. Take the following example: iPhone, ...
  • 1,307
5 votes
3 answers
1k views

Magento2 - EAV cache issue saving qty in admin

We have this Magento 2.1 project running Production mode with "Update on save" mode for all indexes Our customer manages catalog himself, and reported us some stock issues. Problem was changing ...
  • 3,272
5 votes
1 answer
980 views

Why have my configurables stock status Out of Stock

All I found so far is from the User Guide in Step 4 under 2.: The Quantity is determined by the product variations, so you can leave it blank for now. The Stock Status of a configurable ...
  • 2,060
5 votes
1 answer
224 views

many-to-one product attribute

I need to add an attribute that allows multiple values - but not from a set of pre-selected values, not multiple select but multiple text fields. One product, one or more values in the one field. ...
  • 1,589
5 votes
0 answers
454 views

How to show "Only 1 Product available" also on Configurable Product?

Im wondering how I can "activate" the "Only X left Threshold" also for configurable products? On Normal Products it works and shows for example "only 1 left", but on products where you can choose ...
  • 451
4 votes
2 answers
3k views

Cron job template block not being translated, but testObserver is

I am configuring a product out of stock notification / alert, and I'm having an issue with localization / translation (pt_BR) in Magento CE 1.9.0.1. The email/productalert/stock.phtml block isn't ...
  • 812
4 votes
2 answers
12k views

How to allow orders for out-of-stock products?

We want to be able to take orders for products that are "out of stock" in Magento. I have enabled backorders in System > Config > Inventory, but the "Add to basket" button is still hidden for ...
  • 1,369
4 votes
5 answers
7k views

Selling Products By Weight: Multiple Options & Accurate Stock Management

I'm fairly new to Magento - I have no idea how to achieve what I am about to propose, nor what would be the best way to go about it. (Note: This is not a question about the Weight attribute) My ...
4 votes
2 answers
1k views

Downloadable product on Magento 2.3.1 out of stock issue

I'm issuing a problem with newly created downloadable products on Magento 2.3.1 This store contains about 10k products (phisical and digital) imported from M1 Phisical in stock/out of stock is ...
  • 389
4 votes
3 answers
5k views

How to set qty to product on MSI Magento 2.3

In my custom module, I'm using StockRegistryInterface to set qty and save my product. But on Magento 2.3 I started facing the issue of having 0 salable qty right after saving the product. After ...
  • 38
4 votes
4 answers
7k views

Updating stock causing foreign key constraint fail

So, I'm trying to update product quantities programmatically. On a standard magento install, it works flawlessly, but on the actual magento shop I'm developing it for, it fails with a SQLSTATE[23000]: ...
  • 145
4 votes
4 answers
6k views

Salable Quantity is greater than quantity

My salable quantity is greater than my quantity. How has this happened? I recently updated to Magento 2 and have been trying to get my head around the MSI but still can't figure out how salable ...
  • 41
4 votes
2 answers
3k views

Get only the in stock simple products of a configurable product

I am trying to get all the in stock simple products of a configurable product in magento2. Below code gets all in stock and out of stock products of configurable product, But I need only the in stock ...
  • 2,035
4 votes
1 answer
7k views

Magento 2.1 Update Product Stock in Cron Job

I need to be able to programmatically update product stock in my Cron job. I have an array that contains both the SKU of the product needing updating and the Stock value of that product. How can I ...
  • 125
4 votes
2 answers
3k views

Proper way to update stock in >= 2.4?

I'm finding inconsistent documentation on how to update product stock for M2 2.4.1. Magento\Catalog\Model\Product::setStockData is documented in code to be deprecated and points to Magento\...
  • 6,810
4 votes
2 answers
3k views

Magento add stock qty in backend new order creation

I was wondering how we could add a stock value in the 'backend new order creation' ... see image below What we see now is that we enter an order, but in the next step are warned that ther is no stock ...
  • 5,342
4 votes
2 answers
7k views

Magento 2: Low Stock Notification Email to Admin

We have below settings Admin -> Stores -> Configuration -> Catalog -> Inventory -> Product Stock Options Notify for Quantity Below -> 1 Admin is not getting email fo Low Stock Products. Notify ...
  • 9,691
4 votes
1 answer
199 views

Stock = 0, out of stock - then I process a credit note. Stock = 1, but still out of stock

Situation: Stock = 0, in_stock = no Then I process a credit note. Stock = 1, in_stock = no I would expect the in_stock to be set back to yes. The effect of this is that we have many T-shirts in 1 ...
  • 5,342
4 votes
1 answer
2k views

Hide Out of Stock Products in Layered Navigation, but Not Category

I want to be able to filter by sizes that are in stock via the layered navigation, eg I select size large and the filtered results only show me configurable products with an in stock size large ...
4 votes
1 answer
167 views

(Stock) Indexes on Import in EE

Why are importing (standard CSV import, not dataflow) product lists and the field is_in_stock does not seem to have an effect. In the backend it is shown properly, but not in the frontend. Clearing ...
  • 14.1k
4 votes
1 answer
721 views

Return stock when order on hold

I need to achieve the next thing in my Magento store: When I push the button On Hold in the admin for an order, the stock needs to be returned to the product (so increase). When I unhold the order the ...
  • 99
4 votes
1 answer
1k views

The "Product Prices" and "Product Attributes" index depended on stock index?

I found that on a client server, the stock index run cause a heavy load and slow down the site, so I changed the stock index to manually. After I changed "stock status" index to manually mode, every ...
4 votes
0 answers
328 views

Magento2 import stock sources successful but no changes made and not showing in import history

Preconditions (*) Magento ver. 2.3.4 About 10000 skus, this process has worked many times previously, suddenly stops working. No new modules or configurations have been done since last time the ...
4 votes
0 answers
190 views

Magento 1.9 Add Backorder status of a product to the product grid in backend

I'd like to add the status of the back-order in the main manage product grid as an column so I can see it in 1 instance. the status is visible when you click on a product and go to inventory and you ...
4 votes
0 answers
900 views

Detect Inventory change on Magento2 triggered by API

I'm working on a module for keeping track of inventory changes on orders, admin variation, api calls. I'm using the event cataloginventory_stock_item_save_after which works fine on 2.2 but it seems ...
  • 973
4 votes
2 answers
290 views

Set stock levels on the configurable products

As we all know when you have a configurable product such as a T-Shirt in blue and red, you would create 2 simple products and 1 configurable product and each simple product would have its own stock ...
  • 2,519
3 votes
4 answers
7k views

How to get salable qty in magento 2.3.3?

How to get salable qty of each Product and display in Product view page. Can someone help me? Thanks in advance.
3 votes
4 answers
6k views

How to show products with the most quantity sorted first

Prior to my store allowing back orders, when browsing all products that were "In Stock" were displayed with a higher priority over products that were "Out of stock". Since allowing back orders on my ...
  • 5,189
3 votes
4 answers
6k views

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

I have migrated a Magento 2 site to a new server and getting the below error when placing order We cant place the order : SQLSTATE[HY000]: General error: 1449 The user specified as a definer ...

1
2 3 4 5
10