Version Notes
- Improved XML parsing
- Performance improvements
Download this release
Release Info
| Developer | Niels - Rejuni |
| Extension | wiser_search |
| Version | 1.0.5 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.4 to 1.0.5
app/code/community/Wiser/Search/Helper/ProductData.php
CHANGED
|
@@ -20,6 +20,13 @@ class Wiser_Search_Helper_ProductData
|
|
| 20 |
$Data['category'] = $Cats['main'];
|
| 21 |
$Data['subcategory'] = $Cats['sub'];
|
| 22 |
$Data['brand']=$Product->getResource()->getAttribute('manufacturer')->getFrontend()->getValue($Product);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
if($Data['brand'] == "No") {
|
| 24 |
$Data['brand'] = "";
|
| 25 |
}
|
| 20 |
$Data['category'] = $Cats['main'];
|
| 21 |
$Data['subcategory'] = $Cats['sub'];
|
| 22 |
$Data['brand']=$Product->getResource()->getAttribute('manufacturer')->getFrontend()->getValue($Product);
|
| 23 |
+
|
| 24 |
+
$parents = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($ProductInput);
|
| 25 |
+
if( count($parents) > 0 ) {
|
| 26 |
+
$Data['mainproductid'] = implode(",", $parents);
|
| 27 |
+
} else {
|
| 28 |
+
$Data['mainproductid'] = 0;
|
| 29 |
+
}
|
| 30 |
if($Data['brand'] == "No") {
|
| 31 |
$Data['brand'] = "";
|
| 32 |
}
|
app/code/community/Wiser/Search/Helper/XmlFeed.php
CHANGED
|
@@ -16,7 +16,7 @@ class Wiser_Search_Helper_XmlFeed
|
|
| 16 |
$xml_product = $this->_add_product_fields($xml_product, $product);
|
| 17 |
}
|
| 18 |
|
| 19 |
-
return $xml_feed->
|
| 20 |
}
|
| 21 |
|
| 22 |
private function _add_product_fields($xml_product, $product_fields)
|
| 16 |
$xml_product = $this->_add_product_fields($xml_product, $product);
|
| 17 |
}
|
| 18 |
|
| 19 |
+
return $xml_feed->asXML(); // as_formated_xml
|
| 20 |
}
|
| 21 |
|
| 22 |
private function _add_product_fields($xml_product, $product_fields)
|
app/code/community/Wiser/Search/controllers/IndexController.php
CHANGED
|
@@ -98,6 +98,10 @@ class Wiser_Search_IndexController extends Mage_Core_Controller_Front_Action {
|
|
| 98 |
$_Store['contentfeed'] = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . "wiser_search/?store=" . $store->getStoreId() ."&mode=content";
|
| 99 |
|
| 100 |
$_Store['currency'] = $store->getCurrentCurrencyCode();
|
|
|
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
array_push($_Products, $_Store);
|
| 103 |
}
|
|
@@ -118,7 +122,7 @@ class Wiser_Search_IndexController extends Mage_Core_Controller_Front_Action {
|
|
| 118 |
$this->getResponse()->setHttpResponseCode(401);
|
| 119 |
}
|
| 120 |
|
| 121 |
-
private function _buildProductsArray($storeId, $pageNr)
|
| 122 |
{
|
| 123 |
$this->_Products = Mage::getModel('catalog/product')->getCollection();
|
| 124 |
|
|
@@ -127,8 +131,13 @@ class Wiser_Search_IndexController extends Mage_Core_Controller_Front_Action {
|
|
| 127 |
$this->_Products->addAttributeToFilter('visibility', array('gt' => 2));// search only OR catalog, search
|
| 128 |
$this->_Products->addAttributeToSelect('*');
|
| 129 |
|
| 130 |
-
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
}
|
| 133 |
|
| 134 |
private function _sendHeader()
|
| 98 |
$_Store['contentfeed'] = $store->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK) . "wiser_search/?store=" . $store->getStoreId() ."&mode=content";
|
| 99 |
|
| 100 |
$_Store['currency'] = $store->getCurrentCurrencyCode();
|
| 101 |
+
|
| 102 |
+
$this->_buildProductsArray($store->getStoreId(), -1);
|
| 103 |
+
|
| 104 |
+
$_Store['productcount'] = count($this->_ProductIds);
|
| 105 |
|
| 106 |
array_push($_Products, $_Store);
|
| 107 |
}
|
| 122 |
$this->getResponse()->setHttpResponseCode(401);
|
| 123 |
}
|
| 124 |
|
| 125 |
+
private function _buildProductsArray($storeId, $pageNr=-1)
|
| 126 |
{
|
| 127 |
$this->_Products = Mage::getModel('catalog/product')->getCollection();
|
| 128 |
|
| 131 |
$this->_Products->addAttributeToFilter('visibility', array('gt' => 2));// search only OR catalog, search
|
| 132 |
$this->_Products->addAttributeToSelect('*');
|
| 133 |
|
| 134 |
+
// All products
|
| 135 |
+
if( $pageNr == -1 ) {
|
| 136 |
+
$this->_ProductIds = $this->_Products->getAllIds();
|
| 137 |
+
} else {
|
| 138 |
+
$itemsPerPage = 100;
|
| 139 |
+
$this->_ProductIds = $this->_Products->getAllIds($itemsPerPage, ($pageNr - 1) * $itemsPerPage); /* items, offset */
|
| 140 |
+
}
|
| 141 |
}
|
| 142 |
|
| 143 |
private function _sendHeader()
|
app/code/community/Wiser/Search/etc/config.xml
CHANGED
|
@@ -54,7 +54,7 @@
|
|
| 54 |
<default>
|
| 55 |
<wiser_search>
|
| 56 |
<wiser_search_group>
|
| 57 |
-
<extension_version>1.0.
|
| 58 |
</wiser_search_group>
|
| 59 |
</wiser_search>
|
| 60 |
</default>
|
| 54 |
<default>
|
| 55 |
<wiser_search>
|
| 56 |
<wiser_search_group>
|
| 57 |
+
<extension_version>1.0.5</extension_version>
|
| 58 |
</wiser_search_group>
|
| 59 |
</wiser_search>
|
| 60 |
</default>
|
package.xml
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>wiser_search</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Quickly have your search results on screen while typing, advanced statistics and advanced layered navigation</summary>
|
| 10 |
<description>Show search results to your customers while typing, indexes both products and pages. Allows the webshop administrator to view advanced search statistics.</description>
|
| 11 |
-
<notes>-
|
| 12 |
-
-
|
| 13 |
<authors><author><name>Niels - Rejuni</name><user>niels</user><email>niels@rejuni.nl</email></author><author><name>Remco - Rejuni</name><user>remco</user><email>remco@rejuni.nl</email></author></authors>
|
| 14 |
-
<date>2016-02-
|
| 15 |
-
<time>
|
| 16 |
-
<contents><target name="magecommunity"><dir name="Wiser"><dir name="Search"><dir name="Helper"><file name="Data.php" hash="d127ac82b4dd20580f24d1bdc0eb9349"/><file name="ProductData.php" hash="
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.4.0.</min><max>7.0.2.</max></php></required></dependencies>
|
| 19 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>wiser_search</name>
|
| 4 |
+
<version>1.0.5</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://opensource.org/licenses/gpl-license.php">GPL</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Quickly have your search results on screen while typing, advanced statistics and advanced layered navigation</summary>
|
| 10 |
<description>Show search results to your customers while typing, indexes both products and pages. Allows the webshop administrator to view advanced search statistics.</description>
|
| 11 |
+
<notes>- Improved XML parsing
|
| 12 |
+
- Performance improvements</notes>
|
| 13 |
<authors><author><name>Niels - Rejuni</name><user>niels</user><email>niels@rejuni.nl</email></author><author><name>Remco - Rejuni</name><user>remco</user><email>remco@rejuni.nl</email></author></authors>
|
| 14 |
+
<date>2016-02-22</date>
|
| 15 |
+
<time>19:47:51</time>
|
| 16 |
+
<contents><target name="magecommunity"><dir name="Wiser"><dir name="Search"><dir name="Helper"><file name="Data.php" hash="d127ac82b4dd20580f24d1bdc0eb9349"/><file name="ProductData.php" hash="0a73bb2934707925d5ccc671336d18e9"/><file name="SimpleXml.php" hash="ee3906507dd83a9b540e5fb2afaf767e"/><file name="XmlFeed.php" hash="10a19d78c67c8cb85a5aada89ef0cf03"/></dir><dir name="Model"><file name="Observer.php" hash="d2186e3c03b3495cf6dd7d0b326a5bcb"/></dir><dir name="controllers"><file name="IndexController.php" hash="4962af21d293bba9d800a95f1bb4d6d7"/></dir><dir name="etc"><file name="config.xml" hash="a61c723f2f7379b67079eb22980e90c1"/><file name="system.xml" hash="117fc73e288f9e056871ce14aaf2818a"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Wiser_Search.xml" hash="4a518f78635b9e09b5b907a096b1ae91"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="wiser_search.xml" hash="f66cf33d0e88676e86bba6f0c561e485"/></dir><dir name="template"><dir name="wiser_search"><file name="conversion.phtml" hash="01671ab852225eec8384d9faae183be9"/></dir></dir></dir></dir></dir></target></contents>
|
| 17 |
<compatible/>
|
| 18 |
<dependencies><required><php><min>5.4.0.</min><max>7.0.2.</max></php></required></dependencies>
|
| 19 |
</package>
|
