autocompleteplus_autosuggest - Version 2.0.7.9

Version Notes

Few bug fixes:
* Stock management for configurable products
* multiselect attributes fix (filters)

Download this release

Release Info

Developer Adar
Extension autocompleteplus_autosuggest
Version 2.0.7.9
Comparing to
See all releases


Code changes from version 2.0.7.8 to 2.0.7.9

app/code/local/Autocompleteplus/Autosuggest/Model/Catalog.php CHANGED
@@ -388,7 +388,29 @@ class Autocompleteplus_Autosuggest_Model_Catalog extends Mage_Core_Model_Abstrac
388
  if($productModel->getTypeID()=='configurable'){
389
  $configurableAttributes=$this->_getConfigurableAttributes($productModel);
390
 
391
- $configurableChildren=$this->_getConfigurableChildren($productModel);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
392
  try{
393
  $priceRange=$this->_getPriceRange($productModel);
394
  }catch(Exception $e){
@@ -479,7 +501,7 @@ class Autocompleteplus_Autosuggest_Model_Catalog extends Mage_Core_Model_Abstrac
479
  if($productModel->getData($action)){
480
  $values=$productModel->getResource()->getAttribute($action)->getFrontend()->getValue($productModel);
481
  $row.='<attribute is_filterable="'.$is_filterable.'" name="'.$attr->getAttributeCode().'">
482
- <attribute_values><![CDATA['.$productModel->getData($action).']]></attribute_values>
483
  <attribute_label><![CDATA['.$attribute_label.']]></attribute_label>
484
  </attribute>';
485
  }
@@ -494,7 +516,7 @@ class Autocompleteplus_Autosuggest_Model_Catalog extends Mage_Core_Model_Abstrac
494
  }
495
  }
496
 
497
- $row.='<simpleproducts><![CDATA['.implode(',',$configurableChildren).']]></simpleproducts>';
498
  }
499
 
500
  if($productModel->getTypeID() == 'simple'){
@@ -768,15 +790,7 @@ class Autocompleteplus_Autosuggest_Model_Catalog extends Mage_Core_Model_Abstrac
768
 
769
  $childProducts = Mage::getModel('catalog/product_type_configurable')
770
  ->getUsedProducts(null,$product);
771
- $ids=array();
772
-
773
- foreach($childProducts as $cProd){
774
- $ids[]=$cProd->getId();
775
- }
776
-
777
- //echo '<pre>';print_r($ids); die;
778
-
779
- return $ids;
780
  }
781
 
782
  private function _getSimpleProductParent($product){
388
  if($productModel->getTypeID()=='configurable'){
389
  $configurableAttributes=$this->_getConfigurableAttributes($productModel);
390
 
391
+ $configurableChildren = $this->_getConfigurableChildren($productModel);
392
+
393
+ // getting all children's ids
394
+ $configurable_children_ids = array();
395
+ foreach($configurableChildren as $child_product){
396
+ $configurable_children_ids[] = $child_product->getId();
397
+ }
398
+
399
+ // getting sellable option for the configurable product
400
+ if ($sell){ // Configurable is in stock
401
+ $is_in_stock_child_exist = false;
402
+ foreach($configurableChildren as $child_product){
403
+ if ($child_product->getStockItem()->getIsInStock()){
404
+ $is_in_stock_child_exist = true;
405
+ break;
406
+ }
407
+ }
408
+ if (!$is_in_stock_child_exist){
409
+ # Configurable is in stock, but has no in stock children
410
+ $sell = 0;
411
+ }
412
+ }
413
+
414
  try{
415
  $priceRange=$this->_getPriceRange($productModel);
416
  }catch(Exception $e){
501
  if($productModel->getData($action)){
502
  $values=$productModel->getResource()->getAttribute($action)->getFrontend()->getValue($productModel);
503
  $row.='<attribute is_filterable="'.$is_filterable.'" name="'.$attr->getAttributeCode().'">
504
+ <attribute_values><![CDATA['.$values.']]></attribute_values>
505
  <attribute_label><![CDATA['.$attribute_label.']]></attribute_label>
506
  </attribute>';
507
  }
516
  }
517
  }
518
 
519
+ $row.='<simpleproducts><![CDATA['.implode(',',$configurable_children_ids).']]></simpleproducts>';
520
  }
521
 
522
  if($productModel->getTypeID() == 'simple'){
790
 
791
  $childProducts = Mage::getModel('catalog/product_type_configurable')
792
  ->getUsedProducts(null,$product);
793
+ return $childProducts;
 
 
 
 
 
 
 
 
794
  }
795
 
796
  private function _getSimpleProductParent($product){
app/code/local/Autocompleteplus/Autosuggest/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Autocompleteplus_Autosuggest>
5
- <version>2.0.7.8</version>
6
  <url>http://autocompleteplus.com/</url>
7
  <modulename>Autocompleteplus_Autosuggest</modulename>
8
  </Autocompleteplus_Autosuggest>
2
  <config>
3
  <modules>
4
  <Autocompleteplus_Autosuggest>
5
+ <version>2.0.7.9</version>
6
  <url>http://autocompleteplus.com/</url>
7
  <modulename>Autocompleteplus_Autosuggest</modulename>
8
  </Autocompleteplus_Autosuggest>
app/design/frontend/base/default/template/autocompleteplus/catalog/product/list.phtml CHANGED
@@ -4,6 +4,16 @@ $auto_config = Mage::getModel('autocompleteplus_autosuggest/config')->getCollect
4
  $uuid = $auto_config[0]['licensekey'];
5
  $query = Mage::app()->getRequest()->getParam('q');
6
 
 
 
 
 
 
 
 
 
 
 
7
  try{
8
  $match_value = '';
9
  $formkey_html = $this->getBlockHtml('formkey'); // '<input name="form_key" type="hidden" value="E3rpphc1BL6zyTB3" />'
4
  $uuid = $auto_config[0]['licensekey'];
5
  $query = Mage::app()->getRequest()->getParam('q');
6
 
7
+ try{
8
+ // prevent js injection - Remove query with <script>
9
+ $pattern = '/<\s*script[^>]*>/i';
10
+ $pattern1 = '/%3C\s*script/i';
11
+ $pattern2 = '/&lt;\s*script/i';
12
+ if (preg_match($pattern, $query) || preg_match($pattern1, $query) || preg_match($pattern2, $query)){
13
+ $query = '';
14
+ }
15
+ } catch (Exception $e){}
16
+
17
  try{
18
  $match_value = '';
19
  $formkey_html = $this->getBlockHtml('formkey'); // '<input name="form_key" type="hidden" value="E3rpphc1BL6zyTB3" />'
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>autocompleteplus_autosuggest</name>
4
- <version>2.0.7.8</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.autocompleteplus.com/privacy">AC+</license>
7
  <channel>community</channel>
@@ -9,12 +9,13 @@
9
  <summary>AutoComplete+ InstantSearch</summary>
10
  <description>AutoComplete+ InstantSearch triples visitor conversion, optimizes search, and offers promotions through state-of-the-art contextual suggestions dropdown. Since suggestions are lightning fast, accurate, and contextual - visitors find exactly what they want - faster.</description>
11
  <notes>Few bug fixes:&#xD;
12
- Additional products synchronization bug fix&#xD;
 
13
  </notes>
14
  <authors><author><name>Adar</name><user>Adar</user><email>magento@autocompleteplus.com</email></author></authors>
15
- <date>2015-09-02</date>
16
- <time>12:52:33</time>
17
- <contents><target name="magelocal"><dir name="Autocompleteplus"><dir name="Autosuggest"><dir name="Adminhtml"><dir name="Model"><file name="Attributes.php" hash="4fc7b546eb9cbff0b5067bc09fb62597"/><file name="Button.php" hash="afd78d0d80b4af60ea70fcfcffea5d8b"/></dir></dir><dir name="Block"><dir name="Adminhtml"><file name="Button.php" hash="e0a2fe4d412ebdf8cabc01fa4c224e6e"/><file name="Process.php" hash="aa23776a49fb4fae3f7a9891155608c2"/><file name="Sync.php" hash="033d8bbf1f2aa68582ff56d87ee7f4c7"/></dir><file name="Autocomplete.php" hash="3a63d5c743d8dda3552f8c0b717c8d2e"/><file name="Autocorrection.php" hash="08da843c04cf9176cefb8588a0da3e77"/><file name="Inject.php" hash="8955247ceea36293fa9934620e5c4c30"/><file name="Notifications.php" hash="825fcc830917a22aff36e859fd63b16f"/></dir><dir name="Helper"><file name="Data.php" hash="f70246d91906dada414f9a8c1a99eee9"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Attributes.php" hash="1e321486e5c3bea159e4a7d8a79926ab"/></dir><dir name="Api"><file name="V2.php" hash="f7bfd6626466de0fe860484ab2bc7a00"/></dir><file name="Api.php" hash="4dd5882dcfd219087c1cec3cff46f7a9"/><file name="Catalog.php" hash="da46ed9af82756aebea210808de5b550"/><file name="Catalogreport.php" hash="05f88adba656366d814f259056f92c73"/><file name="Config.php" hash="57d8e278d1cd13fea31504ee8f8ee304"/><file name="Layer.php" hash="ef1b5ddaa4fd12354e349d64f09ba1af"/><dir name="Mysql4"><dir name="Config"><file name="Collection.php" hash="110486b53b74e5b1cba1d552814a4b7c"/></dir><file name="Config.php" hash="991a9f1e674756a0a57577febb2f48cd"/><dir name="Fulltext"><file name="Collection.php" hash="709f6d0a955ec7bc1d31c577858101e6"/></dir><file name="Fulltext.php" hash="eada3fc83bd7976d8e3a38f8bb6e0e5f"/><dir name="Notifications"><file name="Collection.php" hash="d306a8690255ba7c444d30f94f780df4"/></dir><file name="Notifications.php" hash="c74b9b6a8f639318c828d3d5984bcf5d"/><dir name="Pusher"><file name="Collection.php" hash="28f0c11f2a3dd26fd06c508a342becd9"/></dir><file name="Pusher.php" hash="9337bd6a280f35f4694e7a1351f39e7d"/></dir><file name="Notifications.php" hash="6467b4765964afba40e452e564c7347d"/><file name="Observer.php" hash="5b454a3dc3bb7a1a72d5aa125c684bbb"/><file name="Pusher.php" hash="cb55bd677f131dc4370429c2cb485be9"/><dir name="Resource"><dir name="Fulltext"><file name="Collection.php" hash="2492156a0fffde6aa7a62f596d8b30ca"/></dir></dir><file name="Service.php" hash="2c1e4d7764f7d99d2f54e442f3652918"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PushController.php" hash="f92822911e861c39e2bb50eb1ccc1d14"/><file name="RedirectController.php" hash="2bdc7574edfc293bde1e89c87a9b6ce1"/></dir><dir name="CatalogSearch"><file name="ResultController.php" hash="67333080dc7d7cf748667b53616f1457"/></dir><file name="CatalogsearchController.php" hash="0327c979fc357504147d7caff7079d69"/><file name="CategoriesController.php" hash="38e9551dd84f4f9fad2ccebde1f8bf77"/><file name="LayeredController.php" hash="f43274329a4e8cfbae6c994beea25653"/><file name="ProductsController.php" hash="072d5527963e5022ce02344d17ffc234"/><file name="ProductsbyidController.php" hash="5705ccffaba0d594d6e64bdb0fa95715"/><file name="SearchesController.php" hash="344ab1717d1b25d746d033074ae22ade"/></dir><dir name="etc"><file name="adminhtml.xml" hash="aceab8126257d9afbb4a2bc9be994ac5"/><file name="api.xml" hash="25ab859fc8312c4aa308f2e3306c6b66"/><file name="cache.xml" hash="b57472bc9410d67af3843825fba5b420"/><file name="config.xml" hash="9a8f95956d912a6b95a89027f8c12c47"/><file name="config_no_fulltext.xml" hash="1ed15add3a2968ddc9b21504a2b2aea7"/><file name="config_with_crontab.xml" hash="3ea8556899a84435c11c6f526bccec27"/><file name="system.xml" hash="6bed22fbdfc336254126cf4a8c49aa09"/><file name="wsdl.xml" hash="97b1503c710c79376cd85e7f971c1587"/></dir><dir name="sql"><dir name="autosuggest_setup"><file name="mysql4-install-2.0.1.1.php" hash="fd4018c6752ba72af7af2f5f14a0dc12"/><file name="mysql4-upgrade-2.0.1.3-2.0.2.2.php" hash="275c674ba7ef38beb03d20dd16c56d79"/><file name="mysql4-upgrade-2.0.2.5-2.0.2.6.php" hash="4db99239287c64410ac1d7abf6517b59"/><file name="mysql4-upgrade-2.0.4.6-2.0.4.7.php" hash="9a37396d35fec0e3b911455ec61b18d6"/><file name="mysql4-upgrade-2.0.5.4-2.0.5.5.php" hash="2f43b1c32617ea88ef02bab870788807"/><file name="mysql4-upgrade-2.0.5.6-2.0.5.7.php" hash="6a77ea58afed1b6937f0c6d0aa831392"/><file name="mysql4-upgrade-2.0.6.1-2.0.6.4.php" hash="fa5411870fa2eef5ed21a6db1373b651"/><file name="mysql4-upgrade-2.0.7.0-2.0.7.1.php" hash="02c07e5d0c94299165dce4bd140ee547"/><file name="mysql4-upgrade-2.0.7.2-2.0.7.3.php" hash="9ea280adb0ba238fcb6b92b0fe86219b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Autocompleteplus_Autosuggest.xml" hash="e2279cfe50ac070fcfabcf9d327a25fc"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="autocompleteplus.xml" hash="fde78c32c4eba6de8d324c4fd6a8863c"/></dir><dir name="template"><dir name="autocompleteplus"><dir name="catalog"><dir name="layer"><file name="view.phtml" hash="57066d2ac5fa051c15c3ed8bb43b5d08"/></dir><dir name="product"><file name="list.phtml" hash="546212ad1c79417b84444babbc812641"/></dir></dir><file name="inject.phtml" hash="8cdcb15176db3b14c9c135e87d31e7ad"/><file name="inject_new.phtml" hash="e1e8e050631fe65417edb7a8f25155c8"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="autocompleteplus"><file name="notifications.phtml" hash="88db09b9c262104a73886aa7e7efef1e"/><file name="notifications_old.php" hash="8824edf5a99aa011a1d123233b6a513d"/><dir name="system"><dir name="config"><file name="button.phtml" hash="4762e2343ede91cdee6ecdbf1fd85030"/><file name="sync.phtml" hash="e0392aac8584e98ef4260419750e1cbb"/></dir></dir></dir></dir><dir name="layout"><file name="autocompleteplus.xml" hash="939f8a52905dfef7b81a0f4552042376"/></dir></dir></dir></dir></target></contents>
18
  <compatible/>
19
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
20
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>autocompleteplus_autosuggest</name>
4
+ <version>2.0.7.9</version>
5
  <stability>stable</stability>
6
  <license uri="http://www.autocompleteplus.com/privacy">AC+</license>
7
  <channel>community</channel>
9
  <summary>AutoComplete+ InstantSearch</summary>
10
  <description>AutoComplete+ InstantSearch triples visitor conversion, optimizes search, and offers promotions through state-of-the-art contextual suggestions dropdown. Since suggestions are lightning fast, accurate, and contextual - visitors find exactly what they want - faster.</description>
11
  <notes>Few bug fixes:&#xD;
12
+ * Stock management for configurable products&#xD;
13
+ * multiselect attributes fix (filters)&#xD;
14
  </notes>
15
  <authors><author><name>Adar</name><user>Adar</user><email>magento@autocompleteplus.com</email></author></authors>
16
+ <date>2015-10-06</date>
17
+ <time>11:16:04</time>
18
+ <contents><target name="magelocal"><dir name="Autocompleteplus"><dir name="Autosuggest"><dir name="Adminhtml"><dir name="Model"><file name="Attributes.php" hash="4fc7b546eb9cbff0b5067bc09fb62597"/><file name="Button.php" hash="afd78d0d80b4af60ea70fcfcffea5d8b"/></dir></dir><dir name="Block"><dir name="Adminhtml"><file name="Button.php" hash="e0a2fe4d412ebdf8cabc01fa4c224e6e"/><file name="Process.php" hash="aa23776a49fb4fae3f7a9891155608c2"/><file name="Sync.php" hash="033d8bbf1f2aa68582ff56d87ee7f4c7"/></dir><file name="Autocomplete.php" hash="3a63d5c743d8dda3552f8c0b717c8d2e"/><file name="Autocorrection.php" hash="08da843c04cf9176cefb8588a0da3e77"/><file name="Inject.php" hash="8955247ceea36293fa9934620e5c4c30"/><file name="Notifications.php" hash="825fcc830917a22aff36e859fd63b16f"/></dir><dir name="Helper"><file name="Data.php" hash="f70246d91906dada414f9a8c1a99eee9"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Attributes.php" hash="1e321486e5c3bea159e4a7d8a79926ab"/></dir><dir name="Api"><file name="V2.php" hash="f7bfd6626466de0fe860484ab2bc7a00"/></dir><file name="Api.php" hash="4dd5882dcfd219087c1cec3cff46f7a9"/><file name="Catalog.php" hash="9cf431555c040f7ee11f39f61d2ea409"/><file name="Catalogreport.php" hash="05f88adba656366d814f259056f92c73"/><file name="Config.php" hash="57d8e278d1cd13fea31504ee8f8ee304"/><file name="Layer.php" hash="ef1b5ddaa4fd12354e349d64f09ba1af"/><dir name="Mysql4"><dir name="Config"><file name="Collection.php" hash="110486b53b74e5b1cba1d552814a4b7c"/></dir><file name="Config.php" hash="991a9f1e674756a0a57577febb2f48cd"/><dir name="Fulltext"><file name="Collection.php" hash="709f6d0a955ec7bc1d31c577858101e6"/></dir><file name="Fulltext.php" hash="eada3fc83bd7976d8e3a38f8bb6e0e5f"/><dir name="Notifications"><file name="Collection.php" hash="d306a8690255ba7c444d30f94f780df4"/></dir><file name="Notifications.php" hash="c74b9b6a8f639318c828d3d5984bcf5d"/><dir name="Pusher"><file name="Collection.php" hash="28f0c11f2a3dd26fd06c508a342becd9"/></dir><file name="Pusher.php" hash="9337bd6a280f35f4694e7a1351f39e7d"/></dir><file name="Notifications.php" hash="6467b4765964afba40e452e564c7347d"/><file name="Observer.php" hash="5b454a3dc3bb7a1a72d5aa125c684bbb"/><file name="Pusher.php" hash="cb55bd677f131dc4370429c2cb485be9"/><dir name="Resource"><dir name="Fulltext"><file name="Collection.php" hash="2492156a0fffde6aa7a62f596d8b30ca"/></dir></dir><file name="Service.php" hash="2c1e4d7764f7d99d2f54e442f3652918"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="PushController.php" hash="f92822911e861c39e2bb50eb1ccc1d14"/><file name="RedirectController.php" hash="2bdc7574edfc293bde1e89c87a9b6ce1"/></dir><dir name="CatalogSearch"><file name="ResultController.php" hash="67333080dc7d7cf748667b53616f1457"/></dir><file name="CatalogsearchController.php" hash="0327c979fc357504147d7caff7079d69"/><file name="CategoriesController.php" hash="38e9551dd84f4f9fad2ccebde1f8bf77"/><file name="LayeredController.php" hash="f43274329a4e8cfbae6c994beea25653"/><file name="ProductsController.php" hash="072d5527963e5022ce02344d17ffc234"/><file name="ProductsbyidController.php" hash="5705ccffaba0d594d6e64bdb0fa95715"/><file name="SearchesController.php" hash="344ab1717d1b25d746d033074ae22ade"/></dir><dir name="etc"><file name="adminhtml.xml" hash="aceab8126257d9afbb4a2bc9be994ac5"/><file name="api.xml" hash="25ab859fc8312c4aa308f2e3306c6b66"/><file name="cache.xml" hash="b57472bc9410d67af3843825fba5b420"/><file name="config.xml" hash="fb323715a6cf7d9310229febc985d8fc"/><file name="config_no_fulltext.xml" hash="1ed15add3a2968ddc9b21504a2b2aea7"/><file name="config_with_crontab.xml" hash="3ea8556899a84435c11c6f526bccec27"/><file name="system.xml" hash="6bed22fbdfc336254126cf4a8c49aa09"/><file name="wsdl.xml" hash="97b1503c710c79376cd85e7f971c1587"/></dir><dir name="sql"><dir name="autosuggest_setup"><file name="mysql4-install-2.0.1.1.php" hash="fd4018c6752ba72af7af2f5f14a0dc12"/><file name="mysql4-upgrade-2.0.1.3-2.0.2.2.php" hash="275c674ba7ef38beb03d20dd16c56d79"/><file name="mysql4-upgrade-2.0.2.5-2.0.2.6.php" hash="4db99239287c64410ac1d7abf6517b59"/><file name="mysql4-upgrade-2.0.4.6-2.0.4.7.php" hash="9a37396d35fec0e3b911455ec61b18d6"/><file name="mysql4-upgrade-2.0.5.4-2.0.5.5.php" hash="2f43b1c32617ea88ef02bab870788807"/><file name="mysql4-upgrade-2.0.5.6-2.0.5.7.php" hash="6a77ea58afed1b6937f0c6d0aa831392"/><file name="mysql4-upgrade-2.0.6.1-2.0.6.4.php" hash="fa5411870fa2eef5ed21a6db1373b651"/><file name="mysql4-upgrade-2.0.7.0-2.0.7.1.php" hash="02c07e5d0c94299165dce4bd140ee547"/><file name="mysql4-upgrade-2.0.7.2-2.0.7.3.php" hash="9ea280adb0ba238fcb6b92b0fe86219b"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Autocompleteplus_Autosuggest.xml" hash="e2279cfe50ac070fcfabcf9d327a25fc"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="autocompleteplus.xml" hash="fde78c32c4eba6de8d324c4fd6a8863c"/></dir><dir name="template"><dir name="autocompleteplus"><dir name="catalog"><dir name="layer"><file name="view.phtml" hash="57066d2ac5fa051c15c3ed8bb43b5d08"/></dir><dir name="product"><file name="list.phtml" hash="c4bc6df3afd1ea80d95a67e111a3d0aa"/></dir></dir><file name="inject.phtml" hash="8cdcb15176db3b14c9c135e87d31e7ad"/><file name="inject_new.phtml" hash="e1e8e050631fe65417edb7a8f25155c8"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="autocompleteplus"><file name="notifications.phtml" hash="88db09b9c262104a73886aa7e7efef1e"/><file name="notifications_old.php" hash="8824edf5a99aa011a1d123233b6a513d"/><dir name="system"><dir name="config"><file name="button.phtml" hash="4762e2343ede91cdee6ecdbf1fd85030"/><file name="sync.phtml" hash="e0392aac8584e98ef4260419750e1cbb"/></dir></dir></dir></dir><dir name="layout"><file name="autocompleteplus.xml" hash="939f8a52905dfef7b81a0f4552042376"/></dir></dir></dir></dir></target></contents>
19
  <compatible/>
20
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
21
  </package>