Questions tagged [stock]

Denotes questions related to stock management and configuration on Magento

Filter by
Sorted by
Tagged with
2 votes
2 answers
2k views

How do I update Quantity On Hand?

It seems the Magento quantity field corresponds to Quantity Available (Qty On Hand - Qty committed to orders) and not Quantity On Hand. If we are updating inventory we are going to count how many we ...
2 votes
1 answer
4k views

What is the difference of stock_status and is_in_stock in stockItem object?

code: $inventory = "http://example.com/index.php/rest/V1/stockStatuses/".$products_object->sku; $ch1 = curl_init($inventory); curl_setopt($ch1, CURLOPT_CUSTOMREQUEST, "GET")...
  • 2,151
1 vote
4 answers
6k views

How to display stock information on product page?

I would like to display the stock status (In Stock | Sold Out) on the product page. How can I achieve that?
  • 2,869
1 vote
2 answers
3k 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
4 answers
3k views

Automatically set product "in stock" after credit memo

Is there a way to set the product's stock status automatically to "In Stock" after a credit memo has been created and quantity is restored? Or would it somehow be possible to set that setting ...
  • 1,561
1 vote
1 answer
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 ...
  • 2,182
1 vote
1 answer
2k views

How to show Qty left in Magento 2 Listing page?

I need to show Qty left message with qty of product in product detail page with below condition. If the available stock is less than 'Notify for Quantity Below' parameter of each product. And can we ...
  • 1,819
1 vote
1 answer
1k views

SOLVED - Delete Out of Stock Products Programmatically

I'm using Magento 2.2.3 and I need to create a php script to delete all out of stock items from my catalog. Any idea? Thanks in adv
1 vote
3 answers
1k views

How to get *every* products (in stock, out of stock, enabled, disabled, etc..)

I've been trying to figure this out for too many hours now... How can I fetch every products from the database? I've tried a lot of different method of getting the products, but all of them either ...
  • 201
1 vote
3 answers
5k 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
2 answers
3k views

script php to update stock

I'm using Magento 2.1.2 Since I'm not so good with php language, I would like to know if exists any way to update quantities in my catalog reading a file with 2 columns SKU | Qty 889588... ...
  • 131
1 vote
2 answers
1k views

Product Collections: Get ALL products even though "Show products that are out of stock" set to NO?

I’d like to list products using Product Collections that list ALL products regardless is_salable or in_stock are false. Is there a way I can disable all is_salable or in_stock checks for Mage::...
  • 926
1 vote
1 answer
1k views

Magento 2.4.1 Move Out of Stock In last Of Category Listing

I want to move out of stock product in last of the category listing, itried below code but same seems not working. app/code/Meetanshi/StockQuantity/etc/module.xml <?xml version="1.0"?> ...
1 vote
2 answers
913 views

What does "deferred stock update" do and how is it related to Backorders?

In M2 what does "deferred stock update" do and how is it related to Backorders? From here it is not exactly clear what it does, especially what it has to do with Backorders (which is quite ...
  • 5,342
1 vote
1 answer
840 views

Why changing the scope of quantity_and_stock_status from Global to Website level does not affect the Quantity and Stock Status field?

I have changed the scope of quantity_and_stock_status in Stores > Attributes > Product > from Global to Web Site: But while creating new products or editing existing products the Quantity ...
1 vote
1 answer
67 views

How to Remove assigned tags if the product becomes out of stock

When any product's quantity becomes 0 or out of stock i need to remove all the tags assigned to that particular product.
1 vote
1 answer
465 views

Dropdown for weight

I'd like to sell meat in my magento store. Therefore I want a dropdown for weight from 500g to 12000g in 500g steps. I tried to implement this by using "custom options". The problem is, that the ...
1 vote
1 answer
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( '...
  • 125
1 vote
1 answer
391 views

Can see out of stock products even though out-of-stock products set to NOT show? [closed]

As the title says, I have set the out-of-stock products to not display when we run out of stock, but despite clearing cache, I can still see out-of-stock products visible on the site, even though it ...
1 vote
4 answers
6k views

Stock quantity not increasing after cancellation

I have installed Magento 1.8. When a user orders a product, the quantity is decreased by one, but if he cancels that order (before invoicing), the stock quantity does not gets increased. Admin > ...
1 vote
1 answer
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 ...
  • 5,342
1 vote
1 answer
5k views

How to get all products collection in a store?

I'm using Magento CE 1.7. I have several stores in admin panel. I want to get both the enabled and disabled products collection in admin panel when create new order. When click the add Products button ...
  • 9,885
1 vote
2 answers
8k views

Item out of stock in admin - in stock on frontend

Admin: Catalog > Manage products Choose a product: inventory - Qty = 0 - Qty for Item's Status to Become Out of Stock = 0 - Stock availability: in stock A similar setting in the config: ...
  • 1,307
1 vote
1 answer
772 views

Magento 2.2 - event to detect qty change

I need to detect a change of qty in product (backoffice change after edit is enough for me). I was trying to do it with simple observer <event name="cataloginventory_stock_item_save_after"> ...
1 vote
1 answer
235 views

How to add available qty to cart when customer request more than available qty?

As asked in the question, Is there any possibility to add available qty(in stock) to the cart when customer requesting more than available qty. How magento behave with this situation? ex : I have 5 ...
  • 2,651
1 vote
3 answers
1k views

Reindex Not Happening Automatically Magento 2.3

Every time I update a product stock in magento it updates perfectly in the backend but only when I manually run a reindex via SSH does it update on the front end. Very annoying when I am sometimes ...
  • 171
1 vote
1 answer
261 views

Product Stock is not updated via Repository but works ok via Model save() method

via ProductRepository: $product = $this->productRepository->get($product['sku']); $stockItem = $this->stockRegistry->getStockItem($product->getId()); $stockItem->setIsInStock(true); ...
1 vote
1 answer
232 views

M2 - Get stock quantity on product detail page

I need to get the stock quantity on the product detail page. I'm not an expert in Magento but I was being told that using the objectmanager is not a good idea, but in almost every example I find I see ...
  • 623
1 vote
1 answer
2k views

Instock and out of stock issue in magento 2

Please help me to find out issue,I am using Magento 2.1.8 with custom porto theme. When change product stock status to outofstock it's not display in frontend. In frontend product page there always ...
  • 729
1 vote
1 answer
523 views

How to change Stock Availability automatically to '0'

I want to change the stock availability to '0' automatically when product is OUT OF STOCK. I had created the Stock Availability attribute manually but when product is OUT OF STOCK the value of Stock ...
1 vote
1 answer
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 ...
  • 4,672
1 vote
1 answer
1k 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 ...
  • 407
1 vote
2 answers
876 views

Magento 2.0.9 stock does not decrease with order / stock levels do not update

We have recently installed Magento 2 on AWS, after using Magento 1 on another server. We did a fresh install with a new store. Magento is up to date at 2.0.9. Everything is running, except when an ...
  • 11
1 vote
1 answer
531 views

Rewrite Magento deducting stock

How would I rewrite Magento deducting from stock levels from when a product is purchased? I am guessing I would need to rewrite app/code/core/Mage/CatalogInventory/Model/Stock/Item.php but not too ...
  • 2,519
1 vote
2 answers
578 views

Select stock status in category->getProductCollection

I am trying to get the stock status of all products within a particular category. My current code is below but getIsInStock is not part of the default collection. How can i get this value in the same ...
  • 1,376
1 vote
2 answers
380 views

How to make stock quantity of a different product decrease, when a product is bought?

When an item is bought, the quantity for THAT item will decrease by 1, how could I make it so ANOTHER item also decreases by 1. For example, on my website, I will be selling computer parts ...
user avatar
1 vote
1 answer
81 views

when I update the stock and price of a product in what tables are updated?

when I update the stock and price of a product in what tables are updated?
  • 21
1 vote
1 answer
973 views

cataloginventory_stock_item_save_commit_after event fired only once when place order? (CLOSED)

I have observer the stock item when order placed: <global> <events> ... <cataloginventory_stock_item_save_commit_after> <observers> ...
1 vote
1 answer
6k views

Problems with saving new product (stock, price)

I'm creating a new product like this: $item = array(...); // associative array has attribute values $product = Mage::getModel('catalog/product'); $product->setTypeId('simple'); $product->...
  • 6,810
1 vote
2 answers
6k views

Magento - foreach simple product show name, sku and stock quantity?

Magento - foreach simple product show name, sku and stock quantity? Hi, I am trying to accomplish the following. I would like a simple PHP script to show/export: foreach simple product name, sku, ...
  • 5,342
1 vote
1 answer
497 views

How to manage stock availibility (in_stock or outof_stock) of product with Undo cancellation of order

I am trying to develop undo cancelled order extension. For that I am extending OrderController.php. class Extension_Undocancel_Adminhtml_Sales_OrderController extends ...
  • 1,649
1 vote
1 answer
553 views

Where Inventory_stock_% table get updated in Magento 2?

The problem I'm facing is that The table Inventory_stock_13 used for the 2nd website is updated incorrectly. When set source status to Out of stock, column is_salable is still 1 and quantity is ...
1 vote
1 answer
109 views

Stock quantity change API

I want to change quantity number on specific product after payment receive. And after that I reveave 400 error. Is it possible to change the stock quantity? Or Am I doing something wrong? I try to do ...
1 vote
1 answer
1k views

How to use the Out-of-Stock threshold option?

I see that I have the Out-of-Stock threshold in my admin panel, how could I use it in order to have more items in my products in stock then I really have? And how does it works?
1 vote
1 answer
483 views

is there a way to check if some code in Magento 2 is performed by a web API call

I am update a product stock item using the Magento API: <magento_url>/rest/V1/products/<sku>/stockItems/<item_id> and I have now setup a plugin to override the default Magento ...
1 vote
1 answer
279 views

Magento 2.3.5: What is the correct technique to update stock?

I have tried to follow the next solution: Magento 2: Programmatically Updating Inventory But in Magento 2.3.5 this solution is deprecated. \Magento\CatalogInventory\Api\StockRegistryInterface ...
  • 951
1 vote
2 answers
2k views

Update item custom quantity and salable quantity value after place order in Magento 2

I need to decrease purchased item saleable quantity with custom value (x* ordered_qty) after place order in Magento 2.Right now I'm using the following observer and class to update the quantity of ...
  • 195
1 vote
2 answers
3k views

how to sort stock by quantity in magento 2.3

In magento frontend i want to sort products by maximum quantity first to lower number of stock (Quantity sort in descending order) Please advise which module to be made and where to save the files i ...
  • 53
1 vote
1 answer
291 views

Magento 1.9.4 override Inventory tab template

I would like to override the template file used for the inventory tab in admin product edit section. This is located by default at: /app/design/adminhtml/default/default/template/catalog/product/tab/...
1 vote
1 answer
560 views

Save product observer - detect availability

I have catalog_product_save_after observer where I want detect when product became available for sale (Magento 2.2). I'm trying to compare some attributes using this code $old = $product->...
  • 121

1 2 3
4
5
10