Version Notes
* Bug fix - stock management for grouped products
* Product's attribute 'select' bug fix
Download this release
Release Info
Developer | Adar |
Extension | autocompleteplus_autosuggest |
Version | 2.0.8.8 |
Comparing to | |
See all releases |
Code changes from version 2.0.8.7 to 2.0.8.8
app/code/local/Autocompleteplus/Autosuggest/Model/Catalog.php
CHANGED
@@ -273,7 +273,6 @@ class Autocompleteplus_Autosuggest_Model_Catalog extends Mage_Core_Model_Abstrac
|
|
273 |
public function getCategoryMap()
|
274 |
{
|
275 |
if(!$this->_categories){
|
276 |
-
Mage::log('creating categories once',false,'pjackson.log');
|
277 |
$categoryMap = array();
|
278 |
$categories = Mage::getModel('catalog/category')->getCollection()->load();
|
279 |
|
@@ -398,7 +397,8 @@ class Autocompleteplus_Autosuggest_Model_Catalog extends Mage_Core_Model_Abstrac
|
|
398 |
$prodImage='';
|
399 |
$product_base_image = '';
|
400 |
}
|
401 |
-
|
|
|
402 |
if($productModel->getTypeID()=='configurable'){
|
403 |
$configurableAttributes=$this->_getConfigurableAttributes($productModel);
|
404 |
|
@@ -434,6 +434,29 @@ class Autocompleteplus_Autosuggest_Model_Catalog extends Mage_Core_Model_Abstrac
|
|
434 |
}catch(Exception $e){
|
435 |
$priceRange='price_min="" price_max=""';
|
436 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
} else if ($productModel->getTypeID() == 'simple'){
|
438 |
$simple_product_parents = $this->_getSimpleProductParent($productModel);
|
439 |
$priceRange='price_min="" price_max=""';
|
@@ -483,10 +506,17 @@ class Autocompleteplus_Autosuggest_Model_Catalog extends Mage_Core_Model_Abstrac
|
|
483 |
if($attr->getfrontend_input()=='select'){
|
484 |
if($productModel->getData($action)){
|
485 |
if (method_exists($productModel, 'getAttributeText')){
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
} else {
|
491 |
$row.='<attribute is_filterable="'.$is_filterable.'" name="'.$attr->getAttributeCode().'">
|
492 |
<attribute_values><![CDATA['.$productModel->getData($action).']]></attribute_values>
|
@@ -597,6 +627,8 @@ class Autocompleteplus_Autosuggest_Model_Catalog extends Mage_Core_Model_Abstrac
|
|
597 |
}
|
598 |
|
599 |
$row.='<simpleproducts><![CDATA['.implode(',',$configurable_children_ids).']]></simpleproducts>';
|
|
|
|
|
600 |
}
|
601 |
|
602 |
if($productModel->getTypeID() == 'simple'){
|
@@ -873,6 +905,10 @@ class Autocompleteplus_Autosuggest_Model_Catalog extends Mage_Core_Model_Abstrac
|
|
873 |
return $childProducts;
|
874 |
}
|
875 |
|
|
|
|
|
|
|
|
|
876 |
private function _getSimpleProductParent($product){
|
877 |
try{
|
878 |
$parent_products_ids_list = Mage::getModel('catalog/product_type_configurable')
|
273 |
public function getCategoryMap()
|
274 |
{
|
275 |
if(!$this->_categories){
|
|
|
276 |
$categoryMap = array();
|
277 |
$categories = Mage::getModel('catalog/category')->getCollection()->load();
|
278 |
|
397 |
$prodImage='';
|
398 |
$product_base_image = '';
|
399 |
}
|
400 |
+
|
401 |
+
$grouped_children_ids = array();
|
402 |
if($productModel->getTypeID()=='configurable'){
|
403 |
$configurableAttributes=$this->_getConfigurableAttributes($productModel);
|
404 |
|
434 |
}catch(Exception $e){
|
435 |
$priceRange='price_min="" price_max=""';
|
436 |
}
|
437 |
+
} else if ($productModel->getTypeID() == 'grouped'){
|
438 |
+
$grouped_children = $this->_getGroupedChildren($productModel);
|
439 |
+
foreach($grouped_children as $child_product){
|
440 |
+
$grouped_children_ids[] = $child_product->getId();
|
441 |
+
}
|
442 |
+
// getting sellable option for the grouped product
|
443 |
+
if ($sell){ // Grouped is in stock
|
444 |
+
$is_in_stock_child_exist = false;
|
445 |
+
foreach($grouped_children as $child_product){
|
446 |
+
if ($child_product->getStockItem()->getIsInStock()){
|
447 |
+
if (method_exists($child_product, 'isSaleable') && !$child_product->isSaleable()){
|
448 |
+
continue;
|
449 |
+
}
|
450 |
+
$is_in_stock_child_exist = true;
|
451 |
+
break;
|
452 |
+
}
|
453 |
+
}
|
454 |
+
if (!$is_in_stock_child_exist){
|
455 |
+
# Configurable is in stock, but has no in stock children
|
456 |
+
$sell = 0;
|
457 |
+
}
|
458 |
+
}
|
459 |
+
$priceRange='price_min="" price_max=""';
|
460 |
} else if ($productModel->getTypeID() == 'simple'){
|
461 |
$simple_product_parents = $this->_getSimpleProductParent($productModel);
|
462 |
$priceRange='price_min="" price_max=""';
|
506 |
if($attr->getfrontend_input()=='select'){
|
507 |
if($productModel->getData($action)){
|
508 |
if (method_exists($productModel, 'getAttributeText')){
|
509 |
+
try{
|
510 |
+
$row.='<attribute is_filterable="'.$is_filterable.'" name="'.$attr->getAttributeCode().'">
|
511 |
+
<attribute_values><![CDATA['.$productModel->getAttributeText($action).']]></attribute_values>
|
512 |
+
<attribute_label><![CDATA['.$attribute_label.']]></attribute_label>
|
513 |
+
</attribute>';
|
514 |
+
} catch(Exception $e){
|
515 |
+
$row.='<attribute is_filterable="'.$is_filterable.'" name="'.$attr->getAttributeCode().'">
|
516 |
+
<attribute_values><![CDATA['.$productModel->getData($action).']]></attribute_values>
|
517 |
+
<attribute_label><![CDATA['.$attribute_label.']]></attribute_label>
|
518 |
+
</attribute>';
|
519 |
+
}
|
520 |
} else {
|
521 |
$row.='<attribute is_filterable="'.$is_filterable.'" name="'.$attr->getAttributeCode().'">
|
522 |
<attribute_values><![CDATA['.$productModel->getData($action).']]></attribute_values>
|
627 |
}
|
628 |
|
629 |
$row.='<simpleproducts><![CDATA['.implode(',',$configurable_children_ids).']]></simpleproducts>';
|
630 |
+
} else if ($productModel->getTypeID()=='grouped' && count($grouped_children_ids)>0){
|
631 |
+
$row.='<simpleproducts><![CDATA['.implode(',',$grouped_children_ids).']]></simpleproducts>';
|
632 |
}
|
633 |
|
634 |
if($productModel->getTypeID() == 'simple'){
|
905 |
return $childProducts;
|
906 |
}
|
907 |
|
908 |
+
private function _getGroupedChildren($product){
|
909 |
+
return $product->getTypeInstance(true)->getAssociatedProducts($product);
|
910 |
+
}
|
911 |
+
|
912 |
private function _getSimpleProductParent($product){
|
913 |
try{
|
914 |
$parent_products_ids_list = Mage::getModel('catalog/product_type_configurable')
|
app/code/local/Autocompleteplus/Autosuggest/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Autocompleteplus_Autosuggest>
|
5 |
-
<version>2.0.8.
|
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.8.8</version>
|
6 |
<url>http://autocompleteplus.com/</url>
|
7 |
<modulename>Autocompleteplus_Autosuggest</modulename>
|
8 |
</Autocompleteplus_Autosuggest>
|
package.xml
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>autocompleteplus_autosuggest</name>
|
4 |
-
<version>2.0.8.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.autocompleteplus.com/privacy">AC+</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
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>*
|
12 |
-
*
|
13 |
</notes>
|
14 |
<authors><author><name>Adar</name><user>Adar</user><email>magento@autocompleteplus.com</email></author></authors>
|
15 |
-
<date>2016-01-
|
16 |
-
<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="2f302e3591671c3d7c153f0f7977c64c"/><file name="Process.php" hash="e50cf29c2b8893817eb0de4aeacf9ba3"/><file name="Sync.php" hash="0329b6920b67a5c05b38fafe7142df48"/></dir><file name="Autocomplete.php" hash="3a63d5c743d8dda3552f8c0b717c8d2e"/><file name="Autocorrection.php" hash="08da843c04cf9176cefb8588a0da3e77"/><file name="Inject.php" hash="b3e5663b46b64b8b8bc0483b01508848"/><file name="Notifications.php" hash="825fcc830917a22aff36e859fd63b16f"/></dir><dir name="Helper"><file name="Data.php" hash="3c1934354d5144cd33de0e4a3da63777"/></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="
|
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.8.8</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://www.autocompleteplus.com/privacy">AC+</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
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>* Bug fix - stock management for grouped products
|
12 |
+
* Product's attribute 'select' bug fix
|
13 |
</notes>
|
14 |
<authors><author><name>Adar</name><user>Adar</user><email>magento@autocompleteplus.com</email></author></authors>
|
15 |
+
<date>2016-01-17</date>
|
16 |
+
<time>14:02:36</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="2f302e3591671c3d7c153f0f7977c64c"/><file name="Process.php" hash="e50cf29c2b8893817eb0de4aeacf9ba3"/><file name="Sync.php" hash="0329b6920b67a5c05b38fafe7142df48"/></dir><file name="Autocomplete.php" hash="3a63d5c743d8dda3552f8c0b717c8d2e"/><file name="Autocorrection.php" hash="08da843c04cf9176cefb8588a0da3e77"/><file name="Inject.php" hash="b3e5663b46b64b8b8bc0483b01508848"/><file name="Notifications.php" hash="825fcc830917a22aff36e859fd63b16f"/></dir><dir name="Helper"><file name="Data.php" hash="3c1934354d5144cd33de0e4a3da63777"/></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="1337ac8525ddac67fd1c560485c16dc8"/><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="7f5e4891ff139789998808a49dfd1e24"/><file name="Pusher.php" hash="cb55bd677f131dc4370429c2cb485be9"/><dir name="Resource"><dir name="Fulltext"><file name="Collection.php" hash="7ee2e9c81abfb36ab48db380fec378d2"/></dir></dir><file name="Service.php" hash="2c1e4d7764f7d99d2f54e442f3652918"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Autocompleteplus"><file name="PushController.php" hash="ec366543519b206339ca39ce3320ad12"/><file name="RedirectController.php" hash="a63c7811b54470e26dcd1c22d707e67b"/></dir></dir><dir name="CatalogSearch"><file name="ResultController.php" hash="67333080dc7d7cf748667b53616f1457"/></dir><file name="CatalogsearchController.php" hash="0327c979fc357504147d7caff7079d69"/><file name="CategoriesController.php" hash="8f120263586178c0c96e4cb74aea8f00"/><file name="LayeredController.php" hash="f43274329a4e8cfbae6c994beea25653"/><file name="ProductsController.php" hash="520bae5c425916af7cb6e8213b298a0f"/><file name="ProductsbyidController.php" hash="01b8cb9288325ad41248a8eb3fbb906a"/><file name="ResultController.php" hash="f47c5e0c7af08e43af83942a6f418ce7"/><file name="SearchesController.php" hash="344ab1717d1b25d746d033074ae22ade"/></dir><dir name="etc"><file name="adminhtml.xml" hash="34b9d24ddc4565311f6cc83d7e337478"/><file name="api.xml" hash="25ab859fc8312c4aa308f2e3306c6b66"/><file name="cache.xml" hash="b57472bc9410d67af3843825fba5b420"/><file name="config.xml" hash="80d5c93d9ebfcacfe1fd5baccbbc9891"/><file name="config_no_fulltext.xml" hash="50a757335937264e0886bf2b6ac72288"/><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="eb50a1aaf9d639495776dc8501b2e74c"/><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="021610876715ce0f3612a6cd67aa405a"/><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="feb6039afe42f1c0087c59cf97c4c4e3"/></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="286290139b776909e423c0f4c346d82a"/></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="7fb8c4cc511d991bf4e5bc16740b1f39"/></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="c1d08659e65020dcb9e62cf8bc28f73b"/><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>
|