Exemplo n.º 1
0
 public function Show($parameters)
 {
     $view = new Zend_View();
     $view->addScriptPath('../library/Shineisp/Custom/views');
     $ns = new Zend_Session_Namespace();
     $languageID = Languages::get_language_id($ns->lang);
     $translator = Shineisp_Registry::getInstance()->Zend_Translate;
     if (!empty($parameters['category']) && is_numeric($parameters['category'])) {
         $id = $parameters['category'];
     } else {
         return "";
     }
     // Get the products
     $view->products = ProductsCategories::getProductListbyCatID($id, "p.product_id, p.uri as uri, pd.name as name, pd.shortdescription as description", $languageID);
     return $view->render('productlist.phtml');
 }
Exemplo n.º 2
0
 public function getproducts($uri)
 {
     $this->authenticate();
     if (empty($uri)) {
         throw new Shineisp_Api_Exceptions(400002, ":: 'uri' field");
         exit;
     }
     $infoCategory = ProductsCategories::getAllInfobyURI($uri);
     if (empty($infoCategory)) {
         throw new Shineisp_Api_Exceptions(400003, ":: uri=>'{$uri}' not category assigned");
         exit;
     }
     //get the first elemnt
     $infoCategory = array_shift($infoCategory);
     $categoryid = $infoCategory['category_id'];
     $products = ProductsCategories::getProductListbyCatID($categoryid);
     return $products;
 }
Exemplo n.º 3
0
 /**
  * Get products using the categories
  * 
  * @return Json
  */
 public function getproductsAction()
 {
     $id = $this->getRequest()->getParam('id');
     $products = array();
     if (is_numeric($id)) {
         $products = ProductsCategories::getProductListbyCatID($id, "p.product_id, pd.name as name");
     }
     die(json_encode($products));
 }