Пример #1
0
 /**
  * @return Mage_Catalog_Model_Product|null
  * @throws Ess_M2ePro_Model_Exception
  */
 public function getProduct()
 {
     if (!is_null($this->product)) {
         return $this->product;
     }
     if ($this->proxyItem->getMagentoProduct()->isGroupedType()) {
         $this->product = $this->getAssociatedGroupedProduct();
         if (is_null($this->product)) {
             throw new Ess_M2ePro_Model_Exception('There is no associated Products found for Grouped Product.');
         }
     } else {
         $this->product = $this->proxyItem->getProduct();
         if ($this->proxyItem->getMagentoProduct()->isBundleType()) {
             $this->product->setPriceType(Mage_Catalog_Model_Product_Type_Abstract::CALCULATE_PARENT);
         }
     }
     // tax class id should be set before price calculation
     $this->product->setTaxClassId($this->getProductTaxClassId());
     return $this->product;
 }