1

I have turned on the feature in Magento that shows only x remaining when the stock is less than 5 which works fine.

However on products that are set to stock manage = no, it's showing there's only 0 left which isn't true as it's set to not stock manage.

I've found it's bringing it in because of this function $block->isMsgVisible() in module-catalog-inventory

When I look at that function it's simply doing the following

    public function isMsgVisible()
{
    return $this->getStockQty() > 0
        && $this->getStockQtyLeft() > 0
        && $this->getStockQtyLeft() <= $this->getThresholdQty();
}

Which doesn't take into consideration the fact it's set to stock manage = no.

How would I add in a check to see if it's stock manage = yes or no? I've tried a couple of things with no luck.

0

From the description and linked code snipped it seems that this case was not accounted for during the development.

I've created a ticket for MSI to verify this behavior in different setups, fix it, and cover with manual / automated tests: https://github.com/magento-engcom/msi/issues/2299

  • thanks @eugene I'll keep an eye on that ticket – Will Wright Jun 5 '19 at 7:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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