Skip to main content
34 votes
Accepted

Change standard quantity on product page from 0 to 1 (Magento 2)

--The easiest way is that we can change the input value from template: (override this template - not recommend) vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml --...
Khoa TruongDinh's user avatar
26 votes

How to get stock quantity of each product in Magento 2

Like some comments have mentioned, you want to use dependency injection. Do not use the object manager; in other words, do not do what any of the other responses state. The following technique can be ...
danemacmillan's user avatar
22 votes
Accepted

Salable Quantity is showing zero in product grid magento 2?

In DataBase, There was two type, Tables Views The issue is possibly caused when Import/Export DataBase Views was not created in Magento 2.3. So create Views and inventory_stock_1 table in DataBase....
Savan Patel's user avatar
  • 2,368
18 votes

Salable Quantity is showing zero in product grid magento 2?

I'm gonna share my experience related to this issue, I hope it could help someone who would have been in the same situation. We were working on a staged instance, All was ready to go to production. So ...
rou6e's user avatar
  • 1,041
15 votes
Accepted

Can't check requested quantity for products without Source Items support issue on 2.3.1

New code from Magento 2.3 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd"&...
Shahanas K V's user avatar
12 votes
Accepted

Magento2 : Remove decimal from quantity

This decimal comes from database. So if you need to remove this, then you need to create column renderer. Here is an example In your etc/module.xml file add sequence tag follows: <config xmlns:...
Sohel Rana's user avatar
  • 35.9k
12 votes

How to get stock quantity of each product in Magento 2

How to get stock quantity of each product in Magento 2 for controller or block inject \Magento\CatalogInventory\Api\StockStateInterface public function __construct( \Magento\CatalogInventory\...
Surendra Kumar Ahir's user avatar
11 votes

Salable Quantity is showing zero in product grid magento 2?

I skipped this line of query, due to Previllages error and my add to cart was not working on live server, in local server this line was not skipped and add to cart was working fine. CREATE ALGORITHM=...
Sanaullah Ahmad's user avatar
7 votes

How to get stock quantity of each product in Magento 2

The below script will be helpful to get the product stock qty, min qty and stock details in magento2. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $productStockObj = $...
Tapas Ranjan's user avatar
7 votes
Accepted

Magento 2 stock inventory is not being updated

Check below settings. Admin > Store > Configuration > Catalog > Inventory > Stock option > Decrease Stock When Order is Placed Set it to yes. If you have a multi-website or multi-store then change ...
Chirag Patel's user avatar
  • 6,136
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
6 votes

Magento 2 stock inventory is not being updated

check your stock setting in admin panel Advance Inventory->manage stock set to yes if you want to reduce quantity
Tirth Patel's user avatar
  • 1,039
6 votes
Accepted

how to add quantity increment and decreament (+ and - button) in minicart magento 2?

app/design/frontend/Module/theme/Magento_Checkout/web/template/minicart/item/default.html <div class="product-item-pricing"> <!-- ko if: canApplyMsrp --> ...
Hitesh Balpande's user avatar
6 votes
Accepted

How to set qty to product on MSI Magento 2.3

Here you go! /** * @var Magento\InventoryApi\Api\SourceItemsSaveInterface */ protected $sourceItemsSave; /** * @var Magento\InventoryApi\Api\Data\SourceItemInterfaceFactory */ protected $...
Sondre's user avatar
  • 353
5 votes

Change standard quantity on product page from 0 to 1 (Magento 2)

--The second way is the Magento default config: STORES > Configuration > Catalog > Inventory > Product Stock Options > Minimum Qty Allowed in Shopping Cart > > Add Customer Group > change to 1 For ...
Rebecca Brocton's user avatar
5 votes

Change standard quantity on product page from 0 to 1 (Magento 2)

Khoa's second option is the preferred one. Anyways, this sometimes does not work for bundles. There you have to also carefully check the bundles option's and quantities. The logic for the default ...
Alex's user avatar
  • 13.9k
5 votes
Accepted

Qty Uses Decimals Magento 2 does not work

Go to Catalog > Product > Advanced Inventory Change value of Minimum Qty Allowed in Shopping Cart this Option in Decimal Points [For ex 0.25] or anything minimum quantity you want to add into ...
Emipro Technologies Pvt. Ltd.'s user avatar
5 votes
Accepted

Error message "Some of the products are disabled" on checkout

check your magento file vendor/magento/module-checkout/Model/GuestPaymentInformationManagement.php the GuestPaymentInformationManagement.php file is updated in magento2.4.4 version. Magento\Checkout\...
S.P's user avatar
  • 1,554
4 votes
Accepted

How to show Qty left in Magento 2 Listing page?

Create a block class to your custom module named Vendor_Module to below path: app/code/Vendor/Module/Block/Product.php and add the below content to it: <?php namespace Vendor\Module\Block; ...
Sukumar Gorai'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,657
4 votes

Salable Quantity is showing zero in product grid magento 2?

I had to remove the DEFINER=root@localhost from @Thakur answer so here is what I used: CREATE ALGORITHM=UNDEFINED SQL SECURITY INVOKER VIEW `inventory_stock_1` AS select distinct `...
The Billionaire Guy's user avatar
4 votes

Salable Quantity is greater than quantity

Based on your description the root cause of the problem could be one of those: You have upgraded to Magento 2.3 from the previous version of Magento where you had some orders placed, but not shipped. ...
Igor Minyaylo's user avatar
4 votes
Accepted

Load Product Qty by sku in Magento 2 Controller

First load product by sku: $product = $this->_productRepository->get($sku); To get stock qty use this: $StockState->getStockQty($product->getId(), $product->getStore()->...
Shoaib Munir's user avatar
  • 9,482
4 votes
Accepted

How to update product salable quantity in Magento 2.4 programmatically?

To set the saleable quantity of a product , you need to look at this table = "cataloginventory_stock_item" , in this the field = "qty". So in order to set the qty in this table , ...
Bharath Kumar's user avatar
3 votes

How to get stock quantity of each product in Magento 2

If you want to $productobj after saving product from backend side so you can easily use catalog_product_save_after event. I am assuming that you already know how to create a module in M2. Right now ...
Baharuni Asif's user avatar
3 votes

Quantity increment button

Here I am guiding you adding plus/minus functionality with increment of 100 in default file. Use the code accordingly. In catalog module edit your Quantity function which comes by default in ...
Manoj Deswal's user avatar
  • 5,805
3 votes
Accepted

Updating minimum order quantity (Front End View)

As your question mention you want to show minimum order quantity. Goto app\design\frontend\<Your Theme>\default\template\catalog\product\view.phtml before quantity section add this code <?...
Ramesh S's user avatar
  • 1,235
3 votes

Quantity Increment and Decrement Button not work in Magento 2

=> Go to your theme Folder and create file called addtocart.phtml and past below code. Quantity Increment and Decrement Button working fine by using below code E.g : app/design/frontend/...
Navin Bhudiya's user avatar
3 votes

Magenoto2: how to get cart item quantity on front end

use below code public function __construct( \Magento\Customer\Model\Session $currentCustomer ) { $this->checkoutSession = $checkoutSession; } $cartQuote=$this->checkoutSession-&...
Nikhil Vaghela's user avatar
3 votes
Accepted

How to get the stock quantity of the item and show it on a list.phtml page in Magento 2.2.3?

If you want to show qty of the product, You can used this code. $product_Id = 'YOUR_PRODUCT_ID'; $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $stockInfo = $objectManager->...
Dhiren Vasoya's user avatar

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