Catalin_Seo - Version 1.2.0

Version Notes

ajax, seo urls, price slider, multiple selection for the same attribute.

Download this release

Release Info

Developer Catalin Ciobanu
Extension Catalin_Seo
Version 1.2.0
Comparing to
See all releases


Code changes from version 1.1.0 to 1.2.0

app/code/community/Catalin/SEO/Block/Catalog/Layer/Filter/Price.php CHANGED
@@ -57,4 +57,20 @@ class Catalin_SEO_Block_Catalog_Layer_Filter_Price extends Mage_Catalog_Block_La
57
  return $item->getUrl();
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  }
57
  return $item->getUrl();
58
  }
59
 
60
+ /**
61
+ * Check if price slider can be rendered with a button
62
+ *
63
+ * @return boolean
64
+ */
65
+ public function isSubmitTypeButton()
66
+ {
67
+ $type = $this->helper('catalin_seo')->getPriceSliderSubmitType();
68
+
69
+ if ($type == Catalin_SEO_Model_System_Config_Source_Slider_Submit_Type::SUBMIT_BUTTON) {
70
+ return true;
71
+ }
72
+
73
+ return false;
74
+ }
75
+
76
  }
app/code/community/Catalin/SEO/Helper/Data.php CHANGED
@@ -80,6 +80,16 @@ class Catalin_SEO_Helper_Data extends Mage_Core_Helper_Abstract
80
  {
81
  return Mage::getStoreConfig('catalin_seo/catalog/price_slider_delay');
82
  }
 
 
 
 
 
 
 
 
 
 
83
 
84
  /**
85
  * Retrieve routing suffix
80
  {
81
  return Mage::getStoreConfig('catalin_seo/catalog/price_slider_delay');
82
  }
83
+
84
+ /**
85
+ * Retrieve how price slider will be submitted (button or delayed auto submit)
86
+ *
87
+ * @return int
88
+ */
89
+ public function getPriceSliderSubmitType()
90
+ {
91
+ return (int) Mage::getStoreConfig('catalin_seo/catalog/price_slider_submit_type');
92
+ }
93
 
94
  /**
95
  * Retrieve routing suffix
app/code/community/Catalin/SEO/Model/System/Config/Source/Slider/Submit/Type.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Catalin_SEO_Model_System_Config_Source_Slider_Submit_Type
4
+ {
5
+
6
+ const SUBMIT_AUTO_DELAYED = 1;
7
+ const SUBMIT_BUTTON = 2;
8
+
9
+ protected $_options;
10
+
11
+ /**
12
+ * Retrieve types of submit for price slider filter
13
+ *
14
+ * @return array
15
+ */
16
+ public function toOptionArray()
17
+ {
18
+ if (null === $this->_options) {
19
+ $helper = Mage::helper('catalin_seo');
20
+ $this->_options = array(
21
+ self::SUBMIT_AUTO_DELAYED => $helper->__('Delayed auto submit'),
22
+ self::SUBMIT_BUTTON => $helper->__('Submit button')
23
+ );
24
+ }
25
+
26
+ return $this->_options;
27
+ }
28
+
29
+ }
app/code/community/Catalin/SEO/etc/config.xml CHANGED
@@ -91,8 +91,9 @@
91
  <catalin_seo>
92
  <catalog>
93
  <enabled>1</enabled>
94
- <ajax_enabled>0</ajax_enabled>
95
  <price_slider>1</price_slider>
 
96
  <price_slider_delay>3</price_slider_delay>
97
  <multiple_choise_filters>1</multiple_choise_filters>
98
  <routing_suffix>filter</routing_suffix>
91
  <catalin_seo>
92
  <catalog>
93
  <enabled>1</enabled>
94
+ <ajax_enabled>1</ajax_enabled>
95
  <price_slider>1</price_slider>
96
+ <price_slider_submit_type>2</price_slider_submit_type>
97
  <price_slider_delay>3</price_slider_delay>
98
  <multiple_choise_filters>1</multiple_choise_filters>
99
  <routing_suffix>filter</routing_suffix>
app/code/community/Catalin/SEO/etc/system.xml CHANGED
@@ -43,7 +43,9 @@
43
  <show_in_default>1</show_in_default>
44
  <show_in_website>1</show_in_website>
45
  <show_in_store>1</show_in_store>
46
- <depends><enabled>1</enabled></depends>
 
 
47
  </ajax_enabled>
48
  <price_slider translate="label">
49
  <label>Enable Price Slider</label>
@@ -54,40 +56,62 @@
54
  <show_in_default>1</show_in_default>
55
  <show_in_website>1</show_in_website>
56
  <show_in_store>1</show_in_store>
57
- <depends><enabled>1</enabled></depends>
 
 
58
  </price_slider>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  <price_slider_delay translate="label">
60
  <label>Price Slider Delay</label>
61
  <frontend_type>text</frontend_type>
62
  <comment>in seconds</comment>
63
  <backend_model>catalin_seo/system_config_backend_seo_catalog</backend_model>
64
- <sort_order>4</sort_order>
65
  <show_in_default>1</show_in_default>
66
  <show_in_website>1</show_in_website>
67
  <show_in_store>1</show_in_store>
68
- <depends><price_slider>1</price_slider></depends>
 
 
69
  </price_slider_delay>
70
  <multiple_choise_filters translate="label">
71
  <label>Enable Multipe Choise Filter</label>
72
  <frontend_type>select</frontend_type>
73
  <source_model>adminhtml/system_config_source_yesno</source_model>
74
  <backend_model>catalin_seo/system_config_backend_seo_catalog</backend_model>
75
- <sort_order>5</sort_order>
76
  <show_in_default>1</show_in_default>
77
  <show_in_website>1</show_in_website>
78
  <show_in_store>1</show_in_store>
79
- <depends><enabled>1</enabled></depends>
 
 
80
  </multiple_choise_filters>
81
  <routing_suffix translate="label">
82
  <label>Routing Souffix</label>
83
  <frontend_type>text</frontend_type>
84
  <comment>Used in url generation (it should be alphanumeric) - Do not use slash ( / )</comment>
85
  <backend_model>catalin_seo/system_config_backend_seo_catalog</backend_model>
86
- <sort_order>6</sort_order>
87
  <show_in_default>1</show_in_default>
88
  <show_in_website>1</show_in_website>
89
  <show_in_store>1</show_in_store>
90
- <depends><enabled>1</enabled></depends>
 
 
91
  </routing_suffix>
92
  </fields>
93
  </catalog>
43
  <show_in_default>1</show_in_default>
44
  <show_in_website>1</show_in_website>
45
  <show_in_store>1</show_in_store>
46
+ <depends>
47
+ <enabled>1</enabled>
48
+ </depends>
49
  </ajax_enabled>
50
  <price_slider translate="label">
51
  <label>Enable Price Slider</label>
56
  <show_in_default>1</show_in_default>
57
  <show_in_website>1</show_in_website>
58
  <show_in_store>1</show_in_store>
59
+ <depends>
60
+ <enabled>1</enabled>
61
+ </depends>
62
  </price_slider>
63
+ <price_slider_submit_type translate="label">
64
+ <label>Price Slider Submit Type</label>
65
+ <frontend_type>select</frontend_type>
66
+ <comment>in seconds</comment>
67
+ <source_model>catalin_seo/system_config_source_slider_submit_type</source_model>
68
+ <backend_model>catalin_seo/system_config_backend_seo_catalog</backend_model>
69
+ <sort_order>4</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ <depends>
74
+ <price_slider>1</price_slider>
75
+ </depends>
76
+ </price_slider_submit_type>
77
  <price_slider_delay translate="label">
78
  <label>Price Slider Delay</label>
79
  <frontend_type>text</frontend_type>
80
  <comment>in seconds</comment>
81
  <backend_model>catalin_seo/system_config_backend_seo_catalog</backend_model>
82
+ <sort_order>5</sort_order>
83
  <show_in_default>1</show_in_default>
84
  <show_in_website>1</show_in_website>
85
  <show_in_store>1</show_in_store>
86
+ <depends>
87
+ <price_slider_submit_type>1</price_slider_submit_type>
88
+ </depends>
89
  </price_slider_delay>
90
  <multiple_choise_filters translate="label">
91
  <label>Enable Multipe Choise Filter</label>
92
  <frontend_type>select</frontend_type>
93
  <source_model>adminhtml/system_config_source_yesno</source_model>
94
  <backend_model>catalin_seo/system_config_backend_seo_catalog</backend_model>
95
+ <sort_order>6</sort_order>
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
+ <depends>
100
+ <enabled>1</enabled>
101
+ </depends>
102
  </multiple_choise_filters>
103
  <routing_suffix translate="label">
104
  <label>Routing Souffix</label>
105
  <frontend_type>text</frontend_type>
106
  <comment>Used in url generation (it should be alphanumeric) - Do not use slash ( / )</comment>
107
  <backend_model>catalin_seo/system_config_backend_seo_catalog</backend_model>
108
+ <sort_order>7</sort_order>
109
  <show_in_default>1</show_in_default>
110
  <show_in_website>1</show_in_website>
111
  <show_in_store>1</show_in_store>
112
+ <depends>
113
+ <enabled>1</enabled>
114
+ </depends>
115
  </routing_suffix>
116
  </fields>
117
  </catalog>
app/design/frontend/default/default/template/catalin_seo/catalog/layer/price.phtml CHANGED
@@ -8,17 +8,23 @@
8
  <span style="float: right;" id="price-max-display"><?php echo $this->getMaxPriceInt(); ?></span>
9
  </li>
10
  </ul>
 
 
 
 
 
11
 
12
  <script type="text/javascript">
13
  var maxPriceInt = <?php echo $this->getMaxPriceInt(); ?>;
 
14
  var timerSlider = null;
15
  var priceSliderDelay = <?php echo $this->helper('catalin_seo')->getPriceSliderDelay() * 1000 ?>;
 
16
 
17
  function handlePriceEvent(val) {
18
- var link = '<?php echo $this->getUrlPattern(); ?>';
19
- if (val[0] != 0 || val[1] != maxPriceInt) {
20
- var price = val.join('-');
21
- link = link.replace('__PRICE_VALUE__', price);
22
  <?php if ($this->helper('catalin_seo')->isAjaxEnabled()): ?>
23
  handleEvent(link);
24
  <?php else: ?>
@@ -40,10 +46,16 @@
40
 
41
  restricted: true,
42
  onChange: function(val){
43
- if (timerSlider) {
44
- clearTimeout(timerSlider);
 
 
 
 
 
 
 
45
  }
46
- timerSlider = setTimeout(handlePriceEvent, priceSliderDelay, val);
47
  },
48
  onSlide: function(val){
49
  $('price-max-display').innerHTML = val[1];
8
  <span style="float: right;" id="price-max-display"><?php echo $this->getMaxPriceInt(); ?></span>
9
  </li>
10
  </ul>
11
+ <?php if ($this->isSubmitTypeButton()): ?>
12
+ <div class="a-right">
13
+ <button id="button-price-slider" class="button" onclick="handlePriceEvent(this.value)" value=""><span><span><?php echo $this->__('Update') ?></span></span></button>
14
+ </div>
15
+ <?php endif; ?>
16
 
17
  <script type="text/javascript">
18
  var maxPriceInt = <?php echo $this->getMaxPriceInt(); ?>;
19
+ <?php if (!$this->isSubmitTypeButton()): ?>
20
  var timerSlider = null;
21
  var priceSliderDelay = <?php echo $this->helper('catalin_seo')->getPriceSliderDelay() * 1000 ?>;
22
+ <?php endif; ?>
23
 
24
  function handlePriceEvent(val) {
25
+ if (val) {
26
+ var link = '<?php echo $this->getUrlPattern(); ?>';
27
+ link = link.replace('__PRICE_VALUE__', val);
 
28
  <?php if ($this->helper('catalin_seo')->isAjaxEnabled()): ?>
29
  handleEvent(link);
30
  <?php else: ?>
46
 
47
  restricted: true,
48
  onChange: function(val){
49
+ if (val[0] != 0 || val[1] != maxPriceInt) {
50
+ <?php if ($this->isSubmitTypeButton()): ?>
51
+ $('button-price-slider').value = val.join('-');
52
+ <?php else: ?>
53
+ if (timerSlider) {
54
+ clearTimeout(timerSlider);
55
+ }
56
+ timerSlider = setTimeout(handlePriceEvent, priceSliderDelay, val.join('-'));
57
+ <?php endif; ?>
58
  }
 
59
  },
60
  onSlide: function(val){
61
  $('price-max-display').innerHTML = val[1];
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Catalin_Seo</name>
4
- <version>1.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
@@ -23,8 +23,8 @@
23
  &lt;/ul&gt;</description>
24
  <notes>ajax, seo urls, price slider, multiple selection for the same attribute.</notes>
25
  <authors><author><name>Catalin Ciobanu</name><user>catalin_ciobanu</user><email>ciobanu.catalin@yahoo.com</email></author></authors>
26
- <date>2012-12-04</date>
27
- <time>15:06:13</time>
28
  <contents><target name="magecommunity"><dir name="Catalin"><dir name="SEO"><dir name="Block"><dir name="Catalog"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="b0fb7deaeec0d46bc170e510c3d6f73a"/><file name="Price.php" hash="73fe2b9d21dab816474ee8d662a530bd"/></dir><file name="State.php" hash="fece6cd5534ae48f0f9f9233a7f714af"/></dir><dir name="Product"><dir name="List"><file name="Pager.php" hash="5f41fc06bddb70fc2f7de3792c933879"/><file name="Toolbar.php" hash="6db34892e1937dd1e527c8ac2fda4746"/></dir></dir></dir><dir name="CatalogSearch"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="120da8cc984bf1d55428ee4cfeaedca5"/></dir></dir></dir></dir><dir name="Controller"><file name="Router.php" hash="71c67346a0c3e89775e5d7762c8a3588"/></dir><dir name="Helper"><file name="Data.php" hash="47a5e37ea96a12615ad1818f919d634f"/></dir><dir name="Model"><dir name="Catalog"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="cd5ef92601544ed236617881b0dd6352"/><file name="Category.php" hash="bc5df542ef28c4e7a9583ae441c550c8"/><file name="Item.php" hash="9d89a99bebad467ca14e50333c556649"/></dir></dir><dir name="Resource"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="ab59cb798f1069786a98408f6ebaf948"/></dir></dir></dir></dir><dir name="CatalogSearch"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="137c0b3795d3eea4da8442db3e05e7a0"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Seo"><file name="Catalog.php" hash="ea4cd41cf4e919935919585a22dfea29"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="CategoryController.php" hash="3f3404592e64ffc3d3e302a92e76dc06"/><file name="ResultController.php" hash="660c07990539e5605112cb42e24c02d6"/></dir><dir name="etc"><file name="adminhtml.xml" hash="240f607b0156d1de84667b382ba3f73c"/><file name="config.xml" hash="9e2487e6c0eb5b09c43f65c01db3d882"/><file name="system.xml" hash="9fd01148901e15950868e312b96dbfde"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="price_slider"><file name="style.css" hash="61d0b59ed239bc64deaf4aed969652cd"/></dir></dir><dir name="images"><dir name="price_slider"><file name="bkg_slider.png" hash="1b7a1eb7add1d2b2002501f4602c3d3e"/><file name="slider.png" hash="d77b417b68ba91402c3b7180b165110c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Catalin_SEO.xml" hash="e0ad01abfe976aefb6587fcfb3bf0d2b"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="catalin_seo"><dir><dir name="catalog"><dir name="layer"><file name="filter.phtml" hash="dd1d3278e691814f0cd242179e5bf53f"/><file name="price.phtml" hash="19f1583df9e7f14d81318c633b334a88"/><file name="view.phtml" hash="bc5f21109be4dab996b152e7a756fe03"/></dir><dir name="product"><file name="list.phtml" hash="bd332a192ed36c56c00968e13b599cd3"/></dir></dir></dir></dir></dir><dir name="layout"><file name="catalin_seo.xml" hash="61db4d9d696f2d12c562ae70a5164e4c"/></dir></dir></dir></dir></target></contents>
29
  <compatible/>
30
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Catalin_Seo</name>
4
+ <version>1.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
23
  &lt;/ul&gt;</description>
24
  <notes>ajax, seo urls, price slider, multiple selection for the same attribute.</notes>
25
  <authors><author><name>Catalin Ciobanu</name><user>catalin_ciobanu</user><email>ciobanu.catalin@yahoo.com</email></author></authors>
26
+ <date>2012-12-14</date>
27
+ <time>13:31:03</time>
28
  <contents><target name="magecommunity"><dir name="Catalin"><dir name="SEO"><dir name="Block"><dir name="Catalog"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="b0fb7deaeec0d46bc170e510c3d6f73a"/><file name="Price.php" hash="73fe2b9d21dab816474ee8d662a530bd"/></dir><file name="State.php" hash="fece6cd5534ae48f0f9f9233a7f714af"/></dir><dir name="Product"><dir name="List"><file name="Pager.php" hash="5f41fc06bddb70fc2f7de3792c933879"/><file name="Toolbar.php" hash="6db34892e1937dd1e527c8ac2fda4746"/></dir></dir></dir><dir name="CatalogSearch"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="120da8cc984bf1d55428ee4cfeaedca5"/></dir></dir></dir></dir><dir name="Controller"><file name="Router.php" hash="71c67346a0c3e89775e5d7762c8a3588"/></dir><dir name="Helper"><file name="Data.php" hash="47a5e37ea96a12615ad1818f919d634f"/></dir><dir name="Model"><dir name="Catalog"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="cd5ef92601544ed236617881b0dd6352"/><file name="Category.php" hash="bc5df542ef28c4e7a9583ae441c550c8"/><file name="Item.php" hash="9d89a99bebad467ca14e50333c556649"/></dir></dir><dir name="Resource"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="ab59cb798f1069786a98408f6ebaf948"/></dir></dir></dir></dir><dir name="CatalogSearch"><dir name="Layer"><dir name="Filter"><file name="Attribute.php" hash="137c0b3795d3eea4da8442db3e05e7a0"/></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Seo"><file name="Catalog.php" hash="ea4cd41cf4e919935919585a22dfea29"/></dir></dir></dir></dir></dir><dir name="controllers"><file name="CategoryController.php" hash="3f3404592e64ffc3d3e302a92e76dc06"/><file name="ResultController.php" hash="660c07990539e5605112cb42e24c02d6"/></dir><dir name="etc"><file name="adminhtml.xml" hash="240f607b0156d1de84667b382ba3f73c"/><file name="config.xml" hash="9e2487e6c0eb5b09c43f65c01db3d882"/><file name="system.xml" hash="9fd01148901e15950868e312b96dbfde"/></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="css"><dir name="price_slider"><file name="style.css" hash="61d0b59ed239bc64deaf4aed969652cd"/></dir></dir><dir name="images"><dir name="price_slider"><file name="bkg_slider.png" hash="1b7a1eb7add1d2b2002501f4602c3d3e"/><file name="slider.png" hash="d77b417b68ba91402c3b7180b165110c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Catalin_SEO.xml" hash="e0ad01abfe976aefb6587fcfb3bf0d2b"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="catalin_seo"><dir><dir name="catalog"><dir name="layer"><file name="filter.phtml" hash="dd1d3278e691814f0cd242179e5bf53f"/><file name="price.phtml" hash="19f1583df9e7f14d81318c633b334a88"/><file name="view.phtml" hash="bc5f21109be4dab996b152e7a756fe03"/></dir><dir name="product"><file name="list.phtml" hash="bd332a192ed36c56c00968e13b599cd3"/></dir></dir></dir></dir></dir><dir name="layout"><file name="catalin_seo.xml" hash="61db4d9d696f2d12c562ae70a5164e4c"/></dir></dir></dir></dir></target></contents>
29
  <compatible/>
30
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>