Search code examples
phpmagentomage

Magento get product information on view page


This is probably a very easy question. (many of mine seem to be)

But how do you get basic product information to be echo'd on product view page. Here are the things I am trying to access:

  • Inventory Stock Quantity
  • Restock Date

Essentially I'm looking for something like

<?php echo $_product->getQty(); ?>

Except that would only give the in cart quantity, but it doesn't even work.

Thanks in advance!


Solution

  • Use this to get product quantity

    <?php echo (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty(); ?>