2

i have a little question. When the Stock Status is set to "Only qty left in Stock" then is the Message "In Stock" showing too. But i will hide the Message "In Stock", when the Message "Only qty left in Stock" is showing.

Here a example: 10 articles in stock = Message "In Stock" 2 articles left in stock = Message "Only 2 left in Stock"

Can anyone help me?

1
  • Anyone a idea how can i solve this issue? Jun 26, 2015 at 12:47

1 Answer 1

1

Ok, i have solved the problem. Here is my code:

<?php
    $__manStock = $_product->getStockItem()->getManageStock();
    $__invAmt = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty();
    if ($__invAmt > 10)
    {
       echo $this->__("In stock.");
    }
       else {
          echo $this->__("Only $__invAmt left in stock.");
       }
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.