Year_Make_Model_Filter_Box - Version 4.3

Version Notes

Catalog Search is made filtered by ymm

Download this release

Release Info

Developer Magento Core Team
Extension Year_Make_Model_Filter_Box
Version 4.3
Comparing to
See all releases


Code changes from version 4.2 to 4.3

app/code/local/Pektsekye/CatalogSearch/Model/Layer.php CHANGED
@@ -19,20 +19,41 @@ class Pektsekye_CatalogSearch_Model_Layer extends Mage_CatalogSearch_Model_Layer
19
  $helper = new Pektsekye_Ymm_Helper_Data;
20
  $ids = $helper->getProductIds();
21
 
22
- if($ids && isset($_GET['Make'])){
23
-
24
- $collection = Mage::getResourceModel('catalog/product_collection')
25
- ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
26
- ->addIdFilter($ids)
27
- ->setStore(Mage::app()->getStore())
28
- ->addMinimalPrice()
29
- ->addFinalPrice()
30
- ->addTaxPercents()
31
- ->addStoreFilter()
32
- ->addUrlRewrite();
33
-
34
- Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
35
- Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
  } else {
38
 
19
  $helper = new Pektsekye_Ymm_Helper_Data;
20
  $ids = $helper->getProductIds();
21
 
22
+ if($ids){
23
+
24
+ if(Mage::helper('catalogSearch')->getEscapedQueryText() && Mage::getStoreConfig('catalog/search/filtering', Mage::app()->getStore()->getStoreId())){
25
+ $collection = Mage::getResourceModel('catalogsearch/fulltext_collection')
26
+ ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
27
+ ->addSearchFilter(Mage::helper('catalogSearch')->getEscapedQueryText())
28
+ ->addIdFilter($ids)
29
+ ->setStore(Mage::app()->getStore())
30
+ ->addMinimalPrice()
31
+ ->addFinalPrice()
32
+ ->addTaxPercents()
33
+ ->addStoreFilter()
34
+ ->addUrlRewrite();
35
+
36
+ } elseif (!Mage::helper('catalogSearch')->getEscapedQueryText()){
37
+
38
+ $collection = Mage::getResourceModel('catalog/product_collection')
39
+ ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
40
+ ->addIdFilter($ids)
41
+ ->setStore(Mage::app()->getStore())
42
+ ->addMinimalPrice()
43
+ ->addFinalPrice()
44
+ ->addTaxPercents()
45
+ ->addStoreFilter()
46
+ ->addUrlRewrite();
47
+
48
+ } else {
49
+
50
+ $collection = Mage::getResourceModel('catalogsearch/fulltext_collection');
51
+ $this->prepareProductCollection($collection);
52
+
53
+ }
54
+
55
+ Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($collection);
56
+ Mage::getSingleton('catalog/product_visibility')->addVisibleInSearchFilterToCollection($collection);
57
 
58
  } else {
59
 
app/code/local/Pektsekye/Ymm/etc/config.xml CHANGED
@@ -144,6 +144,9 @@
144
  <navigation>
145
  <filtering>1</filtering>
146
  </navigation>
 
 
 
147
  </catalog>
148
  </default>
149
 
144
  <navigation>
145
  <filtering>1</filtering>
146
  </navigation>
147
+ <search>
148
+ <filtering>1</filtering>
149
+ </search>
150
  </catalog>
151
  </default>
152
 
app/code/local/Pektsekye/Ymm/etc/system.xml CHANGED
@@ -10,13 +10,27 @@
10
  <label>Enable YMM Filtering</label>
11
  <frontend_type>select</frontend_type>
12
  <source_model>adminhtml/system_config_source_yesno</source_model>
13
- <sort_order>10</sort_order>
14
  <show_in_default>1</show_in_default>
15
  <show_in_website>1</show_in_website>
16
  <show_in_store>1</show_in_store>
 
17
  </filtering>
18
  </fields>
19
  </navigation>
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  </groups>
21
  </catalog>
22
  </sections>
10
  <label>Enable YMM Filtering</label>
11
  <frontend_type>select</frontend_type>
12
  <source_model>adminhtml/system_config_source_yesno</source_model>
13
+ <sort_order>2</sort_order>
14
  <show_in_default>1</show_in_default>
15
  <show_in_website>1</show_in_website>
16
  <show_in_store>1</show_in_store>
17
+ <comment>cache refresh needed</comment>
18
  </filtering>
19
  </fields>
20
  </navigation>
21
+ <search translate="label">
22
+ <fields>
23
+ <filtering translate="label">
24
+ <label>Enable YMM Filtering</label>
25
+ <frontend_type>select</frontend_type>
26
+ <source_model>adminhtml/system_config_source_yesno</source_model>
27
+ <sort_order>6</sort_order>
28
+ <show_in_default>1</show_in_default>
29
+ <show_in_website>1</show_in_website>
30
+ <show_in_store>1</show_in_store>
31
+ </filtering>
32
+ </fields>
33
+ </search>
34
  </groups>
35
  </catalog>
36
  </sections>
app/design/frontend/default/default/template/ymm/ymm.phtml CHANGED
@@ -159,7 +159,18 @@ function pop_year(){
159
  <div class="head">
160
  <h4><span><?php echo $this->__('Select Vehicle') ?></span></h4>
161
  </div>
162
- <form name="make_model_year" action="<?php echo $module != 'catalog_category_view' ? Mage::getUrl('ymm/product/list') : '' ;?>" method="get">
 
 
 
 
 
 
 
 
 
 
 
163
  <div class="content">
164
  <select name="Make" onChange="pop_model();" style="width: 100%">
165
  <?php
@@ -184,7 +195,17 @@ function pop_year(){
184
  </div>
185
  <div class="actions">
186
  <button class="form-button-alt right" type="submit"><span><?php echo $this->__('Go') ?></span></button>
187
- <?php if(isset($Make_selected_var)): ?><a href="<?php echo $module != 'catalog_category_view' ? Mage::getBaseUrl() : '' ; ?>?Make=all&Model=all&Year=0">Clear Vehicle</a>&nbsp;&nbsp;&nbsp;&nbsp;<?php endif ?>
 
 
 
 
 
 
 
 
 
 
188
  </div>
189
  </form>
190
  </div>
159
  <div class="head">
160
  <h4><span><?php echo $this->__('Select Vehicle') ?></span></h4>
161
  </div>
162
+ <form name="make_model_year" action="<?php
163
+ $hidden = '';
164
+ if($module == 'catalog_category_view'){
165
+ echo '';
166
+ } elseif ($module == 'catalogsearch_result_index' && Mage::getStoreConfig('catalog/search/filtering', Mage::app()->getStore()->getStoreId())){
167
+ $hidden = '<input type="hidden" name="q" value="' . $request->getParam('q') . '">';
168
+ } else {
169
+ echo Mage::getUrl('ymm/product/list');
170
+ }
171
+
172
+ ?>" method="get">
173
+ <?php echo $hidden; ?>
174
  <div class="content">
175
  <select name="Make" onChange="pop_model();" style="width: 100%">
176
  <?php
195
  </div>
196
  <div class="actions">
197
  <button class="form-button-alt right" type="submit"><span><?php echo $this->__('Go') ?></span></button>
198
+ <?php if(isset($Make_selected_var)): ?>
199
+ <a href="<?php
200
+ if($module == 'catalog_category_view'){
201
+ echo '?';
202
+ } elseif ($module == 'catalogsearch_result_index' && Mage::getStoreConfig('catalog/search/filtering', Mage::app()->getStore()->getStoreId())){
203
+ echo '?q=' . $request->getParam('q') . '&';
204
+ } else {
205
+ echo Mage::getBaseUrl() . '?';
206
+ }
207
+ ?>Make=all&Model=all&Year=0">Clear Vehicle</a>&nbsp;&nbsp;&nbsp;&nbsp;
208
+ <?php endif ?>
209
  </div>
210
  </form>
211
  </div>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Year_Make_Model_Filter_Box</name>
4
- <version>4.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
@@ -16,11 +16,11 @@ NOTE: You should know your product id to be able to add an YMM item to it.
16
  You can find product id in the product description page url:
17
  http://yoursite.com/magento/catalog/product/view/id/119/s/coalesce-functioning-on-impatience-t-shirt/category/4/
18
  The number 119 is the product id in the url.</description>
19
- <notes>Added editable configuration value for category navigation</notes>
20
  <authors><author><name>Stanislav</name><user>auto-converted</user><email>pektsekye@gmail.com</email></author></authors>
21
- <date>2009-07-30</date>
22
- <time>22:54:02</time>
23
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ymm.xml" hash="07bb5759f6ff145da493c94452f029af"/></dir><dir name="template"><dir name="ymm"><file name="importExport.phtml" hash="962cd5005434dfb5878b59af757f796e"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="ymm.xml" hash="d7262dfdd3d36f2115652d979caa6688"/></dir><dir name="template"><dir name="ymm"><file name="ymm.phtml" hash="3bcc14d3d31a69821f2ff1d523cfc784"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Pektsekye_Catalog.xml" hash="89e3ec6056b4ba53d06df1370b347d42"/><file name="Pektsekye_CatalogSearch.xml" hash="c1152b8350ae4906db9736369c8e5edf"/><file name="Pektsekye_Ymm.xml" hash="990f4f561816481bd0c517f4fa131436"/></dir></target><target name="magelocal"><dir name="Pektsekye"><dir name="Catalog"><dir name="Model"><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Category.php" hash="e497f8d795dc4ada58b42828ee1ded75"/></dir></dir></dir><file name="Category.php" hash="c1e9b8cfd53a2bf466cbb80d4a9bb227"/></dir></dir><dir name="CatalogSearch"><dir name="Model"><file name="Layer.php" hash="d9576052f726186cbf8d9d23e7ced335"/></dir></dir><dir name="Ymm"><dir name="Block"><dir name="Adminhtml"><dir name="Ymm"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="df436e6aad93d09f7d3082e08373ae22"/></dir><file name="Form.php" hash="c673af9d5e772ee2230a838971a633e1"/><file name="Tabs.php" hash="9048cfd443135e36e2b9cb5de38fcb47"/></dir><file name="Edit.php" hash="fb03b2d7cc9d282221af18c6ce9f6f9f"/><file name="Grid.php" hash="ada75e652f9d9920c08a229242181a05"/><file name="ImportExport.php" hash="e1b161394a704c51c454ead1ca04e6cd"/></dir><file name="Ymm.php" hash="2c2d280c93d8839cd67515cd2d6c7ddd"/></dir><dir name="Product"><file name="Result.php" hash="62a89f2fb905930d5ece223e35d21fda"/></dir><file name="Ymm.php" hash="bf96d82627a567ea6bb6b5f4b5c96eb4"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="YmmController.php" hash="917dbf072d01849a01aa3d35945ef14a"/></dir><file name="IndexController.php" hash="241a989b18c6309977568c050215730a"/><file name="ProductController.php" hash="84c655e892f90dd4b7442243390ebb4a"/></dir><dir name="etc"><file name="config.xml" hash="512cc2444a24015f9f88133c6173836a"/><file name="system.xml" hash="d3c8b5904ea0396c770b5e551e75d932"/></dir><dir name="Helper"><file name="Data.php" hash="181c50a246f314fc20991571c4980e5c"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Ymm"><file name="Collection.php" hash="1c6a50ea1416ce936892156806d20e15"/></dir><file name="Ymm.php" hash="1608c162d190561029817336de386205"/></dir><file name="Status.php" hash="a10da0eebafef60fcceb6a8c396ad201"/><file name="Ymm.php" hash="fdf6dbac2b9595f7183ca1f951538b97"/></dir><dir name="sql"><dir name="ymm_setup"><file name="mysql4-install-0.1.0.php" hash="9e4d9d55d8996105775b26c667eff6d1"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="f84214fc43f665c79b92dc7a092b364f"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="b3c26ec790ce60161c9317b01f111ea5"/></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies/>
26
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Year_Make_Model_Filter_Box</name>
4
+ <version>4.3</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
  <channel>community</channel>
16
  You can find product id in the product description page url:
17
  http://yoursite.com/magento/catalog/product/view/id/119/s/coalesce-functioning-on-impatience-t-shirt/category/4/
18
  The number 119 is the product id in the url.</description>
19
+ <notes>Catalog Search is made filtered by ymm</notes>
20
  <authors><author><name>Stanislav</name><user>auto-converted</user><email>pektsekye@gmail.com</email></author></authors>
21
+ <date>2009-08-01</date>
22
+ <time>00:01:14</time>
23
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="ymm.xml" hash="07bb5759f6ff145da493c94452f029af"/></dir><dir name="template"><dir name="ymm"><file name="importExport.phtml" hash="962cd5005434dfb5878b59af757f796e"/></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="ymm.xml" hash="d7262dfdd3d36f2115652d979caa6688"/></dir><dir name="template"><dir name="ymm"><file name="ymm.phtml" hash="c8afb5a9803571c68fd62e460002c63d"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Pektsekye_Catalog.xml" hash="89e3ec6056b4ba53d06df1370b347d42"/><file name="Pektsekye_CatalogSearch.xml" hash="c1152b8350ae4906db9736369c8e5edf"/><file name="Pektsekye_Ymm.xml" hash="990f4f561816481bd0c517f4fa131436"/></dir></target><target name="magelocal"><dir name="Pektsekye"><dir name="Catalog"><dir name="Model"><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><file name="Category.php" hash="e497f8d795dc4ada58b42828ee1ded75"/></dir></dir></dir><file name="Category.php" hash="c1e9b8cfd53a2bf466cbb80d4a9bb227"/></dir></dir><dir name="CatalogSearch"><dir name="Model"><file name="Layer.php" hash="f67a029af92a723745453e6544d5d32c"/></dir></dir><dir name="Ymm"><dir name="Block"><dir name="Adminhtml"><dir name="Ymm"><dir name="Edit"><dir name="Tab"><file name="Form.php" hash="df436e6aad93d09f7d3082e08373ae22"/></dir><file name="Form.php" hash="c673af9d5e772ee2230a838971a633e1"/><file name="Tabs.php" hash="9048cfd443135e36e2b9cb5de38fcb47"/></dir><file name="Edit.php" hash="fb03b2d7cc9d282221af18c6ce9f6f9f"/><file name="Grid.php" hash="ada75e652f9d9920c08a229242181a05"/><file name="ImportExport.php" hash="e1b161394a704c51c454ead1ca04e6cd"/></dir><file name="Ymm.php" hash="2c2d280c93d8839cd67515cd2d6c7ddd"/></dir><dir name="Product"><file name="Result.php" hash="62a89f2fb905930d5ece223e35d21fda"/></dir><file name="Ymm.php" hash="bf96d82627a567ea6bb6b5f4b5c96eb4"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="YmmController.php" hash="917dbf072d01849a01aa3d35945ef14a"/></dir><file name="IndexController.php" hash="241a989b18c6309977568c050215730a"/><file name="ProductController.php" hash="84c655e892f90dd4b7442243390ebb4a"/></dir><dir name="etc"><file name="config.xml" hash="de8fc65d3c9652dba2c19553a58fa4bb"/><file name="system.xml" hash="3cc4856f3571c39d735c2818b9aea6b3"/></dir><dir name="Helper"><file name="Data.php" hash="181c50a246f314fc20991571c4980e5c"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Ymm"><file name="Collection.php" hash="1c6a50ea1416ce936892156806d20e15"/></dir><file name="Ymm.php" hash="1608c162d190561029817336de386205"/></dir><file name="Status.php" hash="a10da0eebafef60fcceb6a8c396ad201"/><file name="Ymm.php" hash="fdf6dbac2b9595f7183ca1f951538b97"/></dir><dir name="sql"><dir name="ymm_setup"><file name="mysql4-install-0.1.0.php" hash="9e4d9d55d8996105775b26c667eff6d1"/><file name="mysql4-upgrade-0.1.0-0.2.0.php" hash="f84214fc43f665c79b92dc7a092b364f"/><file name="mysql4-upgrade-0.2.0-0.3.0.php" hash="b3c26ec790ce60161c9317b01f111ea5"/></dir></dir></dir></dir></target></contents>
24
  <compatible/>
25
  <dependencies/>
26
  </package>