Example #1
0
 /**
  * Load product options if they exists
  *
  * @return $this
  */
 protected function _afterLoad()
 {
     parent::_afterLoad();
     /**
      * Load product options
      */
     if ($this->getHasOptions()) {
         foreach ($this->getProductOptionsCollection() as $option) {
             $option->setProduct($this);
             $this->addOption($option);
         }
     }
     return $this;
 }
Example #2
0
 /**
  * Load product options if they exists
  *
  * @return $this
  */
 protected function _afterLoad()
 {
     if (!$this->hasData(self::STATUS)) {
         $this->setData(self::STATUS, \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
     }
     parent::_afterLoad();
     /**
      * Load product options
      */
     if ($this->getHasOptions()) {
         foreach ($this->getProductOptionsCollection() as $option) {
             $option->setProduct($this);
             $this->addOption($option);
         }
     }
     return $this;
 }
Example #3
0
 /**
  * Load product options if they exists
  *
  * @return $this
  */
 protected function _afterLoad()
 {
     if (!$this->hasData(self::STATUS)) {
         $this->setData(self::STATUS, \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
     }
     parent::_afterLoad();
     return $this;
 }