Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AdaptMinQtyToBackordersPlugin.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
11 
13 {
19  public function afterGetMinQty(StockItemInterface $subject, float $result)
20  {
21  if ($subject->getBackorders()) {
22  return $result >= 0 ? 0 : $result;
23  }
24 
25  return $result > 0 ? $result : 0;
26  }
27 }