Questions tagged [stock]

Denotes questions related to stock management and configuration on Magento

Filter by
Sorted by
Tagged with
1 vote
1 answer
31 views

Adding items to the basket when fewer are available

We are looking to solve a problem with Magento 2.4.6 (version probably irrelevant). We have multiple configurable products available for sale and customers will place orders for big quantities of the ...
Oracle's user avatar
  • 11
0 votes
2 answers
61 views

Magento 2 show current stock for salable quantity on productpage

I have this code for showing if my product is in stock or not. <?php /* @var $block \Magento\Catalog\Block\Product\View\AbstractView */?> <?php $_product = $block->getProduct() ?> &...
Kasper Elund's user avatar
0 votes
0 answers
21 views

Best practice for dealing with lost packages during shipping

Using: Magento 2.4.6 Hyva magento2 default theme: 1.2.3 Subject: What is a good way to handle lost packages during shipping? Situation is as follows: Product gets paid. Product is shipped to customer ...
JanosDjango's user avatar
0 votes
1 answer
193 views

Out of stock product visible on storefront. After updating the product programmatically

I'm working on integration, where I'm updating a product stock. But Whenever I set product stock to zero the product gets out-of-stock(as intended) from the backend but is still visible on the ...
Anurag's user avatar
  • 5
1 vote
1 answer
422 views

Magento2.4: How to assign a new source to stock programmatically?

I am trying to assign new sources to stock but it's not working. I checked the logs and there is no error found. Below is my code. Can anyone please check and suggest me where am I wrong? public ...
MagentoDev's user avatar
0 votes
0 answers
11 views

Can you locate an order that has not been shipped?

We have "missing stock" that is affecting the default stock and saleable quantity by 1 or 2. I understand that once the order has been shipped, this should reset it. However, there are a few ...
PF2023's user avatar
  • 1
0 votes
0 answers
41 views

Create a cron to change "Out of Stock" status

I want to create a module or script which will run via cron once in a day to check the products whose qty is greater than 0 but with an "Out of Stock" status, and change it to "In Stock&...
alam's user avatar
  • 1
0 votes
0 answers
43 views

SQL Error when importing stock csv

Since we have updated to magento 2.4.6 when we want to import stock via csv we now receive an error. systemException Additional data: SQLSTATE[42000]: Syntax error or access violation: 1064 You have ...
Michael's user avatar
  • 303
1 vote
1 answer
73 views

Magento 2.4.3 - Grouped/bundle product out of stock when one or more child items is out of stock

How can I make grouped/bundle products out of stock if one or more child products are out of stock?
Jan-petter Havna's user avatar
0 votes
0 answers
31 views

Magento 2.4.3 - Show out of stock while backorder is on

I'm looking for a way to show "out of stock" while the backorder is on. The client wants backorder and shows "out of stock" as we will translate that to something else. Is to ...
Jan-petter Havna's user avatar
0 votes
0 answers
18 views

Stock Cost Price Calculation

Looking at this from an accouting side of things. From what I can see a products cost price can only be one value but our suppliers put thier costs up every year so I could have the following ...
Ian Hepworth's user avatar
0 votes
1 answer
30 views

Magento 2.4.3 - Translation Issue

I'm trying to translate "Availability %1" to "På lager: %1" and this happens. Does anyone know why this happens?
Jan-petter Havna's user avatar
0 votes
0 answers
33 views

Fetch Saleable Qty for Multiple SKU's with Magneto DB Access

I have an app that uses magento for order processing while storing the products and prices in separate db. so it is been so difficult to capture the salable qty of products as adding products to cart ...
Harish Vadaparty's user avatar
0 votes
1 answer
146 views

Saleable quantity is empty even though quantity is showing admin

Right, here is a strange one we are using magento 2.4.2 and stock in the channel to import product data (if any one is aware of them) for some strange range we ever we ever we run the import the "...
shafiq's user avatar
  • 295
0 votes
1 answer
164 views

how to get product quantity in observer

I'm working on magento2.4 .Need to get the quantity of the product in product save after observer. while get qty it always returns null for newly created products. Note:qty shows correctly for ...
Jothi Subramanian's user avatar
0 votes
2 answers
54 views

Stock update Issue

Running into a problem when updating stock on a configurable product. Basically when one of my stock hits 0 and I do a mass stock update the qty will change but the simple product will remain out of ...
James's user avatar
  • 1
2 votes
0 answers
50 views

Filters don't hide out-of-stock products

I have a couple of custom filters, size and warehouse availability. When I select for example, size "XS" and "Warehouse1" I still see the product in the catalog that has size XS in ...
Захар Joe's user avatar
1 vote
0 answers
25 views

Magento 2.4.3 - Stock is not going to 0

we have an issue where stock does not go to 0, so if a customer buys something E.g. that has 1 left, the stock does not go to 0. The same happens if there are 5 left and the customer buys 5 it does ...
Jan-petter Havna's user avatar
1 vote
2 answers
609 views

How to get Product Salable quantity by productId in magento2

How to get product salable qty by productId?
Alshihab's user avatar
  • 161
1 vote
1 answer
24 views

Custom Warehouse

By Default Magento using Total Stock warehouse. I want to use my warehouse for all my products . I am currently using my custom warehouse, But some times it shows the magento by default warehouse.
Rana Zain's user avatar
  • 642
1 vote
0 answers
41 views

Update product stock data Progratically

i have a scenario where i am trying to update product data programatically and setting manage stock to no this works great for the product created in the admin. but i have situation here if the ...
Pramod's user avatar
  • 1,444
1 vote
0 answers
27 views

Correct way to call an object based on quantity, for displaying a product-alert, when backorders are allowed

I am trying to modify the following file in Magento2 <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\ProductAlert\Block\...
JanosDjango's user avatar
2 votes
0 answers
134 views

Show product alert link /stock alert, when a product is quantity zero, but still in stock

I am trying to add the "notify me when product is back in stock" link to a product that is still "in stock" but with a quantity of zero. Is this possible by modifying the module ...
JanosDjango's user avatar
0 votes
1 answer
407 views

Product stock quantity is reducing automatically before shipment

How the product stock quantity is decreasing automatically in magento2 before shipment(not saleable quantity)
Alshihab's user avatar
  • 161
0 votes
1 answer
306 views

Getting the minimum qty allowed in a shopping cart without deprecated methods

Previously to get the minimum qty allowed in a shopping cart I would use the following code: public function __construct( \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry ){ ...
Goose84's user avatar
  • 2,581
0 votes
2 answers
1k views

Magento 2.4 get stock qty after the product is saved in plugin

How to get stock qty after the product in saved via plugin? With code bellow I allways get "stock qty" 0 no matter what. di.xml: <type name="Magento\Catalog\Model\ResourceModel\...
Franci Melink's user avatar
0 votes
1 answer
81 views

Magento 2 swatches

I'm not good at Magento coding, so bear with me. I want to expose swatches for products with quantity 0 in the product list (changing the text with a ligther color with CSS for example) example: I'm ...
kray's user avatar
  • 3
1 vote
1 answer
1k views

Checkout cart error: The requested qty is not available

I'm using Magento 2.4.4, clients reported issues with the items in the cart, and I'm able to simulate by having two carts in different clients' accounts with the same item that has 1 item in stock. ...
Rafael Corrêa Gomes's user avatar
1 vote
0 answers
629 views

Programmatically update Stock Status Magento 2

I am trying to update Stock Status when the quantity is updated. Either from admin or web API (rest). app/code/Namespace/Module/etc/events.xml <?xml version="1.0" ?> <config xmlns:...
puntable's user avatar
  • 528
0 votes
1 answer
600 views

Property "Qty" does not have accessor method "getQty" in class Magento\InventoryApi\Api\Data\SourceItemInterface

I get this error: [2022-03-24 11:32:10] main.CRITICAL: Report ID: webapi-623c56baea1fe; Message: Property "Qty" does not have accessor method "getQty" in class "Magento\...
Greg's user avatar
  • 2,929
0 votes
0 answers
153 views

Extend API V1/products to put the not available products at the end

I want to display out of stock products at the end of the V1/products response. So far I tried to create a plugin on Magento\Catalog\Api\ProductRepositoryInterface to override the getList method but ...
darkmatterantearth's user avatar
0 votes
1 answer
506 views

Where is the "notify me when in stock" data saved in which table?

Hi I am trying to see where is "notify me in stock alert " data saved to which table. Moreover, default Magento customer profile should include the item alert list or not?
Paul Fan's user avatar
  • 654
0 votes
1 answer
231 views

isSaleable product save

Use Case From a product with quantity 0 and Out of stock status. I have an event <event name="catalog_product_save_after"> <observer name="stock_alert" instance="...
Claims's user avatar
  • 1,146
0 votes
1 answer
297 views

Magento 2: How to get cart items and its stocks using custom API?

I'm learning Magento 2 API. I need to create a custom API to get cart items and its stocks. I can see there is an API available to get cart items in Magento by default which is the below GET V1/carts/...
MagentoDev's user avatar
0 votes
1 answer
258 views

Magento 2 - Getting wrong quantity from a simple product

I've only recently started working with Magento and developement in general, so I am new at this. I need a (simple) product's quantity for some custom logic. But I don't know how to get it into my ....
kray's user avatar
  • 3
2 votes
1 answer
3k views

"The requested qty is not available" not always shown?

Magento 2.4.2 Lets say I have a qty of 1 for product X. Now when I try to put a qty of 10 of product X to the cart, the message "The requested qty is not available" is NOT shown. Nothing is ...
user4095519's user avatar
0 votes
1 answer
47 views

How to retrieve updated stock quantity after modifying source item repository?

I am trying to add stock quantity dynamically and use the current stock quantity for adding the product to the cart. The stock quantity gets updated successfully, however the ProductRepository keeps ...
Bartu's user avatar
  • 1
0 votes
0 answers
168 views

Magento Product Stock status changes automatically

We are facing an issue with Magento 2.4. We are using MSI and we have 3 warehouses. All products have been assigned 3 warehouses and we manage stock using MSI. A product can be available in one ...
OBAID's user avatar
  • 279
0 votes
1 answer
253 views

Manage stock needs to be set per store

Situation: Magento 2.4.2 p1 (but was also like this on earlier versions) We have Magento multistore. So example. I create a configurable product from our imports (Emagic manager). I set ‘manage stock’...
Emile's user avatar
  • 101
2 votes
3 answers
623 views

How to save stock attribute value ('qty') for a product with Magento 2 objectmanager?

I've found out how to do this with other attributes. For example a custom 'location' attribute: $product = $this->objectManager->get('Magento\Catalog\Model\Product')- >load($post['id']); ...
IvoJongmans's user avatar
2 votes
4 answers
3k views

Magento 2.4.4 - Unable to place order: There are no source items with the in stock status

I assume that the client couldn't proceed with items in the cart that aren't in stock, but even with a clean Magento installation, it's happening. How could I solve or find the reason for this issue?
Rafael Corrêa Gomes's user avatar
0 votes
1 answer
130 views

how to get stock total for all simple products linked to a configurable product in magento2

I want to get all the qty total for all simple products linked to a specific configurable product I have to do the following (check my code below) but it returns "0" on total, can anyone ...
magNif's user avatar
  • 5
0 votes
2 answers
355 views

Magento 2 Stock Status

This question has been answered for Magento 1. (see: here). As I am migrating to Magento2 and need the same logic here is the issue: I am trying to figure a way to hide show stock status/availability ...
RoboxFuze's user avatar
3 votes
1 answer
1k 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 ...
Long Nguyen's user avatar
0 votes
1 answer
5k views

The stock item was unable to be saved. Please try again

I'm running a custom import. At some point the error: The stock item was unable to be saved. Please try again. Is triggered by : $this->_productRepository->save($prod); Now I'm trying to figure ...
Claims's user avatar
  • 1,146
0 votes
1 answer
40 views

Stock set to zero after sale

Magento 2.4.2 For some reason product stock is being set to 0 after an order is placed, regardless of quantity previously in stock or quantity ordered. What could be causing this? How can I debug ...
William Oakley's user avatar
0 votes
1 answer
19 views

Magento 2.3.6 - Stock do not go from 1 to 0

We have Magento 2.3.6 and MIS is disabled. So we have an issue when products are sold from any number down to 0 it does not decrease at all. E.g. if we have 10 left of a product and someone buys 10 ...
Jan-petter Havna's user avatar
0 votes
1 answer
147 views

Why the massive product update via admin isn't working?

I'm just updated all my 12k products via admin massive action, I changed the stock status to in stock, but it's not running. How could I force it to run and fix it the next time?
Rafael Corrêa Gomes's user avatar
0 votes
1 answer
775 views

Magento 2 How to restore stock after cancel order

I am working on Magento 2.3.5 p-1 I have created a custom module that adds a mass action to the sales order grid, through a controller this action changes the order status to "customCancel" ...
Noty's user avatar
  • 76
0 votes
2 answers
243 views

Get all stock quantities given one product

These are the stocks I have On my export this is what i'm getting, as you can see (for re and re_pro which belong to the same website) the quantity is fine , but the salable qty is a merge of both; ...
Claims's user avatar
  • 1,146

1
2 3 4 5
11