Example #1
0
 /**
  * Check - 'items available' label is visible or not
  *
  * @return boolean
  */
 protected function isInStock()
 {
     $result = parent::isInStock();
     $variant = $this->getProductVariant();
     if ($variant) {
         if (!$variant->getDefaultAmount()) {
             $result = !$this->getProductVariant()->isOutOfStock();
         }
     } elseif ($this->getProduct()->mustHaveVariants()) {
         $result = false;
     }
     return $result;
 }