Magento getting stock status of a product


/ Published in: PHP
Save to your folder(s)

Magento getting stock status of a product


Copy this code and paste it in your HTML
  1. //$product = a magento product model
  2. $stock = $product->getStockItem();
  3. if ($stock->getIsInStock()) {
  4. echo "product is in stock";
  5. } else {
  6. echo "product is not in stock";
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.