diff --git a/api/v1/entries/products.php b/api/v1/entries/products.php index afc5942502..93d93b66b9 100644 --- a/api/v1/entries/products.php +++ b/api/v1/entries/products.php @@ -24,7 +24,7 @@ class productsEntry extends entry if(strpos(strtolower(",{$fields},"), ',dropmenu,') !== false) return $this->getDropMenu(); if(!$programID) $programID = $this->param('program', 0); - $projectID = $this->param('project', 0); + $projectID = $this->param('project', 0); $mergeChildren = $this->param('mergeChildren', ''); if($programID) @@ -55,7 +55,7 @@ class productsEntry extends entry else { $control = $this->loadController('product', 'all'); - $control->all($this->param('status', 'all'), $this->param('order', 'order_asc'), 0, 0, $this->param('limit', '20'), $this->param('page', '1') ); + $control->all($this->param('status', 'all'), $this->param('order', 'program_asc'), 0, 0, $this->param('limit', 100), $this->param('page', 1)); /* Response */ $data = $this->getData(); @@ -174,7 +174,7 @@ class productsEntry extends entry /** * Merge children products. * - * @param array $products + * @param array $products * @access public * @return void */ @@ -192,12 +192,11 @@ class productsEntry extends entry } $unclosedTotal = 0; - foreach($program as $field => $value) + foreach($program as $lineID => $value) { if(!isset($programs[$programID]->children)) $programs[$programID]->children = array(); if(isset($value->products)) { - $lineID = $field; if(empty($lineID)) { foreach($value->products as $product)