Commit c3a266dd816707f12a028461e941e99b877f1a9b
1 parent
90dded12
big commti
Showing
3 changed files
with
7 additions
and
5 deletions
Show diff stats
frontend/controllers/AjaxController.php
... | ... | @@ -53,8 +53,9 @@ class AjaxController extends Controller |
53 | 53 | } |
54 | 54 | |
55 | 55 | |
56 | - public function actionTest(){ | |
56 | + public function actionCount(){ | |
57 | 57 | $filter = \Yii::$app->request->get('info'); |
58 | + $id = \Yii::$app->request->get('category'); | |
58 | 59 | |
59 | 60 | |
60 | 61 | if(!empty( $filter[ 'brands' ] )) { |
... | ... | @@ -73,7 +74,7 @@ class AjaxController extends Controller |
73 | 74 | } |
74 | 75 | |
75 | 76 | if(!empty($filter)){ |
76 | - $category = Category::findOne(176); | |
77 | + $category = Category::findOne($id); | |
77 | 78 | return $this->findItem($category,$filter); |
78 | 79 | } else { |
79 | 80 | return 'test'; | ... | ... |
frontend/web/js/filter.js
... | ... | @@ -65,10 +65,11 @@ function loadService(){ |
65 | 65 | function priceRequest(link){ |
66 | 66 | var tag = $(link).parents('li'); |
67 | 67 | var filter = tag.data('filter'); |
68 | + var id = $("#filters").data('category'); | |
68 | 69 | $.ajax({ |
69 | - url: "/ajax/test", | |
70 | + url: "/ajax/count", | |
70 | 71 | type: 'GET', |
71 | - data: {info:filter}, | |
72 | + data: {info:filter,category:id}, | |
72 | 73 | success: function(result){ |
73 | 74 | if(result=='0'){ |
74 | 75 | $(link).addClass('disabled-link'); | ... | ... |
frontend/widgets/views/_filter_view.php