diff --git a/Layout/default/Product/Index.php b/Layout/default/Product/Index.php index 7243c0017..cfcc3d38f 100644 --- a/Layout/default/Product/Index.php +++ b/Layout/default/Product/Index.php @@ -63,7 +63,7 @@
- ['productowner']]) as $owner): ?> diff --git a/application/Product/ProductController.php b/application/Product/ProductController.php index 5f8d385ea..fe3f4dbc4 100644 --- a/application/Product/ProductController.php +++ b/application/Product/ProductController.php @@ -32,7 +32,7 @@ class ProductController extends mfBaseController { $filter = $_SESSION[MFAPPNAME.'-Product-filter']; } } - + //var_dump($filter); $this->layout->set("filter", $filter); $filter = $this->getPreparedFilter($filter); @@ -46,7 +46,7 @@ class ProductController extends mfBaseController { if(is_numeric($this->request->s)) { $pagination['start'] = intval($this->request->s); } - + //var_dump($filter);exit; $pagination['maxItems'] = ProductModel::count($filter); $this->layout()->set("pagination", $pagination); diff --git a/application/Product/ProductModel.php b/application/Product/ProductModel.php index 873aa3192..f19113951 100644 --- a/application/Product/ProductModel.php +++ b/application/Product/ProductModel.php @@ -228,6 +228,15 @@ class ProductModel { } } + if(array_key_exists("external_id", $filter)) { + $external_id = $filter['external_id']; + if(is_numeric($external_id)) { + $where .= " AND external_id=$external_id"; + } elseif(is_array($external_id) && count($external_id)) { + $where .= " AND Product.external_id IN (". implode(",", $external_id).")"; + } + } + if(array_key_exists("external", $filter)) { $external = $filter['external']; if(is_numeric($external)) {