Magehouse_Slider - Version 2.2.0

Version Notes

First Release

Features:

- Customization of slider theme from backend.
- Can use both Images and background color for the slider.
- Can specify whether to include the jQuery or not.

Relase Notes 1.0.2

- Fixed bug : jQuery & jQuery UI not getting included.

Relase Notes 1.0.3

- Fixed bug : Do not Use Images has no effect on frontend.

Relase Notes 1.0.4

- Added : Special Price in filtering

Relase Notes 1.0.5

Bugs Solved :
- Currency symbol do not change - Solved

Improvements:
- Removed theme file dependency

Relase Notes 2.0.0

Bugs Solved :
- Catalog search not working - Solved

Improvements:
- Price Slider now available on search page also

Relase Notes 2.1.0

Improvements:
- AJAX price slider on both category and search pages
- AJAX layered navigation can also be enabled
- AJAX Toolbar can also be enabled

Relase Notes 2.1.1

Bug Fixes : sliderAjax Not found

Relase Notes 2.2.0

Bug Fixes :

- Left blocks disappearing after ajax
- Multicurrency not working
- Overlay height not proper
- Special price not being displayed in the min and max ranges
- Loading screen not disappearing in IE
New Features:

- Multi Currency support
- Text box filtering
- Callback for on slide method
- More theming options

Download this release

Release Info

Developer Mrugesh Mistry
Extension Magehouse_Slider
Version 2.2.0
Comparing to
See all releases


Code changes from version 2.1.1 to 2.2.0

app/code/community/Magehouse/Slider/Block/Ajax.php CHANGED
@@ -20,4 +20,8 @@ class Magehouse_Slider_Block_Ajax extends Mage_Core_Block_Template{
20
  $this->loadingImage = $this->url.'media/magehouse/slider/default/'.$loadingImage;
21
  }
22
  }
 
 
 
 
23
  }
20
  $this->loadingImage = $this->url.'media/magehouse/slider/default/'.$loadingImage;
21
  }
22
  }
23
+
24
+ public function getCallbackJs(){
25
+ return Mage::getStoreConfig('price_slider/ajax_conf/afterAjax');
26
+ }
27
  }
app/code/community/Magehouse/Slider/Block/Catalog/Layer/Filter/Price.php CHANGED
@@ -18,6 +18,15 @@ class Magehouse_Slider_Block_Catalog_Layer_Filter_Price extends Mage_Catalog_Blo
18
  public $_currMaxPrice;
19
  public $_imagePath;
20
 
 
 
 
 
 
 
 
 
 
21
  public function __construct(){
22
 
23
  $this->_currentCategory = Mage::registry('current_category');
@@ -26,11 +35,18 @@ class Magehouse_Slider_Block_Catalog_Layer_Filter_Price extends Mage_Catalog_Blo
26
  $this->setMinPrice();
27
  $this->setMaxPrice();
28
  $this->setCurrentPrices();
29
- $this->_imagePath = $this->getUrl('media/magehouse/slider');
30
 
31
  parent::__construct();
32
  }
33
 
 
 
 
 
 
 
 
34
  public function getSliderStatus(){
35
  if(Mage::getStoreConfig('price_slider/price_slider_settings/slider_loader_active'))
36
  return true;
@@ -38,22 +54,85 @@ class Magehouse_Slider_Block_Catalog_Layer_Filter_Price extends Mage_Catalog_Blo
38
  return false;
39
  }
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  public function getHtml(){
 
42
  if($this->getSliderStatus()){
43
  $text='
44
  <div class="price">
45
- <p>
46
- <input type="text" id="amount" readonly="readonly" style="background:none; border:none;" />
47
- </p>
48
  <div id="slider-range"></div>
49
 
50
- </div>'.$this->getSliderJs().'
51
- ';
52
 
53
  return $text;
54
  }
55
  }
56
 
 
 
 
 
 
57
  public function prepareParams(){
58
  $url="";
59
 
@@ -68,51 +147,188 @@ class Magehouse_Slider_Block_Catalog_Layer_Filter_Price extends Mage_Catalog_Blo
68
  return $url;
69
  }
70
 
 
 
 
 
 
71
  public function getCurrencySymbol(){
72
  return Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
73
  }
74
 
75
- public function getSliderJs(){
76
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  $baseUrl = explode('?',Mage::helper('core/url')->getCurrentUrl());
78
  $baseUrl = $baseUrl[0];
79
- $timeout = $this->getConfig('price_slider/price_slider_conf/timeout');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  $styles = $this->prepareCustomStyles();
81
- if($this->_currMaxPrice > 0){$max = $this->_currMaxPrice;} else{$max = $this->_maxPrice;}
82
- if($this->_currMinPrice > 0){$min = $this->_currMinPrice;} else{$min = $this->_minPrice;}
83
- $sliderAjax = $this->getConfig('price_slider/ajax_conf/slider');
84
- if($sliderAjax){
85
  $ajaxCall = 'sliderAjax(url);';
86
- }else{$ajaxCall = '';}
 
 
 
 
 
 
 
 
 
 
 
87
  $html = '
88
  <script type="text/javascript">
89
  jQuery(function($) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  $( "#slider-range" ).slider({
91
  range: true,
92
- min: '.$this->_minPrice.',
93
- max: '.$this->_maxPrice.',
94
- values: [ '.$min.', '.$max.' ],
95
  slide: function( event, ui ) {
96
- $( "#amount" ).val( "'.$this->getCurrencySymbol().'" + ui.values[ 0 ] + " - '.$this->getCurrencySymbol().'" + ui.values[ 1 ] );
 
 
 
 
 
 
97
  },stop: function( event, ui ) {
98
- var x1 = ui.values[0];
99
- var x2 = ui.values[1];
100
- $( "#amount" ).val( "'.$this->getCurrencySymbol().'"+x1+" - '.$this->getCurrencySymbol().'"+x2 );
101
- var url = "'.$baseUrl.'"+"?min="+x1+"&max="+x2+"'.$this->prepareParams().'";
102
- if(x1 != '.$min.' && x2 != '.$max.'){
 
 
 
 
 
 
 
103
  clearTimeout(timer);
104
  //window.location= url;
105
 
106
  }else{
107
  timer = setTimeout(function(){
108
- //window.location= url;
109
  '.$ajaxCall.'
110
  }, '.$timeout.');
111
  }
112
  }
113
  });
114
- $( "#amount" ).val( "'.$this->getCurrencySymbol().'" + $( "#slider-range" ).slider( "values", 0 ) +
115
- " - '.$this->getCurrencySymbol().'" + $( "#slider-range" ).slider( "values", 1 ) );
 
 
116
  });
117
  </script>
118
 
@@ -122,6 +338,15 @@ class Magehouse_Slider_Block_Catalog_Layer_Filter_Price extends Mage_Catalog_Blo
122
  return $html;
123
  }
124
 
 
 
 
 
 
 
 
 
 
125
  public function prepareCustomStyles(){
126
  $useImage = $this->getConfig('price_slider/price_slider_conf/use_image');
127
 
@@ -167,33 +392,56 @@ class Magehouse_Slider_Block_Catalog_Layer_Filter_Price extends Mage_Catalog_Blo
167
  return $html;
168
  }
169
 
 
 
 
 
 
 
170
  public function getConfig($key){
171
  return Mage::getStoreConfig($key);
172
  }
173
 
 
 
 
 
 
 
174
  public function setMinPrice(){
175
  if( (isset($_GET['q']) && !isset($_GET['min'])) || !isset($_GET['q'])){
176
- $this->_minPrice = $this->_productCollection
177
- ->getFirstItem()
178
- ->getPrice();
179
- $this->_searchSession->setMinPrice($this->_minPrice);
180
-
181
  }else{
182
  $this->_minPrice = $this->_searchSession->getMinPrice();
183
  }
184
  }
185
 
 
 
 
 
 
186
  public function setMaxPrice(){
187
  if( (isset($_GET['q']) && !isset($_GET['max'])) || !isset($_GET['q'])){
188
- $this->_maxPrice = $this->_productCollection
189
- ->getLastItem()
190
- ->getPrice();
191
- $this->_searchSession->setMaxPrice($this->_maxPrice);
192
  }else{
193
  $this->_maxPrice = $this->_searchSession->getMaxPrice();
194
  }
195
  }
196
 
 
 
 
 
 
 
 
 
 
 
 
197
  public function setProductCollection(){
198
 
199
  if($this->_currentCategory){
@@ -205,14 +453,38 @@ class Magehouse_Slider_Block_Catalog_Layer_Filter_Price extends Mage_Catalog_Blo
205
  $this->_productCollection = Mage::getSingleton('catalogsearch/layer')->getProductCollection()
206
  ->addAttributeToSelect('*')
207
  ->setOrder('price', 'ASC');
208
-
209
- }
210
-
211
  }
212
 
 
 
 
 
 
 
213
  public function setCurrentPrices(){
214
 
215
  $this->_currMinPrice = $this->getRequest()->getParam('min');
216
  $this->_currMaxPrice = $this->getRequest()->getParam('max');
217
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  }
18
  public $_currMaxPrice;
19
  public $_imagePath;
20
 
21
+
22
+ /*
23
+ *
24
+ * Set all the required data that our slider will require
25
+ * Set current _currentCategory, _searchSession, setProductCollection, setMinPrice, setMaxPrice, setCurrentPrices, _imagePath
26
+ *
27
+ * @set all required data
28
+ *
29
+ */
30
  public function __construct(){
31
 
32
  $this->_currentCategory = Mage::registry('current_category');
35
  $this->setMinPrice();
36
  $this->setMaxPrice();
37
  $this->setCurrentPrices();
38
+ $this->_imagePath = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'magehouse/slider/';
39
 
40
  parent::__construct();
41
  }
42
 
43
+ /*
44
+ *
45
+ * Check whether the slider is enabled.
46
+ *
47
+ * @return boolean
48
+ *
49
+ */
50
  public function getSliderStatus(){
51
  if(Mage::getStoreConfig('price_slider/price_slider_settings/slider_loader_active'))
52
  return true;
54
  return false;
55
  }
56
 
57
+
58
+ /*
59
+ * Fetch Styles for price text Box
60
+ *
61
+ * @return styles
62
+ */
63
+ public function getPriceBoxStyle(){
64
+ $styles = trim($this->getConfig('price_slider/price_slider_conf/textBoxCss'));
65
+ if($styles == ''){
66
+ $styles = "width:50px; padding:5px; border-radius:5px; ";
67
+ }
68
+ return $styles;
69
+ }
70
+
71
+ public function getGoBtnText(){
72
+ $name = trim($this->getConfig('price_slider/price_slider_conf/goBtnText'));
73
+ if($name == ''){
74
+ $name = "Go";
75
+ }
76
+ return $name;
77
+ }
78
+
79
+ public function getGoBtnStyle(){
80
+ $styles = trim($this->getConfig('price_slider/price_slider_conf/goBtnCss'));
81
+ return $styles;
82
+ }
83
+
84
+ public function isTextBoxEnabled(){
85
+ return $this->getConfig('price_slider/price_slider_conf/textbox');
86
+ }
87
+
88
+
89
+ public function getPriceDisplayType(){
90
+ $textBoxStyle = $this->getPriceBoxStyle();
91
+ $goBtnStyle = $this->getGoBtnStyle();
92
+ if($this->isTextBoxEnabled()){
93
+ $html = '
94
+ <div class="text-box">
95
+ '.$this->getCurrencySymbol().' <input type="text" name="min" id="minPrice" class="priceTextBox" value="'.$this->getCurrMinPrice().'" style="'.$textBoxStyle.'" /> -
96
+ '.$this->getCurrencySymbol().' <input type="text" name="max" id="maxPrice" class="priceTextBox" value="'.$this->getCurrMaxPrice().'" style="'.$textBoxStyle.'" />
97
+ <input type="button" value="'.$this->getGoBtnText().'" name="go" class="go" style="'.$goBtnStyle.'" />
98
+ <input type="hidden" id="amount" readonly="readonly" style="background:none; border:none;" value="'.$this->getCurrencySymbol().$this->getCurrMinPrice()." - ".$this->getCurrencySymbol().$this->getCurrMaxPrice().'" />
99
+
100
+ </div>';
101
+ }else{
102
+ $html = '<p>
103
+ <input type="text" id="amount" readonly="readonly" style="background:none; border:none;" value="'.$this->getCurrencySymbol().$this->getCurrMinPrice()." - ".$this->getCurrencySymbol().$this->getCurrMaxPrice().'" />
104
+ </p>';
105
+ }
106
+ return $html;
107
+ }
108
+
109
+ /**
110
+ *
111
+ * Prepare html for slider and add JS that incorporates the slider.
112
+ *
113
+ * @return html
114
+ *
115
+ */
116
+
117
  public function getHtml(){
118
+
119
  if($this->getSliderStatus()){
120
  $text='
121
  <div class="price">
122
+ '.$this->getPriceDisplayType().'
 
 
123
  <div id="slider-range"></div>
124
 
125
+ </div>'.$this->getSliderJs();
 
126
 
127
  return $text;
128
  }
129
  }
130
 
131
+ /*
132
+ * Prepare query string that was in the original url
133
+ *
134
+ * @return queryString
135
+ */
136
  public function prepareParams(){
137
  $url="";
138
 
147
  return $url;
148
  }
149
 
150
+ /*
151
+ * Fetch Current Currency symbol
152
+ *
153
+ * @return currency
154
+ */
155
  public function getCurrencySymbol(){
156
  return Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
157
  }
158
 
159
+ /*
160
+ * Fetch Current Minimum Price
161
+ *
162
+ * @return price
163
+ */
164
+ public function getCurrMinPrice(){
165
+ if($this->_currMinPrice > 0){
166
+ $min = $this->_currMinPrice;
167
+ } else{
168
+ $min = $this->_minPrice;
169
+ }
170
+ return $min;
171
+ }
172
+
173
+ /*
174
+ * Fetch Current Maximum Price
175
+ *
176
+ * @return price
177
+ */
178
+ public function getCurrMaxPrice(){
179
+ if($this->_currMaxPrice > 0){
180
+ $max = $this->_currMaxPrice;
181
+ } else{
182
+ $max = $this->_maxPrice;
183
+ }
184
+ return $max;
185
+ }
186
+
187
+ /*
188
+ * Get Slider Configuration TimeOut
189
+ *
190
+ * @return timeout
191
+ */
192
+ public function getConfigTimeOut(){
193
+ return $this->getConfig('price_slider/price_slider_conf/timeout');
194
+ }
195
+
196
+
197
+ /*
198
+ * Gives you the current url without parameters
199
+ *
200
+ * @return url
201
+ */
202
+ public function getCurrentUrlWithoutParams(){
203
  $baseUrl = explode('?',Mage::helper('core/url')->getCurrentUrl());
204
  $baseUrl = $baseUrl[0];
205
+ return $baseUrl;
206
+ }
207
+
208
+ /*
209
+ * Check slider Ajax enabled
210
+ *
211
+ * @return boolean
212
+ */
213
+ public function isAjaxSliderEnabled(){
214
+ return $this->getConfig('price_slider/ajax_conf/slider');
215
+ }
216
+
217
+
218
+ public function getOnSlideCallbacks(){
219
+ return $this->getConfig('price_slider/price_slider_conf/onSlide');
220
+ }
221
+
222
+ /*
223
+ * Get JS that brings the slider in Action
224
+ *
225
+ * @return JavaScript
226
+ */
227
+ public function getSliderJs(){
228
+
229
+ $baseUrl = $this->getCurrentUrlWithoutParams();
230
+ $timeout = $this->getConfigTimeOut();
231
  $styles = $this->prepareCustomStyles();
232
+
233
+ if($this->isAjaxSliderEnabled()){
 
 
234
  $ajaxCall = 'sliderAjax(url);';
235
+ }else{
236
+ $ajaxCall = 'window.location=url;';
237
+ }
238
+
239
+ if($this->isTextBoxEnabled()){
240
+ $updateTextBoxPriceJs = '
241
+ // Update TextBox Price
242
+ $("#minPrice").val(newMinPrice);
243
+ $("#maxPrice").val(newMaxPrice);';
244
+ }
245
+
246
+
247
  $html = '
248
  <script type="text/javascript">
249
  jQuery(function($) {
250
+ var newMinPrice, newMaxPrice, url, temp;
251
+ var categoryMinPrice = '.$this->_minPrice.';
252
+ var categoryMaxPrice = '.$this->_maxPrice.';
253
+ function isNumber(n) {
254
+ return !isNaN(parseFloat(n)) && isFinite(n);
255
+ }
256
+
257
+ $(".priceTextBox").focus(function(){
258
+ temp = $(this).val();
259
+ });
260
+
261
+ $(".priceTextBox").keyup(function(){
262
+ var value = $(this).val();
263
+ if(!isNumber(value)){
264
+ $(this).val(temp);
265
+ }
266
+ });
267
+
268
+ $(".priceTextBox").keypress(function(e){
269
+ if(e.keyCode == 13){
270
+ var value = $(this).val();
271
+ if(value < categoryMinPrice || value > categoryMaxPrice){
272
+ $(this).val(temp);
273
+ }
274
+ url = getUrl($("#minPrice").val(), $("#maxPrice").val());
275
+ '.$ajaxCall.'
276
+ }
277
+ });
278
+
279
+ $(".priceTextBox").blur(function(){
280
+ var value = $(this).val();
281
+ if(value < categoryMinPrice || value > categoryMaxPrice){
282
+ $(this).val(temp);
283
+ }
284
+
285
+ });
286
+
287
+ $(".go").click(function(){
288
+ url = getUrl($("#minPrice").val(), $("#maxPrice").val());
289
+ '.$ajaxCall.'
290
+ });
291
+
292
  $( "#slider-range" ).slider({
293
  range: true,
294
+ min: categoryMinPrice,
295
+ max: categoryMaxPrice,
296
+ values: [ '.$this->getCurrMinPrice().', '.$this->getCurrMaxPrice().' ],
297
  slide: function( event, ui ) {
298
+ newMinPrice = ui.values[0];
299
+ newMaxPrice = ui.values[1];
300
+
301
+ $( "#amount" ).val( "'.$this->getCurrencySymbol().'" + newMinPrice + " - '.$this->getCurrencySymbol().'" + newMaxPrice );
302
+
303
+ '.$updateTextBoxPriceJs.'
304
+
305
  },stop: function( event, ui ) {
306
+
307
+ // Current Min and Max Price
308
+ var newMinPrice = ui.values[0];
309
+ var newMaxPrice = ui.values[1];
310
+
311
+ // Update Text Price
312
+ $( "#amount" ).val( "'.$this->getCurrencySymbol().'"+newMinPrice+" - '.$this->getCurrencySymbol().'"+newMaxPrice );
313
+
314
+ '.$updateTextBoxPriceJs.'
315
+
316
+ url = getUrl(newMinPrice,newMaxPrice);
317
+ if(newMinPrice != '.$this->getCurrMinPrice().' && newMaxPrice != '.$this->getCurrMaxPrice().'){
318
  clearTimeout(timer);
319
  //window.location= url;
320
 
321
  }else{
322
  timer = setTimeout(function(){
 
323
  '.$ajaxCall.'
324
  }, '.$timeout.');
325
  }
326
  }
327
  });
328
+
329
+ function getUrl(newMinPrice, newMaxPrice){
330
+ return "'.$baseUrl.'"+"?min="+newMinPrice+"&max="+newMaxPrice+"'.$this->prepareParams().'";
331
+ }
332
  });
333
  </script>
334
 
338
  return $html;
339
  }
340
 
341
+
342
+ /*
343
+ *
344
+ * Prepare custom slider styles as per user configuration
345
+ *
346
+ * @return style/css
347
+ *
348
+ */
349
+
350
  public function prepareCustomStyles(){
351
  $useImage = $this->getConfig('price_slider/price_slider_conf/use_image');
352
 
392
  return $html;
393
  }
394
 
395
+
396
+ /*
397
+ * Get the Slider config
398
+ *
399
+ * @return object
400
+ */
401
  public function getConfig($key){
402
  return Mage::getStoreConfig($key);
403
  }
404
 
405
+
406
+ /*
407
+ * Set the Actual Min Price of the search and catalog collection
408
+ *
409
+ * @use category | search collection
410
+ */
411
  public function setMinPrice(){
412
  if( (isset($_GET['q']) && !isset($_GET['min'])) || !isset($_GET['q'])){
413
+ $this->_minPrice = $this->_productCollection->getMinPrice();
414
+ $this->_searchSession->setMinPrice($this->_minPrice);
 
 
 
415
  }else{
416
  $this->_minPrice = $this->_searchSession->getMinPrice();
417
  }
418
  }
419
 
420
+ /*
421
+ * Set the Actual Max Price of the search and catalog collection
422
+ *
423
+ * @use category | search collection
424
+ */
425
  public function setMaxPrice(){
426
  if( (isset($_GET['q']) && !isset($_GET['max'])) || !isset($_GET['q'])){
427
+ $this->_maxPrice = $this->_productCollection->getMaxPrice();
428
+ $this->_searchSession->setMaxPrice($this->_maxPrice);
 
 
429
  }else{
430
  $this->_maxPrice = $this->_searchSession->getMaxPrice();
431
  }
432
  }
433
 
434
+ /*
435
+ * Set the Product collection based on the page server to user
436
+ * Might be a category or search page
437
+ *
438
+ * @set /*
439
+ * Set the Product collection based on the page server to user
440
+ * Might be a category or search page
441
+ *
442
+ * @set Mage_Catalogsearch_Model_Layer
443
+ * @set Mage_Catalog_Model_Layer
444
+ */
445
  public function setProductCollection(){
446
 
447
  if($this->_currentCategory){
453
  $this->_productCollection = Mage::getSingleton('catalogsearch/layer')->getProductCollection()
454
  ->addAttributeToSelect('*')
455
  ->setOrder('price', 'ASC');
456
+ }
 
 
457
  }
458
 
459
+
460
+ /*
461
+ * Set Current Max and Min Prices choosed by the user
462
+ *
463
+ * @set price
464
+ */
465
  public function setCurrentPrices(){
466
 
467
  $this->_currMinPrice = $this->getRequest()->getParam('min');
468
  $this->_currMaxPrice = $this->getRequest()->getParam('max');
469
  }
470
+
471
+ /*
472
+ * Set Current Max and Min Prices choosed by the user
473
+ *
474
+ * @set price
475
+ */
476
+ public function baseToCurrent($srcPrice){
477
+ $store = $this->getStore();
478
+ return $store->convertPrice($srcPrice, false, false);
479
+ }
480
+
481
+
482
+ /*
483
+ * Retrive store object
484
+ *
485
+ * @return object
486
+ */
487
+ public function getStore(){
488
+ return Mage::app()->getStore();
489
+ }
490
  }
app/code/community/Magehouse/Slider/Model/Catalog/Layer.php CHANGED
@@ -1,41 +1,21 @@
1
  <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category Mage
22
- * @package Mage_Catalog
23
- * @copyright Copyright (c) 2011 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
- */
26
-
27
 
28
  /**
29
  * Catalog view layer model
30
  *
31
  * @category Mage
32
  * @package Mage_Catalog
33
- * @author Magento Core Team <core@magentocommerce.com>
34
  */
35
  class Magehouse_Slider_Model_Catalog_Layer extends Mage_Catalog_Model_Layer
36
  {
37
 
38
 
 
 
 
 
 
39
  public function getProductCollection()
40
  {
41
  if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
@@ -46,23 +26,36 @@ class Magehouse_Slider_Model_Catalog_Layer extends Mage_Catalog_Model_Layer
46
  $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
47
  }
48
 
49
- /*PRICE SLIDER FILTER*/
50
- $max=$_GET['max'];
51
- $min=$_GET['min'];
52
-
53
- //print_r($collection->getData());
54
 
55
  if($min && $max){
56
- //$collection= $collection->addAttributeToFilter('price',array('from'=>$min, 'to'=>$max));
57
  $collection->getSelect()->where(' final_price >= "'.$min.'" AND final_price <= "'.$max.'" ');
58
-
59
- //echo $collection->getSelect();exit;
60
  }
61
 
62
- /*PRICE SLIDER FILTER*/
63
-
64
  return $collection;
65
  }
66
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
 
68
  }
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  /**
4
  * Catalog view layer model
5
  *
6
  * @category Mage
7
  * @package Mage_Catalog
8
+ * @author Mrugesh Mistry <support@magehouse.com>
9
  */
10
  class Magehouse_Slider_Model_Catalog_Layer extends Mage_Catalog_Model_Layer
11
  {
12
 
13
 
14
+ /*
15
+ * Add Filter in product Collection for new price
16
+ *
17
+ * @return object
18
+ */
19
  public function getProductCollection()
20
  {
21
  if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
26
  $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
27
  }
28
 
29
+ $this->currentRate = $collection->getCurrencyRate();
30
+ $max=$this->getMaxPriceFilter();
31
+ $min=$this->getMinPriceFilter();
 
 
32
 
33
  if($min && $max){
 
34
  $collection->getSelect()->where(' final_price >= "'.$min.'" AND final_price <= "'.$max.'" ');
 
 
35
  }
36
 
 
 
37
  return $collection;
38
  }
39
+
40
+
41
+ /*
42
+ * convert Price as per currency
43
+ *
44
+ * @return currency
45
+ */
46
+ public function getMaxPriceFilter(){
47
+ return round($_GET['max']/$this->currentRate);
48
+ }
49
+
50
+
51
+ /*
52
+ * Convert Min Price to current currency
53
+ *
54
+ * @return currency
55
+ */
56
+ public function getMinPriceFilter(){
57
+ return round($_GET['min']/$this->currentRate);
58
+ }
59
 
60
+
61
  }
app/code/community/Magehouse/Slider/Model/Catalogsearch/Layer.php CHANGED
@@ -26,26 +26,6 @@
26
 
27
  class Magehouse_Slider_Model_Catalogsearch_Layer extends Mage_CatalogSearch_Model_Layer
28
  {
29
- const XML_PATH_DISPLAY_LAYER_COUNT = 'catalog/search/use_layered_navigation_count';
30
-
31
- /**
32
- * Get current layer product collection
33
- *
34
- * @return Mage_Catalog_Model_Resource_Eav_Resource_Product_Collection
35
- */
36
- public function getProductCollection()
37
- {
38
- if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
39
- $collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
40
- } else {
41
- $collection = Mage::getResourceModel('catalogsearch/fulltext_collection');
42
- $this->prepareProductCollection($collection);
43
-
44
- $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
45
- }
46
- return $collection;
47
- }
48
-
49
  /**
50
  * Prepare product collection
51
  *
@@ -67,9 +47,9 @@ class Magehouse_Slider_Model_Catalogsearch_Layer extends Mage_CatalogSearch_Mode
67
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
68
  Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
69
 
70
- /*PRICE SLIDER FILTER*/
71
- $max=$_GET['max'];
72
- $min=$_GET['min'];
73
 
74
  //print_r($collection->getData());
75
 
@@ -81,15 +61,26 @@ class Magehouse_Slider_Model_Catalogsearch_Layer extends Mage_CatalogSearch_Mode
81
  }
82
 
83
  /*PRICE SLIDER FILTER*/
84
-
85
-
86
-
87
  return $this;
88
  }
89
 
 
 
 
 
 
 
 
 
90
 
91
 
92
-
93
-
94
-
95
- }
 
 
 
 
 
 
26
 
27
  class Magehouse_Slider_Model_Catalogsearch_Layer extends Mage_CatalogSearch_Model_Layer
28
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  /**
30
  * Prepare product collection
31
  *
47
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
48
  Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
49
 
50
+ $this->currentRate = $collection->getCurrencyRate();
51
+ $max=$this->getMaxPriceFilter();
52
+ $min=$this->getMinPriceFilter();
53
 
54
  //print_r($collection->getData());
55
 
61
  }
62
 
63
  /*PRICE SLIDER FILTER*/
 
 
 
64
  return $this;
65
  }
66
 
67
+ /*
68
+ * convert Price as per currency
69
+ *
70
+ * @return currency
71
+ */
72
+ public function getMaxPriceFilter(){
73
+ return round($_GET['max']/$this->currentRate);
74
+ }
75
 
76
 
77
+ /*
78
+ * Convert Min Price to current currency
79
+ *
80
+ * @return currency
81
+ */
82
+ public function getMinPriceFilter(){
83
+ return round($_GET['min']/$this->currentRate);
84
+ }
85
+
86
+ }
app/code/community/Magehouse/Slider/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Magehouse_Slider>
5
- <version>2.1.0</version>
6
  </Magehouse_Slider>
7
  </modules>
8
  <global>
@@ -99,6 +99,7 @@
99
  <handle_height>18</handle_height>
100
  <slider_width>auto</slider_width>
101
  <slider_height>7</slider_height>
 
102
  </price_slider_conf>
103
  <ajax_conf>
104
  <overlay_color>#000000</overlay_color>
2
  <config>
3
  <modules>
4
  <Magehouse_Slider>
5
+ <version>2.2.0</version>
6
  </Magehouse_Slider>
7
  </modules>
8
  <global>
99
  <handle_height>18</handle_height>
100
  <slider_width>auto</slider_width>
101
  <slider_height>7</slider_height>
102
+ <textBoxCss>border:solid 1px #ccc; color:#555; padding:3px; width:50px; margin-bottom:10px;</textBoxCss>
103
  </price_slider_conf>
104
  <ajax_conf>
105
  <overlay_color>#000000</overlay_color>
app/code/community/Magehouse/Slider/etc/system.xml CHANGED
@@ -42,7 +42,8 @@
42
  <show_in_default>1</show_in_default>
43
  <show_in_website>1</show_in_website>
44
  <show_in_store>1</show_in_store>
45
- <comment>Set this to yes if you have not included jQuery in the website.</comment>
 
46
  </include_jquery>
47
  <include_jquery_ui translate="label">
48
  <label>Include Jquery UI</label>
@@ -64,14 +65,14 @@
64
  <show_in_website>1</show_in_website>
65
  <show_in_store>1</show_in_store>
66
  <fields>
67
- <timeout><!-- Make up a field key -->
68
  <label>Timeout</label>
69
  <frontend_type>text</frontend_type>
70
  <sort_order>9</sort_order>
71
  <show_in_default>1</show_in_default>
72
  <show_in_website>1</show_in_website>
73
  <show_in_store>1</show_in_store>
74
- <comment>Set this in milliseconds. It refers to the time to await for user's action on the other handle after changing the first. if the user does not change the other range within specified time, the selected settings will be applied.</comment>
75
  </timeout>
76
  <use_image translate="label">
77
  <label>Use Image</label>
@@ -96,7 +97,7 @@
96
  <show_in_default>1</show_in_default>
97
  <show_in_website>1</show_in_website>
98
  <show_in_store>1</show_in_store>
99
- <value>1.jpg</value>
100
  </handle_image>
101
  <background_image><!-- Make up a field key -->
102
  <label>Background Image</label>
@@ -131,7 +132,7 @@
131
  <show_in_default>1</show_in_default>
132
  <show_in_website>1</show_in_website>
133
  <show_in_store>1</show_in_store>
134
- <comment>Background color for the handles.</comment>
135
  </handle_color>
136
  <background_color><!-- Make up a field key -->
137
  <label>Background Color</label>
@@ -140,7 +141,7 @@
140
  <show_in_default>1</show_in_default>
141
  <show_in_website>1</show_in_website>
142
  <show_in_store>1</show_in_store>
143
- <comment>Background color for the inactive range.</comment>
144
  </background_color>
145
  <range_color><!-- Make up a field key -->
146
  <label>Active Range Background Color</label>
@@ -149,28 +150,26 @@
149
  <show_in_default>1</show_in_default>
150
  <show_in_website>1</show_in_website>
151
  <show_in_store>1</show_in_store>
152
- <comment>Background color for the selected range.</comment>
153
  </range_color>
154
-
155
- <handle_width><!-- Make up a field key -->
156
  <label>Handle width</label>
157
  <frontend_type>text</frontend_type>
158
  <sort_order>80</sort_order>
159
  <show_in_default>1</show_in_default>
160
  <show_in_website>1</show_in_website>
161
  <show_in_store>1</show_in_store>
162
- <comment>Width of the handle "px". Its the width of the image that you are using for the handle.</comment>
163
  </handle_width>
164
- <handle_height><!-- Make up a field key -->
165
  <label>Handle Height</label>
166
  <frontend_type>text</frontend_type>
167
  <sort_order>90</sort_order>
168
  <show_in_default>1</show_in_default>
169
  <show_in_website>1</show_in_website>
170
  <show_in_store>1</show_in_store>
171
- <comment>Hight of the handle in "px". Its the height of the image that you are using for the handle.</comment>
172
  </handle_height>
173
-
174
  <slider_width><!-- Make up a field key -->
175
  <label>Width</label>
176
  <frontend_type>text</frontend_type>
@@ -178,32 +177,76 @@
178
  <show_in_default>1</show_in_default>
179
  <show_in_website>1</show_in_website>
180
  <show_in_store>1</show_in_store>
181
- <comment>Width of the slider in "px". "auto" for ayto width.</comment>
182
  </slider_width>
183
- <slider_height><!-- Make up a field key -->
184
  <label>Height</label>
185
  <frontend_type>text</frontend_type>
186
  <sort_order>110</sort_order>
187
  <show_in_default>1</show_in_default>
188
  <show_in_website>1</show_in_website>
189
  <show_in_store>1</show_in_store>
190
- <comment>Height of the slider in "px". </comment>
191
  </slider_height>
192
-
193
- <amount_style><!-- Make up a field key -->
194
  <label>Amount style</label>
195
  <frontend_type>textarea</frontend_type>
196
  <sort_order>120</sort_order>
197
  <show_in_default>1</show_in_default>
198
  <show_in_website>1</show_in_website>
199
  <show_in_store>1</show_in_store>
200
- <comment>This applies to the price that appears above slider.</comment>
201
  </amount_style>
202
-
203
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  </fields>
205
  </price_slider_conf>
206
- <ajax_conf translate="label">
207
  <label>AJAX Configuration</label>
208
  <frontend_type>text</frontend_type>
209
  <sort_order>30</sort_order>
@@ -211,55 +254,67 @@
211
  <show_in_website>1</show_in_website>
212
  <show_in_store>1</show_in_store>
213
  <fields>
214
- <layered><!-- Make up a field key -->
215
  <label>Enable AJAX for layered navigation?</label>
216
- <frontend_type>select</frontend_type>
217
  <source_model>adminhtml/system_config_source_yesno</source_model>
218
  <sort_order>10</sort_order>
219
  <show_in_default>1</show_in_default>
220
  <show_in_website>1</show_in_website>
221
  <show_in_store>1</show_in_store>
222
- <comment>Set it to Yes for applying AJAX on layered navigation, NO will remove AJAX</comment>
223
  </layered>
224
- <slider><!-- Make up a field key -->
225
  <label>Enable AJAX only for Price Slider?</label>
226
- <frontend_type>select</frontend_type>
227
  <source_model>adminhtml/system_config_source_yesno</source_model>
228
  <sort_order>11</sort_order>
229
  <show_in_default>1</show_in_default>
230
  <show_in_website>1</show_in_website>
231
  <show_in_store>1</show_in_store>
232
- <comment>Set it to Yes for applying AJAX on layered navigation, NO will remove AJAX</comment>
233
  </slider>
234
- <toolbar><!-- Make up a field key -->
235
- <label>Enable AJAX for product Toolbar?</label>
236
- <frontend_type>select</frontend_type>
237
- <source_model>adminhtml/system_config_source_yesno</source_model>
238
- <sort_order>12</sort_order>
 
 
 
 
 
 
 
 
 
 
239
  <show_in_default>1</show_in_default>
240
  <show_in_website>1</show_in_website>
241
  <show_in_store>1</show_in_store>
242
- <comment>Set it to Yes for applying AJAX on entire toolbar , NO will remove AJAX</comment>
243
- </toolbar>
244
- <overlay_color><!-- Make up a field key -->
 
 
245
  <label>Ajax Overlay color</label>
246
  <frontend_type>text</frontend_type>
247
  <sort_order>20</sort_order>
248
  <show_in_default>1</show_in_default>
249
  <show_in_website>1</show_in_website>
250
  <show_in_store>1</show_in_store>
251
- <comment>Color for the AJAX Overlay </comment>
252
  </overlay_color>
253
- <overlay_opacity><!-- Make up a field key -->
254
  <label>Ajax Overlay opacity</label>
255
  <frontend_type>text</frontend_type>
256
  <sort_order>20</sort_order>
257
  <show_in_default>1</show_in_default>
258
  <show_in_website>1</show_in_website>
259
  <show_in_store>1</show_in_store>
260
- <comment>Opacity for the AJAX Overlay </comment>
261
  </overlay_opacity>
262
- <loading_image><!-- Make up a field key -->
263
  <label>Loading Image</label>
264
  <frontend_type>image</frontend_type>
265
  <backend_model>adminhtml/system_config_backend_image</backend_model>
@@ -271,27 +326,26 @@
271
  <show_in_default>1</show_in_default>
272
  <show_in_website>1</show_in_website>
273
  <show_in_store>1</show_in_store>
274
- <comment>Image to show while the results are loading</comment>
275
  </loading_image>
276
- <loading_text><!-- Make up a field key -->
277
  <label>Results Loading Text</label>
278
  <frontend_type>text</frontend_type>
279
  <sort_order>40</sort_order>
280
  <show_in_default>1</show_in_default>
281
  <show_in_website>1</show_in_website>
282
  <show_in_store>1</show_in_store>
283
- <comment>Text to display when the results are loading via AJAX</comment>
284
  </loading_text>
285
- <loading_text_color><!-- Make up a field key -->
286
  <label>Results Loading Text Color</label>
287
  <frontend_type>text</frontend_type>
288
  <sort_order>40</sort_order>
289
  <show_in_default>1</show_in_default>
290
  <show_in_website>1</show_in_website>
291
  <show_in_store>1</show_in_store>
292
- <comment>Color for text to display when the results are loading via AJAX</comment>
293
  </loading_text_color>
294
-
295
  </fields>
296
  </ajax_conf>
297
  </groups>
42
  <show_in_default>1</show_in_default>
43
  <show_in_website>1</show_in_website>
44
  <show_in_store>1</show_in_store>
45
+ <comment>Includes jQuery with noConflict Mode, to avoid conflicts with prototype library.</comment>
46
+ <tooltip>Set this to yes if you have not included jQuery in the website.</tooltip>
47
  </include_jquery>
48
  <include_jquery_ui translate="label">
49
  <label>Include Jquery UI</label>
65
  <show_in_website>1</show_in_website>
66
  <show_in_store>1</show_in_store>
67
  <fields>
68
+ <timeout><!-- Make up a field key -->
69
  <label>Timeout</label>
70
  <frontend_type>text</frontend_type>
71
  <sort_order>9</sort_order>
72
  <show_in_default>1</show_in_default>
73
  <show_in_website>1</show_in_website>
74
  <show_in_store>1</show_in_store>
75
+ <comment>Set this in milliseconds. It refers to the time to await for user's action on the other handle after changing the first. if the user does not change the other range within specified time, the selected settings will be applied.</comment>
76
  </timeout>
77
  <use_image translate="label">
78
  <label>Use Image</label>
97
  <show_in_default>1</show_in_default>
98
  <show_in_website>1</show_in_website>
99
  <show_in_store>1</show_in_store>
100
+ <value>1.jpg</value>
101
  </handle_image>
102
  <background_image><!-- Make up a field key -->
103
  <label>Background Image</label>
132
  <show_in_default>1</show_in_default>
133
  <show_in_website>1</show_in_website>
134
  <show_in_store>1</show_in_store>
135
+ <comment>Background color for the handles.</comment>
136
  </handle_color>
137
  <background_color><!-- Make up a field key -->
138
  <label>Background Color</label>
141
  <show_in_default>1</show_in_default>
142
  <show_in_website>1</show_in_website>
143
  <show_in_store>1</show_in_store>
144
+ <comment>Background color for the inactive range.</comment>
145
  </background_color>
146
  <range_color><!-- Make up a field key -->
147
  <label>Active Range Background Color</label>
150
  <show_in_default>1</show_in_default>
151
  <show_in_website>1</show_in_website>
152
  <show_in_store>1</show_in_store>
153
+ <comment>Background color for the selected range.</comment>
154
  </range_color>
155
+ <handle_width><!-- Make up a field key -->
 
156
  <label>Handle width</label>
157
  <frontend_type>text</frontend_type>
158
  <sort_order>80</sort_order>
159
  <show_in_default>1</show_in_default>
160
  <show_in_website>1</show_in_website>
161
  <show_in_store>1</show_in_store>
162
+ <comment>Width of the handle "px". Its the width of the image that you are using for the handle.</comment>
163
  </handle_width>
164
+ <handle_height><!-- Make up a field key -->
165
  <label>Handle Height</label>
166
  <frontend_type>text</frontend_type>
167
  <sort_order>90</sort_order>
168
  <show_in_default>1</show_in_default>
169
  <show_in_website>1</show_in_website>
170
  <show_in_store>1</show_in_store>
171
+ <comment>Hight of the handle in "px". Its the height of the image that you are using for the handle.</comment>
172
  </handle_height>
 
173
  <slider_width><!-- Make up a field key -->
174
  <label>Width</label>
175
  <frontend_type>text</frontend_type>
177
  <show_in_default>1</show_in_default>
178
  <show_in_website>1</show_in_website>
179
  <show_in_store>1</show_in_store>
180
+ <comment>Width of the slider in "px". "auto" for ayto width.</comment>
181
  </slider_width>
182
+ <slider_height><!-- Make up a field key -->
183
  <label>Height</label>
184
  <frontend_type>text</frontend_type>
185
  <sort_order>110</sort_order>
186
  <show_in_default>1</show_in_default>
187
  <show_in_website>1</show_in_website>
188
  <show_in_store>1</show_in_store>
189
+ <comment>Height of the slider in "px".</comment>
190
  </slider_height>
191
+ <amount_style><!-- Make up a field key -->
 
192
  <label>Amount style</label>
193
  <frontend_type>textarea</frontend_type>
194
  <sort_order>120</sort_order>
195
  <show_in_default>1</show_in_default>
196
  <show_in_website>1</show_in_website>
197
  <show_in_store>1</show_in_store>
198
+ <comment>This applies to the price that appears above slider.</comment>
199
  </amount_style>
200
+ <textbox><!-- Make up a field key -->
201
+ <label>Use textbox for amount?</label>
202
+ <frontend_type>select</frontend_type>
203
+ <source_model>adminhtml/system_config_source_yesno</source_model>
204
+ <sort_order>130</sort_order>
205
+ <show_in_default>1</show_in_default>
206
+ <show_in_website>1</show_in_website>
207
+ <show_in_store>1</show_in_store>
208
+ <comment>Set it to Yes for applying textbox for amount, NO will use the labels for amount</comment>
209
+ </textbox>
210
+ <textBoxCss><!-- Make up a field key -->
211
+ <label>Amount text-box style</label>
212
+ <frontend_type>textarea</frontend_type>
213
+ <sort_order>140</sort_order>
214
+ <show_in_default>1</show_in_default>
215
+ <show_in_website>1</show_in_website>
216
+ <show_in_store>1</show_in_store>
217
+ <comment>This applies to the text boxes for amount.</comment>
218
+ </textBoxCss>
219
+ <goBtnText><!-- Make up a field key -->
220
+ <label>Name for your GO button .</label>
221
+ <frontend_type>text</frontend_type>
222
+ <sort_order>141</sort_order>
223
+ <show_in_default>1</show_in_default>
224
+ <show_in_website>1</show_in_website>
225
+ <show_in_store>1</show_in_store>
226
+ <comment>This applies to the Go button for amount. By Default nameis "Go"</comment>
227
+ </goBtnText>
228
+ <goBtnCss><!-- Make up a field key -->
229
+ <label>Style your GO button here.</label>
230
+ <frontend_type>textarea</frontend_type>
231
+ <sort_order>142</sort_order>
232
+ <show_in_default>1</show_in_default>
233
+ <show_in_website>1</show_in_website>
234
+ <show_in_store>1</show_in_store>
235
+ <comment>This applies to the Go button for amount.</comment>
236
+ </goBtnCss>
237
+ <onSlide><!-- Make up a field key -->
238
+ <label>OnSlide Call Back JavaScript</label>
239
+ <frontend_type>textarea</frontend_type>
240
+ <sort_order>150</sort_order>
241
+ <show_in_default>1</show_in_default>
242
+ <show_in_website>1</show_in_website>
243
+ <show_in_store>1</show_in_store>
244
+ <comment>Callback Javascript when you slide the handle.</comment>
245
+ <tooltip>This JS will be called when you slide the handle of your slider.</tooltip>
246
+ </onSlide>
247
  </fields>
248
  </price_slider_conf>
249
+ <ajax_conf translate="label">
250
  <label>AJAX Configuration</label>
251
  <frontend_type>text</frontend_type>
252
  <sort_order>30</sort_order>
254
  <show_in_website>1</show_in_website>
255
  <show_in_store>1</show_in_store>
256
  <fields>
257
+ <layered><!-- Make up a field key -->
258
  <label>Enable AJAX for layered navigation?</label>
259
+ <frontend_type>select</frontend_type>
260
  <source_model>adminhtml/system_config_source_yesno</source_model>
261
  <sort_order>10</sort_order>
262
  <show_in_default>1</show_in_default>
263
  <show_in_website>1</show_in_website>
264
  <show_in_store>1</show_in_store>
265
+ <comment>Set it to Yes for applying AJAX on layered navigation, NO will remove AJAX</comment>
266
  </layered>
267
+ <slider><!-- Make up a field key -->
268
  <label>Enable AJAX only for Price Slider?</label>
269
+ <frontend_type>select</frontend_type>
270
  <source_model>adminhtml/system_config_source_yesno</source_model>
271
  <sort_order>11</sort_order>
272
  <show_in_default>1</show_in_default>
273
  <show_in_website>1</show_in_website>
274
  <show_in_store>1</show_in_store>
275
+ <comment>Set it to Yes for applying AJAX on layered navigation, NO will remove AJAX</comment>
276
  </slider>
277
+ <toolbar><!-- Make up a field key -->
278
+ <label>Enable AJAX for product Toolbar?</label>
279
+ <frontend_type>select</frontend_type>
280
+ <source_model>adminhtml/system_config_source_yesno</source_model>
281
+ <sort_order>12</sort_order>
282
+ <show_in_default>1</show_in_default>
283
+ <show_in_website>1</show_in_website>
284
+ <show_in_store>1</show_in_store>
285
+ <comment>Set it to Yes for applying AJAX on entire toolbar , NO will remove AJAX</comment>
286
+ </toolbar>
287
+
288
+ <afterAjax><!-- Make up a field key -->
289
+ <label>After Ajax Call Back JavaScript</label>
290
+ <frontend_type>textarea</frontend_type>
291
+ <sort_order>150</sort_order>
292
  <show_in_default>1</show_in_default>
293
  <show_in_website>1</show_in_website>
294
  <show_in_store>1</show_in_store>
295
+ <comment>Callback Javascript after AJAX call for all the above entities.</comment>
296
+ <tooltip>This JS will be called after the ajax request is completed.</tooltip>
297
+ </afterAjax>
298
+
299
+ <overlay_color><!-- Make up a field key -->
300
  <label>Ajax Overlay color</label>
301
  <frontend_type>text</frontend_type>
302
  <sort_order>20</sort_order>
303
  <show_in_default>1</show_in_default>
304
  <show_in_website>1</show_in_website>
305
  <show_in_store>1</show_in_store>
306
+ <comment>Color for the AJAX Overlay</comment>
307
  </overlay_color>
308
+ <overlay_opacity><!-- Make up a field key -->
309
  <label>Ajax Overlay opacity</label>
310
  <frontend_type>text</frontend_type>
311
  <sort_order>20</sort_order>
312
  <show_in_default>1</show_in_default>
313
  <show_in_website>1</show_in_website>
314
  <show_in_store>1</show_in_store>
315
+ <comment>Opacity for the AJAX Overlay</comment>
316
  </overlay_opacity>
317
+ <loading_image><!-- Make up a field key -->
318
  <label>Loading Image</label>
319
  <frontend_type>image</frontend_type>
320
  <backend_model>adminhtml/system_config_backend_image</backend_model>
326
  <show_in_default>1</show_in_default>
327
  <show_in_website>1</show_in_website>
328
  <show_in_store>1</show_in_store>
329
+ <comment>Image to show while the results are loading</comment>
330
  </loading_image>
331
+ <loading_text><!-- Make up a field key -->
332
  <label>Results Loading Text</label>
333
  <frontend_type>text</frontend_type>
334
  <sort_order>40</sort_order>
335
  <show_in_default>1</show_in_default>
336
  <show_in_website>1</show_in_website>
337
  <show_in_store>1</show_in_store>
338
+ <comment>Text to display when the results are loading via AJAX</comment>
339
  </loading_text>
340
+ <loading_text_color><!-- Make up a field key -->
341
  <label>Results Loading Text Color</label>
342
  <frontend_type>text</frontend_type>
343
  <sort_order>40</sort_order>
344
  <show_in_default>1</show_in_default>
345
  <show_in_website>1</show_in_website>
346
  <show_in_store>1</show_in_store>
347
+ <comment>Color for text to display when the results are loading via AJAX</comment>
348
  </loading_text_color>
 
349
  </fields>
350
  </ajax_conf>
351
  </groups>
app/design/frontend/base/default/layout/slider.xml CHANGED
@@ -8,7 +8,7 @@
8
  <![CDATA[<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><script type="text/javascript">jQuery.noConflict();</script>]]>
9
  </text>
10
  </action>
11
- </block>
12
  <block type="core/text" name="google.cdn.jquery.ui" >
13
  <action method="setText" ifconfig="price_slider/price_slider_settings/include_jquery_ui">
14
  <text>
@@ -16,6 +16,7 @@
16
  </text>
17
  </action>
18
  </block>
 
19
  <action method="addCss" ifconfig="price_slider/price_slider_settings/slider_loader_active">
20
  <script>css/slider/jquery-ui-1.8.23.custom.css</script>
21
  </action>
8
  <![CDATA[<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script><script type="text/javascript">jQuery.noConflict();</script>]]>
9
  </text>
10
  </action>
11
+ </block>
12
  <block type="core/text" name="google.cdn.jquery.ui" >
13
  <action method="setText" ifconfig="price_slider/price_slider_settings/include_jquery_ui">
14
  <text>
16
  </text>
17
  </action>
18
  </block>
19
+
20
  <action method="addCss" ifconfig="price_slider/price_slider_settings/slider_loader_active">
21
  <script>css/slider/jquery-ui-1.8.23.custom.css</script>
22
  </action>
app/design/frontend/base/default/template/slider/ajax.phtml CHANGED
@@ -2,9 +2,10 @@
2
  var data = "";
3
  var active = false;
4
  jQuery(function($){
5
- $('.main').append('<div id="resultLoading" style="display:none"><div><img src="<?php echo $this->loadingImage ?>"><div><?php echo $this->loadingText ?></div></div><div class="bg"></div></div>');
6
- var height = $('.main').height();
7
- var width = $('.main').width();
 
8
  $('.ui-slider-handle').css('cursor','pointer');
9
 
10
  $('#resultLoading').css({
@@ -19,7 +20,7 @@
19
  'background':'<?php echo $this->overlayColor; ?>',
20
  'opacity':'<?php echo $this->overlayOpacity ?>',
21
  'width':'100%',
22
- 'height':height,
23
  'position':'absolute',
24
  'top':'0'
25
  });
@@ -49,8 +50,52 @@
49
 
50
  <?php if($this->ajaxSlider || $this->ajaxLayered): ?>
51
  /*DONOT EDIT THIS CODE*/
52
- eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('9 s(1){2(!8){8=r;q(9($){p=1;$(\'#4 .j\').3($(\'.f\').3());$(\'#4\').t(g);u{$(\'7\').h(\'m\',\'y\');$.o({1:1,x:\'w\',v:\'z\',0:0,n:9(0){2(0.c){2($(\'.5-6\')){$(\'.5-6\').a();$(\'.5-6\').k(0.c)}}2(0.i){$(\'.b-l\').a();$(\'.b-l\').k(0.i)}I L=1.K(\'?\');A.M.N(\'P\',0.O,1);$(\'7\').Q(\'.J D\').C(\'B\');$(\'#4 .j\').3($(\'.f\').3());$(\'#4\').E(g);$(\'7\').h(\'m\',\'F\')}})}H(e){}});8=d}G d}',53,53,'data|url|if|height|resultLoading|col|left|body|active|function|empty|category|viewpanel|false||main|300|css|productlist|bg|append|products|cursor|success|ajax|oldUrl|jQuery|true|sliderAjax|fadeIn|try|type|json|dataType|wait|post|window|onchange|removeAttr|select|fadeOut|default|return|catch|var|toolbar|split|hist|history|pushState|title|GET|find'.split('|')))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  <?php endif; ?>
54
 
 
 
 
55
  </script>
56
 
2
  var data = "";
3
  var active = false;
4
  jQuery(function($){
5
+ if($('body').find('#resultLoading').attr('id') != 'resultLoading'){
6
+ $('.main').append('<div id="resultLoading" style="display:none"><div><img src="<?php echo $this->loadingImage ?>"><div><?php echo $this->loadingText ?></div></div><div class="bg"></div></div>');}
7
+ var height = $('.main').outerHeight();
8
+ var width = $('.main').outerWidth();
9
  $('.ui-slider-handle').css('cursor','pointer');
10
 
11
  $('#resultLoading').css({
20
  'background':'<?php echo $this->overlayColor; ?>',
21
  'opacity':'<?php echo $this->overlayOpacity ?>',
22
  'width':'100%',
23
+ 'height':'100%',
24
  'position':'absolute',
25
  'top':'0'
26
  });
50
 
51
  <?php if($this->ajaxSlider || $this->ajaxLayered): ?>
52
  /*DONOT EDIT THIS CODE*/
53
+ function sliderAjax(url) {
54
+ if (!active) {
55
+ active = true;
56
+ jQuery(function($) {
57
+ oldUrl = url;
58
+ $('#resultLoading .bg').height('100%');
59
+ $('#resultLoading').fadeIn(300);
60
+ try {
61
+ $('body').css('cursor', 'wait');
62
+ $.ajax({
63
+ url: url,
64
+ dataType: 'json',
65
+ type: 'post',
66
+ data: data,
67
+ success: function(data) {
68
+ callback();
69
+ if (data.viewpanel) {
70
+ if ($('.block-layered-nav')) {
71
+ $('.block-layered-nav').empty();
72
+ $('.block-layered-nav').append(data.viewpanel)
73
+ }
74
+ }
75
+ if (data.productlist) {
76
+ $('.category-products').empty();
77
+ $('.category-products').append(data.productlist)
78
+ }
79
+ var hist = url.split('?');
80
+ if(window.history && window.history.pushState){
81
+ window.history.pushState('GET', data.title, url);
82
+ }
83
+ $('body').find('.toolbar select').removeAttr('onchange');
84
+ $('#resultLoading .bg').height('100%');
85
+ $('#resultLoading').fadeOut(300);
86
+ $('body').css('cursor', 'default')
87
+ }
88
+ })
89
+ } catch (e) {}
90
+ });
91
+ active = false
92
+ }
93
+ return false
94
+ }
95
  <?php endif; ?>
96
 
97
+ function callback(){
98
+ <?php echo $this->getCallbackJs(); ?>
99
+ }
100
  </script>
101
 
media/magehouse/slider/default/icon.png ADDED
Binary file
media/magehouse/slider/default/icon_1.png ADDED
Binary file
media/magehouse/slider/default/icon_cat_-_.png ADDED
Binary file
media/magehouse/slider/default/icon_order.png ADDED
Binary file
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Magehouse_Slider</name>
4
- <version>2.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -58,11 +58,27 @@ Improvements:&#xD;
58
  Relase Notes 2.1.1&#xD;
59
  &#xD;
60
  Bug Fixes : sliderAjax Not found&#xD;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  </notes>
62
  <authors><author><name>Mrugesh Mistry</name><user>mrugeshrocks</user><email>mrugesh.rocks@gmail.com</email></author></authors>
63
- <date>2013-01-23</date>
64
- <time>18:20:31</time>
65
- <contents><target name="magecommunity"><dir name="Magehouse"><dir name="Slider"><dir name="Block"><file name="Ajax.php" hash="62df9fd793aedb94d8988956cf0f6a0c"/><dir name="Catalog"><dir name="Layer"><dir name="Filter"><file name="Price.php" hash="b035dba0be61b43594a70939755f05e8"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="a065b8f56bbda2943734e76139883220"/></dir><dir name="Model"><dir name="Catalog"><file name="Layer.php" hash="6a721e4f0118d0353a9f6b7838c5aeaf"/></dir><dir name="Catalogsearch"><file name="Layer.php" hash="e75760252676747cd68039c6ba4920f6"/></dir><dir name="Resource"><file name="Setup.php" hash="adf2aaa164649ba2a335545303ee1600"/></dir></dir><dir name="controllers"><dir name="Catalog"><file name="CategoryController.php" hash="c7dde356bb55b306484efac577573625"/></dir><dir name="CatalogSearch"><file name="ResultController.php" hash="55903199aa1e17657e9be4082e09a813"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="c728cee82276d42e77808bf48fdd0cdf"/><file name="config.xml" hash="48b33238b2079b39d821447d64b5b1ec"/><file name="system.xml" hash="83978053d99367987bf8ff0748bcf64c"/></dir><dir name="sql"><dir name="slider_setup"><file name="mysql4-install-2.1.0.php" hash="12d0c01013cbeadce8d5b6d3e7b148d2"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magehouse_Slider.xml" hash="43112ba587c13efb57d3b9471498a814"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="slider"><dir name="images"><file name="Thumbs.db" hash="c192da3c422ad168eecbe155887757f4"/><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="95f9cceeb9d742dd3e917ec16ed754f8"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="f040b255ca13e693da34ab33c7d6b554"/><file name="ui-bg_flat_10_000000_40x100.png" hash="c18cd01623c7fed23c80d53e2f5e7c78"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="4c494f261d76fd2c344853b64a09371b"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="4c494f261d76fd2c344853b64a09371b"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="4c494f261d76fd2c344853b64a09371b"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="8c06b9c15ea2bef5ff5f1c7468bdc106"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="f00e2ff3af640da7ee8915791b947349"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="b806658954cb4d16ade8977af737f486"/><file name="ui-icons_222222_256x240.png" hash="ebe6b6902a408fbf9cac6379a1477525"/><file name="ui-icons_228ef1_256x240.png" hash="79f41c0765e9ec18562b20b0801d748b"/><file name="ui-icons_ef8c08_256x240.png" hash="ef9a6ccfe3b14041928ddc708665b226"/><file name="ui-icons_ffd27a_256x240.png" hash="39c5a5f53ff0e6cebaec731706427bbb"/><file name="ui-icons_ffffff_256x240.png" hash="342bc03f6264c75d3f1d7f99e34295b9"/></dir><file name="jquery-ui-1.8.23.custom.css" hash="408147096939c6ddb0becced6cdc1197"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="slider.xml" hash="1ce45e45e2ef8744b4e52584555afbc6"/></dir><dir name="template"><dir name="slider"><file name="ajax.phtml" hash="5b12e7ec6309364601af86ef645ccd60"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="magehouse"><dir name="slider"><dir name="default"><file name="ajax-loader.gif" hash="f9b76dc9bba462ece85fc9d7f8f2c33e"/><file name="handle.png" hash="4c494f261d76fd2c344853b64a09371b"/><file name="handle_1.png" hash="4c494f261d76fd2c344853b64a09371b"/><file name="range-bg.jpg" hash="8c06b9c15ea2bef5ff5f1c7468bdc106"/><file name="slider-bg.jpg" hash="f00e2ff3af640da7ee8915791b947349"/></dir></dir></dir></target></contents>
66
  <compatible/>
67
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
68
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Magehouse_Slider</name>
4
+ <version>2.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
58
  Relase Notes 2.1.1&#xD;
59
  &#xD;
60
  Bug Fixes : sliderAjax Not found&#xD;
61
+ &#xD;
62
+ Relase Notes 2.2.0&#xD;
63
+ &#xD;
64
+ Bug Fixes : &#xD;
65
+ &#xD;
66
+ - Left blocks disappearing after ajax&#xD;
67
+ - Multicurrency not working&#xD;
68
+ - Overlay height not proper&#xD;
69
+ - Special price not being displayed in the min and max ranges&#xD;
70
+ - Loading screen not disappearing in IE&#xD;
71
+ New Features:&#xD;
72
+ &#xD;
73
+ - Multi Currency support&#xD;
74
+ - Text box filtering&#xD;
75
+ - Callback for on slide method &#xD;
76
+ - More theming options&#xD;
77
  </notes>
78
  <authors><author><name>Mrugesh Mistry</name><user>mrugeshrocks</user><email>mrugesh.rocks@gmail.com</email></author></authors>
79
+ <date>2013-02-04</date>
80
+ <time>22:32:48</time>
81
+ <contents><target name="magecommunity"><dir name="Magehouse"><dir name="Slider"><dir name="Block"><file name="Ajax.php" hash="0d2a44176cc2a0646a8d47f97061fb02"/><dir name="Catalog"><dir name="Layer"><dir name="Filter"><file name="Price.php" hash="850cc04ec089be7a29f4157271530fba"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="a065b8f56bbda2943734e76139883220"/></dir><dir name="Model"><dir name="Catalog"><file name="Layer.php" hash="34ff37b5cab8629c4e25e3d6bb047a2f"/></dir><dir name="Catalogsearch"><file name="Layer.php" hash="a26394a122491f2b6d0566b3c348b398"/></dir><dir name="Resource"><file name="Setup.php" hash="adf2aaa164649ba2a335545303ee1600"/></dir></dir><dir name="controllers"><dir name="Catalog"><file name="CategoryController.php" hash="c7dde356bb55b306484efac577573625"/></dir><dir name="CatalogSearch"><file name="ResultController.php" hash="55903199aa1e17657e9be4082e09a813"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="c728cee82276d42e77808bf48fdd0cdf"/><file name="config.xml" hash="3228d989a2a21650df475b6427d9f592"/><file name="system.xml" hash="66f4384a51f7c568fdbf439471056ea4"/></dir><dir name="sql"><dir name="slider_setup"><file name="mysql4-install-2.1.0.php" hash="12d0c01013cbeadce8d5b6d3e7b148d2"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magehouse_Slider.xml" hash="43112ba587c13efb57d3b9471498a814"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="slider"><dir name="images"><file name="Thumbs.db" hash="c192da3c422ad168eecbe155887757f4"/><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="95f9cceeb9d742dd3e917ec16ed754f8"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="f040b255ca13e693da34ab33c7d6b554"/><file name="ui-bg_flat_10_000000_40x100.png" hash="c18cd01623c7fed23c80d53e2f5e7c78"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="4c494f261d76fd2c344853b64a09371b"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="4c494f261d76fd2c344853b64a09371b"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="4c494f261d76fd2c344853b64a09371b"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="8c06b9c15ea2bef5ff5f1c7468bdc106"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="f00e2ff3af640da7ee8915791b947349"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="b806658954cb4d16ade8977af737f486"/><file name="ui-icons_222222_256x240.png" hash="ebe6b6902a408fbf9cac6379a1477525"/><file name="ui-icons_228ef1_256x240.png" hash="79f41c0765e9ec18562b20b0801d748b"/><file name="ui-icons_ef8c08_256x240.png" hash="ef9a6ccfe3b14041928ddc708665b226"/><file name="ui-icons_ffd27a_256x240.png" hash="39c5a5f53ff0e6cebaec731706427bbb"/><file name="ui-icons_ffffff_256x240.png" hash="342bc03f6264c75d3f1d7f99e34295b9"/></dir><file name="jquery-ui-1.8.23.custom.css" hash="408147096939c6ddb0becced6cdc1197"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="slider.xml" hash="c0260a22c67db7fe792c1d9a3a3a03f5"/></dir><dir name="template"><dir name="slider"><file name="ajax.phtml" hash="3fa3e445ae83118a21e4e5f9d2f7f3a4"/></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="magehouse"><dir name="slider"><dir name="default"><file name="ajax-loader.gif" hash="f9b76dc9bba462ece85fc9d7f8f2c33e"/><file name="handle.png" hash="4c494f261d76fd2c344853b64a09371b"/><file name="handle_1.png" hash="4c494f261d76fd2c344853b64a09371b"/><file name="icon.png" hash="444001bf372dc691461224d21764d5d4"/><file name="icon_1.png" hash="444001bf372dc691461224d21764d5d4"/><file name="icon_cat_-_.png" hash="4f4303633e7b8d123d08df02d01c6a8e"/><file name="icon_order.png" hash="fb9baae9d79e0a7b894d958f83660ab7"/><file name="range-bg.jpg" hash="8c06b9c15ea2bef5ff5f1c7468bdc106"/><file name="slider-bg.jpg" hash="f00e2ff3af640da7ee8915791b947349"/></dir></dir></dir></target></contents>
82
  <compatible/>
83
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
84
  </package>