Read More
Read More
Menu Close

    Get Salable Quantity in Magento 2.3

    Get Salable Quantity in Magento 2.3

    In the latest Magento version 2.3, you might have noticed an additional quantity parameter ‘Salable Quantity‘. Today we will see how to get a product’s salable quantity in Magento 2.3

    Unlike in previous versions of Magento, the quantity of a product does not decrease when an order is placed. Instead, the quantity remains the same but salable quantity gets reduced. The quantity of the product decrease only after shipping is completed.

    Salable Quantity

    To get salable quantity use the following code –

    This will give output as –

    Here qty is salable quantity and not the actual quantity of the product. We can get the actual quantity of the product by $product->getQty()

    Hope this helps.

    Searching for an experienced
    Magento 2 Company ?
    Read More

    Happy coding 🙂


    . . .
    Discuss on Helpdesk

    Leave a Comment

    Your email address will not be published. Required fields are marked*


  • Teja Bhagavan Kollepara
    I just checked your tutorial, Its good. But i am having another issue that, the product salable quantity is showing 0 in magento admin panel. So that the product is not showing on frontend. I am using marketplace module from webkul for my Magento2.3.2.
    • Paul Dutta (Moderator)
      Please try increasing quantity from admin panel or check your default stock.
      If the issue still persists then please raise a ticket to
  • nikhil garg
    Sorry but i am new to magento could you tell where to put this code exactly ..
    • Paul Dutta (Moderator)
      You can use this code anywhere, like in block, controller, helper or model using this code
      But do remember to include the declare getSalableQuantityDataBySku variable like shown.
  • GOpal Gautam
    Thanks . But i have some issue when try to ship

    * Not all of your products are available in the requested quantity.

    Magento Version – 2.3 Can you help inthis

    • Paul Dutta (Moderator)
      Can you please explain in details on what is the issue ?
  • Seniore T
    Thank you very much for your postings about new Inventory. Cannont find examples anywhere else. Helpe me a lot.
    • Paul Dutta (Moderator)
      Great 🙂
  • chris
    is there a way to skip the reservation ?
    We would like to skip the “The quantity of the product decrease only after shipping is completed.” part to how it was before .
    • Paul Dutta (Moderator)
      Skipping salable quantity will be a problem as it has been implemented in many places. However you can try and update this file Magento\InventoryReservations\Model\ResourceModel\GetReservationsQuantity.php, where salable quantity is calculated. So you can try and modify this file to get the product actual qty, or you can simply use previous Magento 2 version.
  • Back to Top