MagehouseInfinity - Version 1.0.1

Version Notes

First Release 19 -9 -2012
Added Missing Loader Image

Download this release

Release Info

Developer Magento Core Team
Extension MagehouseInfinity
Version 1.0.1
Comparing to
See all releases


Code changes from version 1.0.0 to 1.0.1

app/code/community/Magehouse/Slider/Block/Catalog/Layer/View.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Catalog layer price filter
5
+ *
6
+ * @category Mage
7
+ * @package Mage_Catalog
8
+ * @author Magento Core Team <core@magentocommerce.com>
9
+ */
10
+
11
+ class Magehouse_Slider_Block_Catalog_Layer_View extends Mage_Catalog_Block_Layer_View
12
+ {
13
+
14
+ public $_currentCategory;
15
+ public $_productCollection;
16
+ public $_maxPrice;
17
+ public $_minPrice;
18
+ public $_currMinPrice;
19
+ public $_currMaxPrice;
20
+
21
+
22
+ public function __construct(){
23
+
24
+ $this->_currentCategory = Mage::registry('current_category');
25
+ $this->setProductCollection();
26
+ $this->setMinPrice();
27
+ $this->setMaxPrice();
28
+ $this->setCurrentPrices();
29
+ parent::__construct();
30
+ }
31
+
32
+ public function getSliderStatus(){
33
+ if(Mage::getStoreConfig('price_slider/price_slider_settings/slider_loader_active'))
34
+ return true;
35
+ else
36
+ return false;
37
+ }
38
+
39
+ public function getSlider(){
40
+ if($this->getSliderStatus()){
41
+ $text='
42
+ <div class="price">
43
+ <p>
44
+ <input type="text" id="amount" readonly="readonly" style="background:none; border:none;" />
45
+ </p>
46
+ <div id="slider-range"></div>
47
+ </div>
48
+ ';
49
+
50
+ return $text;
51
+ }
52
+ }
53
+
54
+ public function prepareParams(){
55
+ $url="";
56
+
57
+ $params=$this->getRequest()->getParams();
58
+ foreach ($params as $key=>$val)
59
+ {
60
+ if($key=='id'){ continue;}
61
+ if($key=='min'){ continue;}
62
+ if($key=='max'){ continue;}
63
+ $url.='&'.$key.'='.$val;
64
+ }
65
+ return $url;
66
+ }
67
+
68
+ public function getSliderJs(){
69
+ $baseUrl = $this->_currentCategory->getUrl();
70
+
71
+ if($this->_currMaxPrice > 0){$max = $this->_currMaxPrice;} else{$max = $this->_maxPrice;}
72
+ if($this->_currMinPrice > 0){$min = $this->_currMinPrice;} else{$min = $this->_minPrice;}
73
+ $html = '
74
+ <script type="text/javascript">
75
+ jQuery(function($) {
76
+ $( "#slider-range" ).slider({
77
+ range: true,
78
+ min: 0,
79
+ max: '.$this->_maxPrice.',
80
+ values: [ '.$min.', '.$max.' ],
81
+ slide: function( event, ui ) {
82
+ $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
83
+ },stop: function( event, ui ) {
84
+ var x1 = ui.values[0];
85
+ var x2 = ui.values[1];
86
+ $( "#amount" ).val( "$"+x1+" - $"+x2 );
87
+ var url = "'.$baseUrl.'"+"/?min="+x1+"&max="+x2+"'.$this->prepareParams().'";
88
+ if(x1 != '.$min.' && x2 != '.$max.'){
89
+ clearTimeout(timer);
90
+ window.location= url;
91
+ }else{
92
+ timer = setTimeout(function(){
93
+ window.location= url;
94
+ }, 5000);
95
+ }
96
+ }
97
+ });
98
+ $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
99
+ " - $" + $( "#slider-range" ).slider( "values", 1 ) );
100
+ });
101
+ </script>
102
+ ';
103
+
104
+ return $html;
105
+ }
106
+
107
+
108
+
109
+ public function setMinPrice(){
110
+ $this->_minPrice = $this->_productCollection
111
+ ->getFirstItem()
112
+ ->getPrice();
113
+ }
114
+
115
+ public function setMaxPrice(){
116
+ $this->_maxPrice = $this->_productCollection
117
+ ->getLastItem()
118
+ ->getPrice();
119
+ }
120
+
121
+ public function setProductCollection(){
122
+ $this->_productCollection = $this->_currentCategory
123
+ ->getProductCollection()
124
+ ->addAttributeToSelect('*')
125
+ ->setOrder('price', 'ASC');
126
+ }
127
+
128
+ public function setCurrentPrices(){
129
+
130
+ $this->_currMinPrice = $this->getRequest()->getParam('min');
131
+ $this->_currMaxPrice = $this->getRequest()->getParam('max');
132
+ }
133
+
134
+ }
135
+
136
+ ?>
app/code/community/Magehouse/Slider/Helper/Data.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ class Magehouse_Slider_Helper_Data extends Mage_Core_Helper_Abstract
3
+ {
4
+ }
5
+
app/code/community/Magehouse/Slider/Model/Catalog/Layer.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()])) {
42
+ $collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
43
+ } else {
44
+ $collection = $this->getCurrentCategory()->getProductCollection();
45
+ $this->prepareProductCollection($collection);
46
+ $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
47
+ }
48
+
49
+ /*PRICE SLIDER FILTER*/
50
+ $max=$_GET['max'];
51
+ $min=$_GET['min'];
52
+ if($min)
53
+ $collection= $collection->addAttributeToFilter('price',array('gteq'=>$min));
54
+
55
+ if($max)
56
+ $collection= $collection->addAttributeToFilter('price',array('lteq'=>$max));
57
+
58
+ /*PRICE SLIDER FILTER*/
59
+
60
+ return $collection;
61
+ }
62
+
63
+
64
+ }
app/code/community/Magehouse/Slider/etc/adminhtml.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <acl>
4
+ <resources>
5
+ <admin>
6
+ <children>
7
+ <system>
8
+ <children>
9
+ <config>
10
+ <children>
11
+ <price_slider translate="title" module="slider">
12
+ <title>Magehouse Price Slider</title>
13
+ <sort_order>0</sort_order>
14
+ </price_slider>
15
+ </children>
16
+ </config>
17
+ </children>
18
+ </system>
19
+ </children>
20
+ </admin>
21
+ </resources>
22
+ </acl>
23
+ </config>
app/code/community/Magehouse/Slider/etc/config.xml ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Magehouse_Slider>
5
+ <version>0.1.0</version>
6
+ </Magehouse_Slider>
7
+ </modules>
8
+ <global>
9
+ <helpers>
10
+ <slider>
11
+ <class>Magehouse_Slider_Helper</class>
12
+ </slider>
13
+ </helpers>
14
+ <blocks>
15
+ <catalog>
16
+ <rewrite>
17
+ <layer_view>Magehouse_Slider_Block_Catalog_Layer_View</layer_view>
18
+ </rewrite>
19
+ </catalog>
20
+ </blocks>
21
+ <models>
22
+ <catalog>
23
+ <rewrite>
24
+ <layer>Magehouse_Slider_Model_Catalog_Layer</layer>
25
+ </rewrite>
26
+ </catalog>
27
+ </models>
28
+ </global>
29
+ <frontend>
30
+ <layout>
31
+ <updates>
32
+ <slider>
33
+ <file>slider.xml</file>
34
+ </slider>
35
+ </updates>
36
+ </layout>
37
+ </frontend>
38
+ </config>
app/code/community/Magehouse/Slider/etc/system.xml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <tabs>
4
+ <magehouse translate="label" module="slider">
5
+ <label>Magehouse Extensions</label>
6
+ <sort_order>0</sort_order>
7
+ </magehouse>
8
+ </tabs>
9
+ <sections>
10
+ <price_slider translate="label" module="slider">
11
+ <label>Price Slider</label>
12
+ <tab>magehouse</tab>
13
+ <frontend_type>text</frontend_type>
14
+ <sort_order>0</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <groups>
19
+ <price_slider_settings translate="label">
20
+ <label>Settings</label>
21
+ <frontend_type>text</frontend_type>
22
+ <sort_order>0</sort_order>
23
+ <show_in_default>1</show_in_default>
24
+ <show_in_website>1</show_in_website>
25
+ <show_in_store>1</show_in_store>
26
+ <fields>
27
+ <slider_loader_active translate="label">
28
+ <label>Enable Price Slider</label>
29
+ <frontend_type>select</frontend_type>
30
+ <source_model>adminhtml/system_config_source_yesno</source_model>
31
+ <sort_order>1</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ </slider_loader_active>
36
+ <include_jquery translate="label">
37
+ <label>Include Jquery</label>
38
+ <frontend_type>select</frontend_type>
39
+ <source_model>adminhtml/system_config_source_yesno</source_model>
40
+ <sort_order>2</sort_order>
41
+ <show_in_default>1</show_in_default>
42
+ <show_in_website>1</show_in_website>
43
+ <show_in_store>1</show_in_store>
44
+ </include_jquery>
45
+ <include_jquery_ui translate="label">
46
+ <label>Include Jquery UI</label>
47
+ <frontend_type>select</frontend_type>
48
+ <source_model>adminhtml/system_config_source_yesno</source_model>
49
+ <sort_order>2</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ </include_jquery_ui>
54
+ </fields>
55
+ </price_slider_settings>
56
+ </groups>
57
+ </price_slider>
58
+ </sections>
59
+ </config>
media/images/loader.gif ADDED
Binary file
package.xml CHANGED
@@ -1,18 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MagehouseInfinity</name>
4
- <version>1.0.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>
8
  <extends/>
9
  <summary>Get infinite scrolling category pages.</summary>
10
  <description>Get infinite scrolling category pages.</description>
11
- <notes>First Release 19 -9 -2012</notes>
 
12
  <authors><author><name>Mrugesh Mistry</name><user>auto-converted</user><email>mrugesh.rocks@gmail.com</email></author></authors>
13
- <date>2012-09-19</date>
14
- <time>10:39:04</time>
15
- <contents><target name="magecommunity"><dir name="Magehouse"><dir name="Infinity"><dir name="Helper"><file name="Data.php" hash="a6c41a4bb720289eb76d906a9e5cac66"/></dir><dir name="etc"><file name="adminhtml.xml" hash="465e6ff26e98795805d6556a7bb6e77f"/><file name="config.xml" hash="8beb09b1ad30f3945a8e052da28f1733"/><file name="system.xml" hash="a08e8f76b2c949af9fa63c44828e8e41"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="infinitescroll.xml" hash="583734765416ed15c6c7689baac93bf0"/></dir><dir name="template"><dir name="infinitescroll"><file name="js.phtml" hash="e202d3273cb1d9d7d091b005d3319899"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="infinite"><file name="jquery.ias.min.js" hash="5c1fc8a0c00783b0ffddd978059c1d1f"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magehouse_Infinity.xml" hash="a2471ae1480f2935dddee2f6afdeb12f"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>MagehouseInfinity</name>
4
+ <version>1.0.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>
8
  <extends/>
9
  <summary>Get infinite scrolling category pages.</summary>
10
  <description>Get infinite scrolling category pages.</description>
11
+ <notes>First Release 19 -9 -2012&#xD;
12
+ Added Missing Loader Image</notes>
13
  <authors><author><name>Mrugesh Mistry</name><user>auto-converted</user><email>mrugesh.rocks@gmail.com</email></author></authors>
14
+ <date>2012-09-22</date>
15
+ <time>04:19:00</time>
16
+ <contents><target name="magecommunity"><dir name="Magehouse"><dir name="Infinity"><dir name="Helper"><file name="Data.php" hash="a6c41a4bb720289eb76d906a9e5cac66"/></dir><dir name="etc"><file name="adminhtml.xml" hash="465e6ff26e98795805d6556a7bb6e77f"/><file name="config.xml" hash="8beb09b1ad30f3945a8e052da28f1733"/><file name="system.xml" hash="a08e8f76b2c949af9fa63c44828e8e41"/></dir></dir><dir name="Slider"><dir name="Block"><dir name="Catalog"><dir name="Layer"><file name="View.php" hash="7db58428fa18f689850a8383b99ce631"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="a065b8f56bbda2943734e76139883220"/></dir><dir name="Model"><dir name="Catalog"><file name="Layer.php" hash="a1c2cecee98019114530e94b7e13a526"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="c728cee82276d42e77808bf48fdd0cdf"/><file name="config.xml" hash="8ab150a262b79226482dc02e79bcfba3"/><file name="system.xml" hash="1f32c7e82fe02f5ffd37e7d311af8fd6"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="infinitescroll.xml" hash="583734765416ed15c6c7689baac93bf0"/></dir><dir name="template"><dir name="infinitescroll"><file name="js.phtml" hash="e202d3273cb1d9d7d091b005d3319899"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="infinite"><file name="jquery.ias.min.js" hash="5c1fc8a0c00783b0ffddd978059c1d1f"/></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Magehouse_Infinity.xml" hash="a2471ae1480f2935dddee2f6afdeb12f"/></dir></target><target name="magemedia"><dir name="images"><file name="loader.gif" hash="a83b3386215d34699938f4eec968e372"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies/>
19
  </package>