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;
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
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.
add a comment |
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
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.
add a comment |
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
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
magento2 php database table
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.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
If you need to show quantity on Store Front then you should use MagentoCatalogInventoryApiStockRegistryInterface::getStockStatus method like:
$stockRegistry->getStockStatus($product->getId())->getQty()
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
If you need to show quantity on Store Front then you should use MagentoCatalogInventoryApiStockRegistryInterface::getStockStatus method like:
$stockRegistry->getStockStatus($product->getId())->getQty()
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
add a comment |
If you need to show quantity on Store Front then you should use MagentoCatalogInventoryApiStockRegistryInterface::getStockStatus method like:
$stockRegistry->getStockStatus($product->getId())->getQty()
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
add a comment |
If you need to show quantity on Store Front then you should use MagentoCatalogInventoryApiStockRegistryInterface::getStockStatus method like:
$stockRegistry->getStockStatus($product->getId())->getQty()
If you need to show quantity on Store Front then you should use MagentoCatalogInventoryApiStockRegistryInterface::getStockStatus method like:
$stockRegistry->getStockStatus($product->getId())->getQty()
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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