People who code: we want your input. Take the Survey

Questions tagged [stock]

Denotes questions related to stock management and configuration on Magento

Filter by
Sorted by
Tagged with
31
votes
7answers
70k 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 ?
71
votes
8answers
58k 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 ...
8
votes
1answer
4k 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="...
6
votes
2answers
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?
2
votes
3answers
2k views

How to show out of stock product configuration in Magento 2.2.7?

The display of out of stock products is enabled in the store configuration. This means that out of stock simple products are displayed. But if one or more configuration of a configurable product is ...
12
votes
4answers
46k 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', '...
2
votes
2answers
1k views

Avoiding memory exhaustion when updating product stock?

I need to process a product collection and update the stock quantity and status for each product. Currently I'm doing this: foreach($products AS $product) { $quantity = $productQuantities[$...
6
votes
4answers
23k 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 ...
11
votes
1answer
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, ...
4
votes
2answers
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 ...
12
votes
1answer
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 ...
5
votes
2answers
4k 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, ...
0
votes
1answer
511 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\...
2
votes
1answer
1k views

Limit backorder qty of the product

This question was already asked, but I want to know is there some issue if I use following solution to limit the backorder qty: I'll set "Qty for Item's Status to Become Out of Stock" as negative ...
2
votes
1answer
3k views

Items don't turn out of stock when qty is 0

I am using magento community 1.7.0.2 I checked in System / Configurations / Catalog / Inventory "Qty for Item's Status to Become Out of Stock' is set to 0 However I have noticed that all of the ...
0
votes
1answer
4k views

Sort Product List to show Out of Stock items after in stock items with magento 1.8

The product list pages are currently set to show out of stock products. I would like to show these products after the In Stock items. Thanks.
9
votes
1answer
10k 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 ...
4
votes
1answer
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 ...
3
votes
4answers
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
votes
5answers
9k 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(); $...
5
votes
2answers
10k 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();
2
votes
1answer
335 views

Can you sell product (fabric) by the metre in Magento?

We have fabric on a roll which we cut to requirement. Let's call this main product 'Red Fabric'. We have 100 (metres) in stock. We want a dropdown showing customers length options they can buy; 2m, ...
4
votes
5answers
6k 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
2answers
2k 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 ...
4
votes
2answers
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 ...
3
votes
2answers
778 views

Stock reduction on Invoice instead of Order

Currently, stock gets reduced when the Order has been placed, is there any way to change on invoice? As there, lot of junk orders, is there any way to make stock reducing when invoice for the ...
2
votes
1answer
644 views

Why are there 3 identical tables in Magento2?

We came across three absolutely identical in structure tables in M2 DB: cataloginventory_stock_status cataloginventory_stock_status_idx cataloginventory_stock_status_tmp Anybody has any idea ...
2
votes
3answers
4k views

How to get stock quantity of configurable product in Magento 2

I am able to get all the available sizes of configurable product calling getJsonConfig() of below class Magento\ConfigurableProduct\Block\Product\View\Type\Configurable; But I need stock of ...
1
vote
1answer
1k views

How do I? Magento out of stock simple products, but DO want to show configurable product (out of stock)

How do I? Magento out of stock simple products, but DO want to show configurable product (out of stock) (We sell T-shirts, in sizes) Let me explain we have setting show out of stock products to NO ...
1
vote
4answers
4k views

IN STOCK FILTER FOR Magento 2 Product collection

i am trying to filter inStock product in Magento 2 Using I am trying to filter inStock product in Magento 2 Using \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory,...
1
vote
3answers
3k views

Disable stock check / decrease when shipping an order in Magento 2.3.1

I have a Magento 2.3.1 shop with external software managing my stock levels. I have disabled the Decrease Stock When Order is Placed setting but with the new Magento MSI in Magento 2.3, the stock is ...
0
votes
3answers
1k views

Cancel order and restore products stock qty

I'm using the following code to cancel programmatically some orders in my magento website: foreach($orderCollection as $order): $order = Mage::getModel('sales/order')->load($order->getId());...
4
votes
2answers
11k 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 ...
3
votes
3answers
3k 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 ...
3
votes
2answers
2k views

Multiple products, different units, one inventory

The scenario is as follows: Product A, SKU 1000, sold as 1 roll of 1000 meters of cable, price 800 euro Product B, SKU 1000, sold per meter of cable, price 1 euro Those products should share the ...
3
votes
4answers
8k views

Where is var/lock in Magento 1.9?

I get the error "Stock Status Index process is working now. Please try run this process later." when trying to reindex. Other answers say to clear var/lock/. where is var/lock in 1.9?
2
votes
1answer
183 views

Magento does not display all imported products within the categories

I have set up the categories and imported the products CSV into Magento, which all worked fine. Each category is display the correct amount of products within the backend. However on the frontend, ...
1
vote
2answers
2k views

Is it possible to sell not-in-stock products on Magento?

I would like to make it possible to order items which I don't have in stock, but it seems if I want to allow backorders, I must have the item listed as "in stock", which looks weird if people order it ...
1
vote
1answer
967 views

Auto Update Configurable Products Stock Status with a cron job

I have the following script which I run to tell me if there are any configurable products the have their stock availability setting set incorrectly. <?php require_once('app/Mage.php'); //Path to ...
1
vote
1answer
1k views

What is the real usage of product attribute: quantity_and_stock_status?

Magento2 has introduced new product attribute quantity_and_stock_status which hold the value of is_in_stock and qty from $stockItem object. For those who are curios on the topic - How the ...
1
vote
1answer
3k views

Notify for Quantity Below in Magento 2

I have a requirements to notify the admin through email when a product quantity goes below 5 in Magento 2.0.7. I have found that there is option on the admin: System > Configuration > Catalog > ...
1
vote
1answer
2k views

Magento 2 - Bulk update stock programmatically - Using database query [duplicate]

I have 10 products; 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. I want to be able to bulk change 1, 3, 4, 5 and 9 to 0 quantity and out of stock and 2, 6, 7, 8 and 10 to 100 quantity and in stock. How can I do ...
1
vote
3answers
3k views

Magento2 sort products and search result by stock availability

I need to add an option in the Sort By dropdown which sorts the products with based on stock availability of the products. So far i have created a plugin for setCollection methodMagento\Catalog\Block\...
1
vote
1answer
1k views

Table “Only X Left” on product page doesn't show product names (only Qty) in Magento 1.9.1.0

The issue is also described on Magento Bug-track (still not answered): http://www.magentocommerce.com/bug-tracking/issue/index/id/443 Steps to reproduce: I have created a configurable product ...
1
vote
1answer
2k views

Stock status in product grid not displayed when not set

What I want to achive is, to show one column in the catalog grid, which contains the stock status. Here is my code for adding it to the collection that: $collection->joinTable( '...
0
votes
1answer
819 views

Magento2 : Product Updates Not Showing on Front End - store scope issue

Problem: Certain product attribute updates are not being seen on the front end. Irrespective of re-indexing, cleaning and flushing the cache, etc. If I change them via Update Mass Attributes, then ...
0
votes
1answer
1k views

Change the color of “Availability: In stock ” depending the quantity from the stock?

I changed the color of "Availability: In stock" in green but i want to change the color "Availability: In stock" programmly. For example if the quantity of product < 5 i want to color "...
0
votes
1answer
671 views

In magento 2 how to override stock availability in product detail page in custom module

In magento 2 how to override stock availability in product detail page in custom module app/code/Vendor/Module/view/frontend/layout/catalog_product_view.xml <?xml version="1.0"?> <page ...