Ejemplo n.º 1
0
 public function findAction()
 {
     if ($value_id = $this->getRequest()->getParam('value_id') and $set_meal_id = $this->getRequest()->getParam('set_meal_id')) {
         $set_meal = new Catalog_Model_Product();
         $set_meal->find($set_meal_id);
         $option_value = $this->getCurrentOptionValue();
         $data = array();
         if ($set_meal->getData("type") == "menu") {
             $data = array("name" => $set_meal->getName(), "conditions" => $set_meal->getConditions(), "description" => $set_meal->getDescription(), "price" => $set_meal->getPrice() > 0 ? $set_meal->getFormattedPrice() : null, "picture" => $set_meal->getPictureUrl(), "social_sharing_active" => $option_value->getSocialSharingIsActive());
         }
         $this->_sendHtml($data);
     }
 }
Ejemplo n.º 2
0
 public function findAction()
 {
     if ($value_id = $this->getRequest()->getParam('value_id') and $product_id = $this->getRequest()->getParam('product_id')) {
         $product = new Catalog_Model_Product();
         $product->find($product_id);
         $option_value = $this->getCurrentOptionValue();
         $data = array();
         if ($product->getData("type") != "menu") {
             $format = array();
             if ($product->getData("type") == "format") {
                 foreach ($product->getType()->getOptions() as $option) {
                     $format[] = array("id" => $option->getId(), "title" => $option->getTitle(), "price" => $option->getFormattedPrice());
                 }
             }
             $data = array("name" => $product->getName(), "conditions" => $product->getConditions(), "description" => $product->getDescription(), "price" => $product->getPrice() > 0 ? $product->getFormattedPrice() : null, "picture" => $product->getPictureUrl(), "formats" => $format, "social_sharing_active" => $option_value->getSocialSharingIsActive());
         }
         $this->_sendHtml($data);
     }
 }