Ejemplo n.º 1
0
 /**
  * This function is used to return the configurable product
  * @param $product
  * @param $source
  */
 private function getProduct($product, $source)
 {
     if ($product->isConfigurable()) {
         if (isset($source['super_attribute'])) {
             $attributes = $source['super_attribute'];
             $product = Mage::getModel('catalog/product_type_configurable')->getProductByAttributes($attributes, $product);
             $product = Mage::getModel('catalog/product')->load($product->getId());
         } else {
             ITwebexperts_Payperrentals_Helper_Html::updateReservationError(Mage::helper("payperrentals")->__("You need to select attributes"));
             return $this;
         }
     }
     return $product;
 }