Magento 2 call table stock_item from database Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Magento 2, call table from databaseMagento 2 Call breadcrumbs on Category & Product pagesMagento 2.1: Not add table into databaseDb engine support for M2 other than mysqlMagento 2 Custom Table Migration - Split dataMagento 2 : How to remove part of the breadcrumbs in category product page?Magento 2 Knockout XML->PHTML->JS->HTMLMagento databse table copy gives errorMagento 2.3.0 Get product attribute name in phtml in CMS BlockExport Category name in xml feed Magento 1.9.2

What LEGO pieces have "real-world" functionality?

Coloring maths inside a tcolorbox

Should I discuss the type of campaign with my players?

How to answer "Have you ever been terminated?"

Using et al. for a last / senior author rather than for a first author

Do I really need recursive chmod to restrict access to a folder?

Why do we bend a book to keep it straight?

Why did the IBM 650 use bi-quinary?

illegal generic type for instanceof when using local classes

Extract all GPU name, model and GPU ram

Use BFD on a Virtual-Template Interface

Why aren't air breathing engines used as small first stages

Should I use a zero-interest credit card for a large one-time purchase?

Bete Noir -- no dairy

How discoverable are IPv6 addresses and AAAA names by potential attackers?

What is the role of the transistor and diode in a soft start circuit?

How to call a function with default parameter through a pointer to function that is the return of another function?

Why did the rest of the Eastern Bloc not invade Yugoslavia?

Why are Kinder Surprise Eggs illegal in the USA?

How widely used is the term Treppenwitz? Is it something that most Germans know?

Single word antonym of "flightless"

What's the purpose of writing one's academic biography in the third person?

What causes the vertical darker bands in my photo?

Sci-Fi book where patients in a coma ward all live in a subconscious world linked together



Magento 2 call table stock_item from database



Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Magento 2, call table from databaseMagento 2 Call breadcrumbs on Category & Product pagesMagento 2.1: Not add table into databaseDb engine support for M2 other than mysqlMagento 2 Custom Table Migration - Split dataMagento 2 : How to remove part of the breadcrumbs in category product page?Magento 2 Knockout XML->PHTML->JS->HTMLMagento databse table copy gives errorMagento 2.3.0 Get product attribute name in phtml in CMS BlockExport Category name in xml feed Magento 1.9.2



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








3















I working to Magento 2.0.2 and i trying to call the table stock_item of the product. When i worked in Magento 1.9 i used this code:



 loadByProduct($_product)->getQty();?> 


But now the class Mage is not compatible with the new version of Magento. So how i do for call this table in my .pthml file?



Thank you very much for any help.



P.S. On other question, what is the .phtml file where is called the name of the product?










share|improve this question














bumped to the homepage by Community 1 min ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.





















    3















    I working to Magento 2.0.2 and i trying to call the table stock_item of the product. When i worked in Magento 1.9 i used this code:



     loadByProduct($_product)->getQty();?> 


    But now the class Mage is not compatible with the new version of Magento. So how i do for call this table in my .pthml file?



    Thank you very much for any help.



    P.S. On other question, what is the .phtml file where is called the name of the product?










    share|improve this question














    bumped to the homepage by Community 1 min ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.

















      3












      3








      3








      I working to Magento 2.0.2 and i trying to call the table stock_item of the product. When i worked in Magento 1.9 i used this code:



       loadByProduct($_product)->getQty();?> 


      But now the class Mage is not compatible with the new version of Magento. So how i do for call this table in my .pthml file?



      Thank you very much for any help.



      P.S. On other question, what is the .phtml file where is called the name of the product?










      share|improve this question














      I working to Magento 2.0.2 and i trying to call the table stock_item of the product. When i worked in Magento 1.9 i used this code:



       loadByProduct($_product)->getQty();?> 


      But now the class Mage is not compatible with the new version of Magento. So how i do for call this table in my .pthml file?



      Thank you very much for any help.



      P.S. On other question, what is the .phtml file where is called the name of the product?







      magento2 php database table






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 5 '16 at 18:29









      Gabriel91Gabriel91

      1921317




      1921317





      bumped to the homepage by Community 1 min ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 1 min ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.






















          1 Answer
          1






          active

          oldest

          votes


















          0














          If you need to show quantity on Store Front then you should use MagentoCatalogInventoryApiStockRegistryInterface::getStockStatus method like:



          $stockRegistry->getStockStatus($product->getId())->getQty()





          share|improve this answer























          • Thank you man but this code is not good for my magento. This code not call the table of stock quantity of my quantity. The problem is this, i created four type of quantity for my product in my table of database and i don't know as recall any single of this data for any product and showing in front end...

            – Gabriel91
            Feb 8 '16 at 8:29












          • In magento 1.9 existed the Class Mage for this but now? Thanks again...

            – Gabriel91
            Feb 8 '16 at 9:00











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "479"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f100550%2fmagento-2-call-table-stock-item-from-database%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          If you need to show quantity on Store Front then you should use MagentoCatalogInventoryApiStockRegistryInterface::getStockStatus method like:



          $stockRegistry->getStockStatus($product->getId())->getQty()





          share|improve this answer























          • Thank you man but this code is not good for my magento. This code not call the table of stock quantity of my quantity. The problem is this, i created four type of quantity for my product in my table of database and i don't know as recall any single of this data for any product and showing in front end...

            – Gabriel91
            Feb 8 '16 at 8:29












          • In magento 1.9 existed the Class Mage for this but now? Thanks again...

            – Gabriel91
            Feb 8 '16 at 9:00















          0














          If you need to show quantity on Store Front then you should use MagentoCatalogInventoryApiStockRegistryInterface::getStockStatus method like:



          $stockRegistry->getStockStatus($product->getId())->getQty()





          share|improve this answer























          • Thank you man but this code is not good for my magento. This code not call the table of stock quantity of my quantity. The problem is this, i created four type of quantity for my product in my table of database and i don't know as recall any single of this data for any product and showing in front end...

            – Gabriel91
            Feb 8 '16 at 8:29












          • In magento 1.9 existed the Class Mage for this but now? Thanks again...

            – Gabriel91
            Feb 8 '16 at 9:00













          0












          0








          0







          If you need to show quantity on Store Front then you should use MagentoCatalogInventoryApiStockRegistryInterface::getStockStatus method like:



          $stockRegistry->getStockStatus($product->getId())->getQty()





          share|improve this answer













          If you need to show quantity on Store Front then you should use MagentoCatalogInventoryApiStockRegistryInterface::getStockStatus method like:



          $stockRegistry->getStockStatus($product->getId())->getQty()






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 6 '16 at 9:38









          KAndyKAndy

          16.2k23346




          16.2k23346












          • Thank you man but this code is not good for my magento. This code not call the table of stock quantity of my quantity. The problem is this, i created four type of quantity for my product in my table of database and i don't know as recall any single of this data for any product and showing in front end...

            – Gabriel91
            Feb 8 '16 at 8:29












          • In magento 1.9 existed the Class Mage for this but now? Thanks again...

            – Gabriel91
            Feb 8 '16 at 9:00

















          • Thank you man but this code is not good for my magento. This code not call the table of stock quantity of my quantity. The problem is this, i created four type of quantity for my product in my table of database and i don't know as recall any single of this data for any product and showing in front end...

            – Gabriel91
            Feb 8 '16 at 8:29












          • In magento 1.9 existed the Class Mage for this but now? Thanks again...

            – Gabriel91
            Feb 8 '16 at 9:00
















          Thank you man but this code is not good for my magento. This code not call the table of stock quantity of my quantity. The problem is this, i created four type of quantity for my product in my table of database and i don't know as recall any single of this data for any product and showing in front end...

          – Gabriel91
          Feb 8 '16 at 8:29






          Thank you man but this code is not good for my magento. This code not call the table of stock quantity of my quantity. The problem is this, i created four type of quantity for my product in my table of database and i don't know as recall any single of this data for any product and showing in front end...

          – Gabriel91
          Feb 8 '16 at 8:29














          In magento 1.9 existed the Class Mage for this but now? Thanks again...

          – Gabriel91
          Feb 8 '16 at 9:00





          In magento 1.9 existed the Class Mage for this but now? Thanks again...

          – Gabriel91
          Feb 8 '16 at 9:00

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f100550%2fmagento-2-call-table-stock-item-from-database%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Best approach to update all entries in a list that is paginated?Best way to add items to a paginated listChoose Your Country: Best Usability approachUpdate list when a user is viewing the list without annoying themWhen would the best day to update your webpage be?What should happen when I add a Row to a paginated, sorted listShould I adopt infinite scrolling or classical pagination?How to show user that page objects automatically updateWhat is the best location to locate the comments section in a list pageBest way to combine filtering and selecting items in a listWhen one of two inputs must be updated to satisfy a consistency criteria, which should you update (if at all)?

          Тонконіг бульбистий Зміст Опис | Поширення | Екологія | Господарське значення | Примітки | Див. також | Література | Джерела | Посилання | Навігаційне меню1114601320038-241116202404kew-435458Poa bulbosaЭлектронный каталог сосудистых растений Азиатской России [Електронний каталог судинних рослин Азіатської Росії]Малышев Л. Л. Дикие родичи культурных растений. Poa bulbosa L. - Мятлик луковичный. [Малишев Л. Л. Дикі родичи культурних рослин. Poa bulbosa L. - Тонконіг бульбистий.]Мятлик (POA) Сем. Злаки (Мятликовые) [Тонконіг (POA) Род. Злаки (Тонконогові)]Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Description from Flora of China) [Poa bulbosa Linnaeus, Sp. Pl. 1: 70. 1753. 鳞茎早熟禾 lin jing zao shu he (Опис від Флора Китаю)]Poa bulbosa L. – lipnice cibulkatá / lipnica cibulkatáPoa bulbosa в базі даних Poa bulbosa на сайті Poa bulbosa в базі даних «Global Biodiversity Information Facility» (GBIF)Poa bulbosa в базі даних «Euro + Med PlantBase» — інформаційному ресурсі для Євро-середземноморського розмаїття рослинPoa bulbosa L. на сайті «Плантариум»

          Вунгтау (аеропорт) Загальні відомості | Див. також | Посилання | Навігаційне меню10°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.0833310°22′00″ пн. ш. 107°05′00″ сх. д. / 10.36667° пн. ш. 107.08333° сх. д. / 10.36667; 107.083337731608Vinh AirportVinh airport facelift improves serviceвиправивши або дописавши їївиправивши або дописавши їїр