Commit 54f69b92e73420aafd9419b71e8a9aacbc35e113
1 parent
de8261de
Price filter fix
Showing
2 changed files
with
11 additions
and
8 deletions
Show diff stats
frontend/views/category/view.php
... | ... | @@ -164,11 +164,6 @@ _________________________________________________________ --> |
164 | 164 | <?php |
165 | 165 | } |
166 | 166 | ?> |
167 | - | |
168 | - <div class="panel-heading"> | |
169 | - <h3 class="panel-title"><?php echo \Yii::t('app', 'Цена'); ?></h3> | |
170 | - </div> | |
171 | - | |
172 | 167 | </div> |
173 | 168 | |
174 | 169 | <?php |
... | ... | @@ -320,6 +315,9 @@ _________________________________________________________ --> |
320 | 315 | <!-- *** MENUS AND FILTERS END *** --> |
321 | 316 | |
322 | 317 | <!-- /.banner --> |
318 | + <div class="panel-heading"> | |
319 | + <h3 class="panel-title"><?php echo \Yii::t('app', 'Цена'); ?></h3> | |
320 | + </div> | |
323 | 321 | <div class="panel-body"> |
324 | 322 | <div class="form-group"> |
325 | 323 | <div style="width:200px;"> | ... | ... |
frontend/web/js/script.js
... | ... | @@ -347,17 +347,22 @@ $(function() { |
347 | 347 | .val(); |
348 | 348 | console.log(max, min); |
349 | 349 | var href = window.location.href; |
350 | + var question = href.indexOf('?'); | |
351 | + if (question !== -1) { | |
352 | + var queryString = href.substr(question); | |
353 | + href = href.substr(0, question); | |
354 | + } | |
350 | 355 | var count = 0; |
351 | 356 | var pos = -1; |
352 | 357 | while ((pos = href.indexOf('/', pos + 1)) !== -1) { |
353 | 358 | count++; |
354 | 359 | } |
355 | 360 | if (count === 5) { |
356 | - window.location.href = href + '/price-' + min + '-' + max; | |
361 | + window.location.href = href + '/price-' + min + '-' + max + queryString; | |
357 | 362 | } else { |
358 | - var result = window.location.href.match(/\/[^\/]*price-(\d+)-(\d+)$/); | |
363 | + var result = href.match(/\/[^\/]*price-(\d+)-(\d+)$/); | |
359 | 364 | if (result) { |
360 | - window.location.href = window.location.href.replace(/(\/[^\/]*)price-\d+-\d+$/, '$1price-' + min + '-' + max); | |
365 | + window.location.href = href.replace(/(\/[^\/]*)price-\d+-\d+$/, '$1price-' + min + '-' + max) + queryString; | |
361 | 366 | } |
362 | 367 | } |
363 | 368 | }); | ... | ... |