Пример #1
0
 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 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());
     $price = $this->proxyItem->getBasePrice();
     $this->product->setPrice($price);
     $this->product->setSpecialPrice($price);
     return $this->product;
 }