diff --git a/frontend/controllers/AjaxController.php b/frontend/controllers/AjaxController.php index ceba6c2..ebd6e90 100755 --- a/frontend/controllers/AjaxController.php +++ b/frontend/controllers/AjaxController.php @@ -53,8 +53,9 @@ class AjaxController extends Controller } - public function actionTest(){ + public function actionCount(){ $filter = \Yii::$app->request->get('info'); + $id = \Yii::$app->request->get('category'); if(!empty( $filter[ 'brands' ] )) { @@ -73,7 +74,7 @@ class AjaxController extends Controller } if(!empty($filter)){ - $category = Category::findOne(176); + $category = Category::findOne($id); return $this->findItem($category,$filter); } else { return 'test'; diff --git a/frontend/web/js/filter.js b/frontend/web/js/filter.js index 85415bb..f91c837 100644 --- a/frontend/web/js/filter.js +++ b/frontend/web/js/filter.js @@ -65,10 +65,11 @@ function loadService(){ function priceRequest(link){ var tag = $(link).parents('li'); var filter = tag.data('filter'); + var id = $("#filters").data('category'); $.ajax({ - url: "/ajax/test", + url: "/ajax/count", type: 'GET', - data: {info:filter}, + data: {info:filter,category:id}, success: function(result){ if(result=='0'){ $(link).addClass('disabled-link'); diff --git a/frontend/widgets/views/_filter_view.php b/frontend/widgets/views/_filter_view.php index 878e710..0d89086 100755 --- a/frontend/widgets/views/_filter_view.php +++ b/frontend/widgets/views/_filter_view.php @@ -7,7 +7,7 @@ use frontend\widgets\FilterList; ?> -