Version Notes
Change Log: https://github.com/algolia/algoliasearch-magento/blob/master/CHANGELOG.md
Download this release
Release Info
Developer | Algolia Team |
Extension | algoliasearch |
Version | 1.7.2 |
Comparing to | |
See all releases |
Code changes from version 1.7.1 to 1.7.2
- app/code/community/Algolia/Algoliasearch/Block/System/Config/Form/Field/CustomRankingProductAttributes.php +5 -6
- app/code/community/Algolia/Algoliasearch/Block/System/Config/Form/Field/Sorts.php +5 -6
- app/code/community/Algolia/Algoliasearch/Helper/.DS_Store +0 -0
- app/code/community/Algolia/Algoliasearch/Helper/Config.php +38 -17
- app/code/community/Algolia/Algoliasearch/Helper/Entity/Additionalsectionshelper.php +1 -1
- app/code/community/Algolia/Algoliasearch/Helper/Entity/Pagehelper.php +1 -1
- app/code/community/Algolia/Algoliasearch/Helper/Entity/Producthelper.php +35 -9
- app/code/community/Algolia/Algoliasearch/Helper/Entity/Suggestionhelper.php +1 -1
- app/code/community/Algolia/Algoliasearch/Model/Indexer/Abstract.php +4 -0
- app/code/community/Algolia/Algoliasearch/Model/Resource/Engine.php +5 -1
- app/code/community/Algolia/Algoliasearch/Model/Resource/Fulltext.php +2 -8
- app/code/community/Algolia/Algoliasearch/etc/config.xml +1 -1
- app/code/community/Algolia/Algoliasearch/etc/system.xml +3 -2
- app/design/frontend/base/default/layout/algoliasearch.xml +3 -0
- app/design/frontend/base/default/template/algoliasearch/instantsearch/stats.phtml +2 -2
- app/etc/modules/Algolia_Algoliasearch.xml +1 -1
- app/locale/en_US/Algolia_Algoliasearch.csv +2 -1
- js/algoliasearch/.DS_Store +0 -0
- js/algoliasearch/autocomplete.js +6 -0
- js/algoliasearch/instantsearch.js +1 -1
- package.xml +4 -4
app/code/community/Algolia/Algoliasearch/Block/System/Config/Form/Field/CustomRankingProductAttributes.php
CHANGED
@@ -14,12 +14,11 @@ class Algolia_Algoliasearch_Block_System_Config_Form_Field_CustomRankingProductA
|
|
14 |
'options' => function () {
|
15 |
$options = array();
|
16 |
|
17 |
-
/** @var
|
18 |
-
$
|
19 |
-
|
20 |
-
$attributes
|
21 |
-
|
22 |
-
$options[$attribute['attribute']] = $attribute['attribute'];
|
23 |
}
|
24 |
|
25 |
$options['custom_attribute'] = '[use custom attribute]';
|
14 |
'options' => function () {
|
15 |
$options = array();
|
16 |
|
17 |
+
/** @var Algolia_Algoliasearch_Helper_Entity_Producthelper $product_helper */
|
18 |
+
$product_helper = Mage::helper('algoliasearch/entity_producthelper');
|
19 |
+
$attributes = $product_helper->getAllAttributes();
|
20 |
+
foreach ($attributes as $key => $label) {
|
21 |
+
$options[$key] = $key ?: $label;
|
|
|
22 |
}
|
23 |
|
24 |
$options['custom_attribute'] = '[use custom attribute]';
|
app/code/community/Algolia/Algoliasearch/Block/System/Config/Form/Field/Sorts.php
CHANGED
@@ -14,12 +14,11 @@ class Algolia_Algoliasearch_Block_System_Config_Form_Field_Sorts extends Algolia
|
|
14 |
'options' => function () {
|
15 |
$options = array();
|
16 |
|
17 |
-
/** @var
|
18 |
-
$
|
19 |
-
|
20 |
-
$attributes
|
21 |
-
|
22 |
-
$options[$attribute['attribute']] = $attribute['attribute'];
|
23 |
}
|
24 |
|
25 |
return $options;
|
14 |
'options' => function () {
|
15 |
$options = array();
|
16 |
|
17 |
+
/** @var Algolia_Algoliasearch_Helper_Entity_Producthelper $product_helper */
|
18 |
+
$product_helper = Mage::helper('algoliasearch/entity_producthelper');
|
19 |
+
$attributes = $product_helper->getAllAttributes();
|
20 |
+
foreach ($attributes as $key => $label) {
|
21 |
+
$options[$key] = $key ?: $label;
|
|
|
22 |
}
|
23 |
|
24 |
return $options;
|
app/code/community/Algolia/Algoliasearch/Helper/.DS_Store
CHANGED
Binary file
|
app/code/community/Algolia/Algoliasearch/Helper/Config.php
CHANGED
@@ -353,7 +353,12 @@ class Algolia_Algoliasearch_Helper_Config extends Mage_Core_Helper_Abstract
|
|
353 |
|
354 |
public function getAPIKey($storeId = null)
|
355 |
{
|
356 |
-
|
|
|
|
|
|
|
|
|
|
|
357 |
}
|
358 |
|
359 |
public function getSearchOnlyAPIKey($storeId = null)
|
@@ -422,26 +427,22 @@ class Algolia_Algoliasearch_Helper_Config extends Mage_Core_Helper_Abstract
|
|
422 |
|
423 |
public function getProductAdditionalAttributes($storeId = null)
|
424 |
{
|
425 |
-
$
|
|
|
426 |
$facets = unserialize(Mage::getStoreConfig(self::FACETS, $storeId));
|
|
|
427 |
|
428 |
-
|
429 |
-
|
430 |
-
if ($facet['attribute'] == $attr['attribute']) {
|
431 |
-
continue 2;
|
432 |
-
}
|
433 |
-
}
|
434 |
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
);
|
441 |
-
}
|
442 |
|
443 |
-
if (is_array($
|
444 |
-
return $
|
445 |
}
|
446 |
|
447 |
return array();
|
@@ -574,4 +575,24 @@ class Algolia_Algoliasearch_Helper_Config extends Mage_Core_Helper_Abstract
|
|
574 |
|
575 |
return array();
|
576 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
577 |
}
|
353 |
|
354 |
public function getAPIKey($storeId = null)
|
355 |
{
|
356 |
+
/** @var Mage_Core_Helper_Data $coreHelper */
|
357 |
+
$coreHelper = Mage::helper('core');
|
358 |
+
|
359 |
+
$encrypted = trim(Mage::getStoreConfig(self::API_KEY, $storeId));
|
360 |
+
|
361 |
+
return $coreHelper->decrypt($encrypted);
|
362 |
}
|
363 |
|
364 |
public function getSearchOnlyAPIKey($storeId = null)
|
427 |
|
428 |
public function getProductAdditionalAttributes($storeId = null)
|
429 |
{
|
430 |
+
$attributes = unserialize(Mage::getStoreConfig(self::PRODUCT_ATTRIBUTES, $storeId));
|
431 |
+
|
432 |
$facets = unserialize(Mage::getStoreConfig(self::FACETS, $storeId));
|
433 |
+
$attributes = $this->addIndexableAttributes($attributes, $facets, '0');
|
434 |
|
435 |
+
$sorts = unserialize(Mage::getStoreConfig(self::SORTING_INDICES, $storeId));
|
436 |
+
$attributes = $this->addIndexableAttributes($attributes, $sorts, '0');
|
|
|
|
|
|
|
|
|
437 |
|
438 |
+
$customRankings = unserialize(Mage::getStoreConfig(self::PRODUCT_CUSTOM_RANKING, $storeId));
|
439 |
+
$customRankings = array_filter($customRankings, function ($customRanking) {
|
440 |
+
return $customRanking['attribute'] != 'custom_attribute';
|
441 |
+
});
|
442 |
+
$attributes = $this->addIndexableAttributes($attributes, $customRankings, '0', '0');
|
|
|
|
|
443 |
|
444 |
+
if (is_array($attributes)) {
|
445 |
+
return $attributes;
|
446 |
}
|
447 |
|
448 |
return array();
|
575 |
|
576 |
return array();
|
577 |
}
|
578 |
+
|
579 |
+
private function addIndexableAttributes($attributes, $addedAttributes, $searchable = '1', $retrievable = '1', $indexNoValue = '1')
|
580 |
+
{
|
581 |
+
foreach ((array) $addedAttributes as $addedAttribute) {
|
582 |
+
foreach ((array) $attributes as $attribute) {
|
583 |
+
if ($addedAttribute['attribute'] == $attribute['attribute']) {
|
584 |
+
continue 2;
|
585 |
+
}
|
586 |
+
}
|
587 |
+
|
588 |
+
$attributes[] = array(
|
589 |
+
'attribute' => $addedAttribute['attribute'],
|
590 |
+
'searchable' => $searchable,
|
591 |
+
'retrievable' => $retrievable,
|
592 |
+
'index_no_value' => $indexNoValue,
|
593 |
+
);
|
594 |
+
}
|
595 |
+
|
596 |
+
return $attributes;
|
597 |
+
}
|
598 |
}
|
app/code/community/Algolia/Algoliasearch/Helper/Entity/Additionalsectionshelper.php
CHANGED
@@ -10,7 +10,7 @@ class Algolia_Algoliasearch_Helper_Entity_Additionalsectionshelper extends Algol
|
|
10 |
public function getIndexSettings($storeId)
|
11 |
{
|
12 |
return array(
|
13 |
-
'attributesToIndex' => array('value'),
|
14 |
);
|
15 |
}
|
16 |
|
10 |
public function getIndexSettings($storeId)
|
11 |
{
|
12 |
return array(
|
13 |
+
'attributesToIndex' => array('unordered(value)'),
|
14 |
);
|
15 |
}
|
16 |
|
app/code/community/Algolia/Algoliasearch/Helper/Entity/Pagehelper.php
CHANGED
@@ -10,7 +10,7 @@ class Algolia_Algoliasearch_Helper_Entity_Pagehelper extends Algolia_Algoliasear
|
|
10 |
public function getIndexSettings($storeId)
|
11 |
{
|
12 |
return array(
|
13 |
-
'attributesToIndex' => array('slug', 'name', 'unordered(content)'),
|
14 |
'attributesToSnippet' => array('content:7'),
|
15 |
);
|
16 |
}
|
10 |
public function getIndexSettings($storeId)
|
11 |
{
|
12 |
return array(
|
13 |
+
'attributesToIndex' => array('unordered(slug)', 'unordered(name)', 'unordered(content)'),
|
14 |
'attributesToSnippet' => array('content:7'),
|
15 |
);
|
16 |
}
|
app/code/community/Algolia/Algoliasearch/Helper/Entity/Producthelper.php
CHANGED
@@ -25,6 +25,8 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
|
|
25 |
'special_to_date',
|
26 |
);
|
27 |
|
|
|
|
|
28 |
protected function getIndexNameSuffix()
|
29 |
{
|
30 |
return '_products';
|
@@ -614,14 +616,14 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
|
|
614 |
}
|
615 |
}
|
616 |
|
617 |
-
protected function getValueOrValueText(Mage_Catalog_Model_Product $product, $name, Mage_Catalog_Model_Resource_Eav_Attribute $resource
|
618 |
{
|
619 |
$value_text = $product->getAttributeText($name);
|
620 |
if (!$value_text) {
|
621 |
$value_text = $resource->getFrontend()->getValue($product);
|
622 |
}
|
623 |
|
624 |
-
return $value_text
|
625 |
}
|
626 |
|
627 |
public function getObject(Mage_Catalog_Model_Product $product)
|
@@ -869,6 +871,8 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
|
|
869 |
}
|
870 |
}
|
871 |
|
|
|
|
|
872 |
foreach ($additionalAttributes as $attribute) {
|
873 |
$attribute_name = $attribute['attribute'];
|
874 |
if (isset($customData[$attribute_name])) {
|
@@ -877,9 +881,6 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
|
|
877 |
|
878 |
$value = $product->getData($attribute_name);
|
879 |
|
880 |
-
// To be more compatible (no backend save required after update), if index_no_value isn't set it's true
|
881 |
-
$index_no_value = !isset($attribute['index_no_value']) || $attribute['index_no_value'] == 1 ? true : false;
|
882 |
-
|
883 |
/** @var Mage_Catalog_Model_Resource_Eav_Attribute $attribute_resource */
|
884 |
$attribute_resource = $product->getResource()->getAttribute($attribute_name);
|
885 |
|
@@ -894,7 +895,7 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
|
|
894 |
if ($value === null) {
|
895 |
$values = array();
|
896 |
} else {
|
897 |
-
$values = array($this->getValueOrValueText($product, $attribute_name, $attribute_resource
|
898 |
}
|
899 |
|
900 |
$all_sub_products_out_of_stock = true;
|
@@ -912,8 +913,7 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
|
|
912 |
$value = $sub_product->getData($attribute_name);
|
913 |
|
914 |
if ($value) {
|
915 |
-
$values[] = $this->getValueOrValueText($sub_product, $attribute_name,
|
916 |
-
$attribute_resource, $index_no_value);
|
917 |
}
|
918 |
}
|
919 |
}
|
@@ -928,7 +928,7 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
|
|
928 |
$customData['in_stock'] = 0;
|
929 |
}
|
930 |
} elseif (!is_array($value)) {
|
931 |
-
$value = $this->getValueOrValueText($product, $attribute_name, $attribute_resource
|
932 |
}
|
933 |
|
934 |
if ($value && !isset($customData[$attribute_name])) {
|
@@ -957,6 +957,8 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
|
|
957 |
|
958 |
$this->castProductObject($customData);
|
959 |
|
|
|
|
|
960 |
$this->logger->stop('CREATE RECORD '.$product->getId().' '.$this->logger->getStoreName($product->storeId));
|
961 |
|
962 |
return $customData;
|
@@ -976,4 +978,28 @@ class Algolia_Algoliasearch_Helper_Entity_Producthelper extends Algolia_Algolias
|
|
976 |
{
|
977 |
return array_map('trim', explode(',', $synonyms));
|
978 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
979 |
}
|
25 |
'special_to_date',
|
26 |
);
|
27 |
|
28 |
+
private $noAttributes = array();
|
29 |
+
|
30 |
protected function getIndexNameSuffix()
|
31 |
{
|
32 |
return '_products';
|
616 |
}
|
617 |
}
|
618 |
|
619 |
+
protected function getValueOrValueText(Mage_Catalog_Model_Product $product, $name, Mage_Catalog_Model_Resource_Eav_Attribute $resource)
|
620 |
{
|
621 |
$value_text = $product->getAttributeText($name);
|
622 |
if (!$value_text) {
|
623 |
$value_text = $resource->getFrontend()->getValue($product);
|
624 |
}
|
625 |
|
626 |
+
return $value_text;
|
627 |
}
|
628 |
|
629 |
public function getObject(Mage_Catalog_Model_Product $product)
|
871 |
}
|
872 |
}
|
873 |
|
874 |
+
$this->setNoAttributes($additionalAttributes);
|
875 |
+
|
876 |
foreach ($additionalAttributes as $attribute) {
|
877 |
$attribute_name = $attribute['attribute'];
|
878 |
if (isset($customData[$attribute_name])) {
|
881 |
|
882 |
$value = $product->getData($attribute_name);
|
883 |
|
|
|
|
|
|
|
884 |
/** @var Mage_Catalog_Model_Resource_Eav_Attribute $attribute_resource */
|
885 |
$attribute_resource = $product->getResource()->getAttribute($attribute_name);
|
886 |
|
895 |
if ($value === null) {
|
896 |
$values = array();
|
897 |
} else {
|
898 |
+
$values = array($this->getValueOrValueText($product, $attribute_name, $attribute_resource));
|
899 |
}
|
900 |
|
901 |
$all_sub_products_out_of_stock = true;
|
913 |
$value = $sub_product->getData($attribute_name);
|
914 |
|
915 |
if ($value) {
|
916 |
+
$values[] = $this->getValueOrValueText($sub_product, $attribute_name, $attribute_resource);
|
|
|
917 |
}
|
918 |
}
|
919 |
}
|
928 |
$customData['in_stock'] = 0;
|
929 |
}
|
930 |
} elseif (!is_array($value)) {
|
931 |
+
$value = $this->getValueOrValueText($product, $attribute_name, $attribute_resource);
|
932 |
}
|
933 |
|
934 |
if ($value && !isset($customData[$attribute_name])) {
|
957 |
|
958 |
$this->castProductObject($customData);
|
959 |
|
960 |
+
$customData = $this->clearNoValues($customData);
|
961 |
+
|
962 |
$this->logger->stop('CREATE RECORD '.$product->getId().' '.$this->logger->getStoreName($product->storeId));
|
963 |
|
964 |
return $customData;
|
978 |
{
|
979 |
return array_map('trim', explode(',', $synonyms));
|
980 |
}
|
981 |
+
|
982 |
+
private function setNoAttributes($attributes)
|
983 |
+
{
|
984 |
+
foreach ($attributes as $attribute) {
|
985 |
+
if ($attribute['index_no_value'] !== '1') {
|
986 |
+
$this->noAttributes[$attribute['attribute']] = 1;
|
987 |
+
}
|
988 |
+
}
|
989 |
+
}
|
990 |
+
|
991 |
+
private function clearNoValues($customData, $rootLevel = true)
|
992 |
+
{
|
993 |
+
foreach ($customData as $attribute => $value) {
|
994 |
+
if (is_array($value) && $rootLevel && isset($this->noAttributes[$attribute])) {
|
995 |
+
$customData[$attribute] = $this->clearNoValues($value, false);
|
996 |
+
}
|
997 |
+
|
998 |
+
if (($rootLevel !== true || isset($this->noAttributes[$attribute])) && $value === Mage::helper('catalog')->__('No')) {
|
999 |
+
unset($customData[$attribute]);
|
1000 |
+
}
|
1001 |
+
}
|
1002 |
+
|
1003 |
+
return $customData;
|
1004 |
+
}
|
1005 |
}
|
app/code/community/Algolia/Algoliasearch/Helper/Entity/Suggestionhelper.php
CHANGED
@@ -13,7 +13,7 @@ class Algolia_Algoliasearch_Helper_Entity_Suggestionhelper extends Algolia_Algol
|
|
13 |
public function getIndexSettings($storeId)
|
14 |
{
|
15 |
return array(
|
16 |
-
'attributesToIndex' => array('query'),
|
17 |
'customRanking' => array('desc(popularity)', 'desc(number_of_results)', 'asc(date)'),
|
18 |
'typoTolerance' => false,
|
19 |
'attributesToRetrieve' => array('query'),
|
13 |
public function getIndexSettings($storeId)
|
14 |
{
|
15 |
return array(
|
16 |
+
'attributesToIndex' => array('unordered(query)'),
|
17 |
'customRanking' => array('desc(popularity)', 'desc(number_of_results)', 'asc(date)'),
|
18 |
'typoTolerance' => false,
|
19 |
'attributesToRetrieve' => array('query'),
|
app/code/community/Algolia/Algoliasearch/Model/Indexer/Abstract.php
CHANGED
@@ -87,6 +87,10 @@ abstract class Algolia_Algoliasearch_Model_Indexer_Abstract extends Mage_Index_M
|
|
87 |
/** @var Mage_Catalog_Model_Product $product */
|
88 |
$product = Mage::getModel('catalog/product')->loadByAttribute('entity_id', $productId);
|
89 |
|
|
|
|
|
|
|
|
|
90 |
return $product->isComposite();
|
91 |
}
|
92 |
}
|
87 |
/** @var Mage_Catalog_Model_Product $product */
|
88 |
$product = Mage::getModel('catalog/product')->loadByAttribute('entity_id', $productId);
|
89 |
|
90 |
+
if ($product === false) {
|
91 |
+
return false;
|
92 |
+
}
|
93 |
+
|
94 |
return $product->isComposite();
|
95 |
}
|
96 |
}
|
app/code/community/Algolia/Algoliasearch/Model/Resource/Engine.php
CHANGED
@@ -171,7 +171,7 @@ class Algolia_Algoliasearch_Model_Resource_Engine extends Mage_CatalogSearch_Mod
|
|
171 |
return $this;
|
172 |
}
|
173 |
|
174 |
-
public function rebuildProducts()
|
175 |
{
|
176 |
$this->saveSettings(true);
|
177 |
|
@@ -179,6 +179,10 @@ class Algolia_Algoliasearch_Model_Resource_Engine extends Mage_CatalogSearch_Mod
|
|
179 |
foreach (Mage::app()->getStores() as $store) {
|
180 |
$storeId = $store->getId();
|
181 |
|
|
|
|
|
|
|
|
|
182 |
if ($this->config->isEnabledBackend($storeId) === false) {
|
183 |
if (php_sapi_name() === 'cli') {
|
184 |
echo '[ALGOLIA] INDEXING IS DISABLED FOR '.$this->logger->getStoreName($storeId)."\n";
|
171 |
return $this;
|
172 |
}
|
173 |
|
174 |
+
public function rebuildProducts($reindexStoreId = null)
|
175 |
{
|
176 |
$this->saveSettings(true);
|
177 |
|
179 |
foreach (Mage::app()->getStores() as $store) {
|
180 |
$storeId = $store->getId();
|
181 |
|
182 |
+
if ($reindexStoreId !== null && $storeId != $reindexStoreId) {
|
183 |
+
continue;
|
184 |
+
}
|
185 |
+
|
186 |
if ($this->config->isEnabledBackend($storeId) === false) {
|
187 |
if (php_sapi_name() === 'cli') {
|
188 |
echo '[ALGOLIA] INDEXING IS DISABLED FOR '.$this->logger->getStoreName($storeId)."\n";
|
app/code/community/Algolia/Algoliasearch/Model/Resource/Fulltext.php
CHANGED
@@ -52,7 +52,7 @@ class Algolia_Algoliasearch_Model_Resource_Fulltext extends Mage_CatalogSearch_M
|
|
52 |
$session = Mage::getSingleton('adminhtml/session');
|
53 |
$session->addError('Algolia reindexing failed: You need to configure your Algolia credentials in System > Configuration > Algolia Search.');
|
54 |
|
55 |
-
return;
|
56 |
}
|
57 |
|
58 |
/* Avoid Indexing twice */
|
@@ -60,13 +60,7 @@ class Algolia_Algoliasearch_Model_Resource_Fulltext extends Mage_CatalogSearch_M
|
|
60 |
return $this;
|
61 |
}
|
62 |
|
63 |
-
|
64 |
-
foreach (Mage::app()->getStores() as $id => $store) {
|
65 |
-
$this->engine->rebuildProductIndex($id, null);
|
66 |
-
}
|
67 |
-
} else {
|
68 |
-
$this->engine->rebuildProductIndex($storeId, null);
|
69 |
-
}
|
70 |
|
71 |
return $this;
|
72 |
}
|
52 |
$session = Mage::getSingleton('adminhtml/session');
|
53 |
$session->addError('Algolia reindexing failed: You need to configure your Algolia credentials in System > Configuration > Algolia Search.');
|
54 |
|
55 |
+
return null;
|
56 |
}
|
57 |
|
58 |
/* Avoid Indexing twice */
|
60 |
return $this;
|
61 |
}
|
62 |
|
63 |
+
$this->engine->rebuildProducts($storeId);
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
return $this;
|
66 |
}
|
app/code/community/Algolia/Algoliasearch/etc/config.xml
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Algolia_Algoliasearch>
|
5 |
-
<version>1.7.
|
6 |
</Algolia_Algoliasearch>
|
7 |
</modules>
|
8 |
<frontend>
|
2 |
<config>
|
3 |
<modules>
|
4 |
<Algolia_Algoliasearch>
|
5 |
+
<version>1.7.2</version>
|
6 |
</Algolia_Algoliasearch>
|
7 |
</modules>
|
8 |
<frontend>
|
app/code/community/Algolia/Algoliasearch/etc/system.xml
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
<algoliasearch translate="label" module="algoliasearch">
|
5 |
<label>
|
6 |
<![CDATA[
|
7 |
-
Algolia Search 1.7.
|
8 |
<style>
|
9 |
.algoliasearch-admin-menu span {
|
10 |
padding-left: 38px !important;
|
@@ -118,7 +118,8 @@
|
|
118 |
</application_id>
|
119 |
<api_key translate="label">
|
120 |
<label>Admin API key</label>
|
121 |
-
<frontend_type>
|
|
|
122 |
<sort_order>30</sort_order>
|
123 |
<show_in_default>1</show_in_default>
|
124 |
<show_in_website>1</show_in_website>
|
4 |
<algoliasearch translate="label" module="algoliasearch">
|
5 |
<label>
|
6 |
<![CDATA[
|
7 |
+
Algolia Search 1.7.2
|
8 |
<style>
|
9 |
.algoliasearch-admin-menu span {
|
10 |
padding-left: 38px !important;
|
118 |
</application_id>
|
119 |
<api_key translate="label">
|
120 |
<label>Admin API key</label>
|
121 |
+
<frontend_type>obscure</frontend_type>
|
122 |
+
<backend_model>adminhtml/system_config_backend_encrypted</backend_model>
|
123 |
<sort_order>30</sort_order>
|
124 |
<show_in_default>1</show_in_default>
|
125 |
<show_in_website>1</show_in_website>
|
app/design/frontend/base/default/layout/algoliasearch.xml
CHANGED
@@ -42,6 +42,9 @@
|
|
42 |
<block type="core/template" template="algoliasearch/instantsearch/stats.phtml" name="algolia-instantsearch-stats"/>
|
43 |
<block type="core/template" template="algoliasearch/instantsearch/refinementsItem.phtml" name="algolia-instantsearch-refinements-item"/>
|
44 |
<block type="core/template" template="algoliasearch/instantsearch/currentRefinements.phtml" name="algolia-instantsearch-current-refinments"/>
|
|
|
|
|
|
|
45 |
</reference>
|
46 |
|
47 |
<reference name="content">
|
42 |
<block type="core/template" template="algoliasearch/instantsearch/stats.phtml" name="algolia-instantsearch-stats"/>
|
43 |
<block type="core/template" template="algoliasearch/instantsearch/refinementsItem.phtml" name="algolia-instantsearch-refinements-item"/>
|
44 |
<block type="core/template" template="algoliasearch/instantsearch/currentRefinements.phtml" name="algolia-instantsearch-current-refinments"/>
|
45 |
+
|
46 |
+
<!-- INSERT YOUR CUSTOM TEMPLATES HERE -->
|
47 |
+
<!-- Example: <block type="core/template" template="algoliasearch/[autocomplete_or_instantsearch]/your_custom_template_name.phtml" name="algolia-your-custom-template-name"/> -->
|
48 |
</reference>
|
49 |
|
50 |
<reference name="content">
|
app/design/frontend/base/default/template/algoliasearch/instantsearch/stats.phtml
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<!-- Search statistics template (used for displaying hits' count and time of query) -->
|
2 |
<script type="text/template" id="instant-stats-template">
|
3 |
{{#hasOneResult}}
|
4 |
-
<strong>1</strong> <?php echo $this->__('result'); ?>
|
5 |
{{/hasOneResult}}
|
6 |
|
7 |
{{#hasManyResults}}
|
8 |
{{^hasNoResults}}
|
9 |
-
{{first}}-{{last}} out of
|
10 |
{{/hasNoResults}}
|
11 |
<strong>{{#helpers.formatNumber}}{{nbHits}}{{/helpers.formatNumber}} <?php echo $this->__('results found'); ?></strong>
|
12 |
{{/hasManyResults}}
|
1 |
<!-- Search statistics template (used for displaying hits' count and time of query) -->
|
2 |
<script type="text/template" id="instant-stats-template">
|
3 |
{{#hasOneResult}}
|
4 |
+
<strong>1</strong> <?php echo $this->__('result found'); ?>
|
5 |
{{/hasOneResult}}
|
6 |
|
7 |
{{#hasManyResults}}
|
8 |
{{^hasNoResults}}
|
9 |
+
{{first}}-{{last}} <?php echo $this->__('out of'); ?>
|
10 |
{{/hasNoResults}}
|
11 |
<strong>{{#helpers.formatNumber}}{{nbHits}}{{/helpers.formatNumber}} <?php echo $this->__('results found'); ?></strong>
|
12 |
{{/hasManyResults}}
|
app/etc/modules/Algolia_Algoliasearch.xml
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
<Algolia_Algoliasearch>
|
5 |
<active>true</active>
|
6 |
<codePool>community</codePool>
|
7 |
-
<version>1.7.
|
8 |
</Algolia_Algoliasearch>
|
9 |
</modules>
|
10 |
</config>
|
4 |
<Algolia_Algoliasearch>
|
5 |
<active>true</active>
|
6 |
<codePool>community</codePool>
|
7 |
+
<version>1.7.2</version>
|
8 |
</Algolia_Algoliasearch>
|
9 |
</modules>
|
10 |
</config>
|
app/locale/en_US/Algolia_Algoliasearch.csv
CHANGED
@@ -38,8 +38,9 @@
|
|
38 |
"Search for products", "Search for products"
|
39 |
"SORT BY", "SORT BY"
|
40 |
"Add to Cart", "Add to Cart"
|
41 |
-
"result", "result"
|
42 |
"results found", "results found"
|
|
|
43 |
"seconds", "seconds"
|
44 |
"Relevance", "Relevance"
|
45 |
"No products for query", "No products for query"
|
38 |
"Search for products", "Search for products"
|
39 |
"SORT BY", "SORT BY"
|
40 |
"Add to Cart", "Add to Cart"
|
41 |
+
"result found", "result found"
|
42 |
"results found", "results found"
|
43 |
+
"out of", "out of"
|
44 |
"seconds", "seconds"
|
45 |
"Relevance", "Relevance"
|
46 |
"No products for query", "No products for query"
|
js/algoliasearch/.DS_Store
CHANGED
Binary file
|
js/algoliasearch/autocomplete.js
CHANGED
@@ -54,6 +54,10 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
|
54 |
}
|
55 |
});
|
56 |
|
|
|
|
|
|
|
|
|
57 |
/**
|
58 |
* Setup the autocomplete search input
|
59 |
* For autocomplete feature is used Algolia's autocomplete.js library
|
@@ -84,6 +88,8 @@ document.addEventListener("DOMContentLoaded", function(event) {
|
|
84 |
})
|
85 |
.on('autocomplete:updated', function (e) {
|
86 |
fixAutocompleteCssHeight(menu);
|
|
|
|
|
87 |
});
|
88 |
|
89 |
$(window).resize(function () {
|
54 |
}
|
55 |
});
|
56 |
|
57 |
+
/**
|
58 |
+
* ADD YOUR CUSTOM DATA SOURCE HERE
|
59 |
+
**/
|
60 |
+
|
61 |
/**
|
62 |
* Setup the autocomplete search input
|
63 |
* For autocomplete feature is used Algolia's autocomplete.js library
|
88 |
})
|
89 |
.on('autocomplete:updated', function (e) {
|
90 |
fixAutocompleteCssHeight(menu);
|
91 |
+
}).on('autocomplete:selected', function (e, suggestion, dataset) {
|
92 |
+
location.assign(suggestion.url);
|
93 |
});
|
94 |
|
95 |
$(window).resize(function () {
|
js/algoliasearch/instantsearch.js
CHANGED
@@ -196,7 +196,7 @@ document.addEventListener("DOMContentLoaded", function (event) {
|
|
196 |
}
|
197 |
|
198 |
content += '</div>';
|
199 |
-
content += algoliaConfig.translations.or + ' <a href="' + algoliaConfig.baseUrl + '/catalogsearch/result/?q=__empty__">' + algoliaConfig.translations.seeAll + '</a>'
|
200 |
|
201 |
content += '</div>';
|
202 |
|
196 |
}
|
197 |
|
198 |
content += '</div>';
|
199 |
+
content += algoliaConfig.translations.or + ' <a href="' + algoliaConfig.baseUrl + '/catalogsearch/result/?q=__empty__">' + algoliaConfig.translations.seeAll + '</a>';
|
200 |
|
201 |
content += '</div>';
|
202 |
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>algoliasearch</name>
|
4 |
-
<version>1.7.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://github.com/algolia/algoliasearch-magento/blob/master/LICENSE.txt">MIT</license>
|
7 |
<channel>community</channel>
|
@@ -15,9 +15,9 @@
|
|
15 |
</description>
|
16 |
<notes>Change Log: https://github.com/algolia/algoliasearch-magento/blob/master/CHANGELOG.md</notes>
|
17 |
<authors><author><name>Algolia Team</name><user>algolia</user><email>support@algolia.com</email></author></authors>
|
18 |
-
<date>2016-10-
|
19 |
-
<time>
|
20 |
-
<contents><target name="mageetc"><dir name="modules"><file name="Algolia_Algoliasearch.xml" hash="
|
21 |
<compatible/>
|
22 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><extension><name>curl</name><min>7.16.2</min><max/></extension><extension><name>json</name><min/><max/></extension></required></dependencies>
|
23 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>algoliasearch</name>
|
4 |
+
<version>1.7.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="https://github.com/algolia/algoliasearch-magento/blob/master/LICENSE.txt">MIT</license>
|
7 |
<channel>community</channel>
|
15 |
</description>
|
16 |
<notes>Change Log: https://github.com/algolia/algoliasearch-magento/blob/master/CHANGELOG.md</notes>
|
17 |
<authors><author><name>Algolia Team</name><user>algolia</user><email>support@algolia.com</email></author></authors>
|
18 |
+
<date>2016-10-28</date>
|
19 |
+
<time>12:31:16</time>
|
20 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Algolia_Algoliasearch.xml" hash="9ee7db03dfac16ccaf4475122ee6b761"/></dir></target><target name="magecommunity"><dir name="Algolia"><dir name="Algoliasearch"><dir name="Block"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="AbstractField.php" hash="c5b2a65b11d5993e385234367689c10d"/><file name="AdditionalSections.php" hash="f8f8e2d9385b8aa3dcc79987a832d284"/><file name="CategoryAdditionalAttributes.php" hash="cec9f23859bfd3328305dafcbec9cf68"/><file name="CustomRankingCategoryAttributes.php" hash="90e976e6c636d3df2f13cd843e2184fa"/><file name="CustomRankingProductAttributes.php" hash="7540e89be193568c069b21d225964be7"/><file name="ExcludedPages.php" hash="0119009da0f9b5daef8fd66854ae0661"/><file name="Facets.php" hash="893e9599b639593ed6897a27edb8d7e3"/><file name="OnewaySynonyms.php" hash="f1ff6ae2e8bc4cc61238e399564d46b6"/><file name="ProductAdditionalAttributes.php" hash="5eed1b4abcb3d51f35702bdf0743ee61"/><file name="Select.php" hash="e9521a9c869b427bca0fe57ea92288a1"/><file name="Sorts.php" hash="c40feb1c0adfc303f96ce8ca47724a19"/><file name="Synonyms.php" hash="ee555973c7c2f385240b168cd58047e5"/></dir></dir></dir></dir></dir><dir name="Helper"><file name="Algoliahelper.php" hash="73c4d04272a894d9520da2e3425595cf"/><file name="Config.php" hash="9e5bd3a203a2f3949e425f65e2c583b5"/><file name="Data.php" hash="b83ee250513ea3c716fc341df4eee6e4"/><dir name="Entity"><file name="Additionalsectionshelper.php" hash="c37399a0359a76c2b33ca1d12d747cb3"/><file name="Categoryhelper.php" hash="2a53476b8d36d727b13e726cb4ea0f3d"/><file name="Helper.php" hash="18b2fd9d5acb7eb4fe4dca11903a9766"/><file name="Pagehelper.php" hash="7a71f9f824e6cad7d4458e8e18579dbb"/><file name="Producthelper.php" hash="ac98afa7cd1b7f16efb359c73b228cae"/><file name="Suggestionhelper.php" hash="cda68c4d6ce082bd1c33435db3bbb971"/></dir><file name="Image.php" hash="5c8aba6fd77c0c0796a8ac67f9769c84"/><file name="Logger.php" hash="9f1d1ceb9059a98746aa9fd473549449"/><file name=".DS_Store" hash="45eb27e8591a0f709d87531296fcf1d7"/></dir><dir name="Model"><dir name="Indexer"><file name="Abstract.php" hash="17fc52ea42d0f5ea357ec7786882a473"/><file name="Algolia.php" hash="862887c085e701eabde47e8f9b540585"/><file name="Algoliaadditionalsections.php" hash="bb065ba1adc4fef1e820fc7baa88ce7f"/><file name="Algoliacategories.php" hash="49b00c33b47a349d34c19281ab9e0215"/><file name="Algoliapages.php" hash="c782fb36d45b478a41918abb98a869d4"/><file name="Algoliaqueuerunner.php" hash="e2cd5b4022e5003367e6c81f0912b783"/><file name="Algoliasuggestions.php" hash="069aeb9955aef734ebd3fa969d634865"/></dir><file name="Observer.php" hash="33288dcb47f9bd75c9bd6cfcac947db1"/><file name="Queue.php" hash="fc0a1ce0e6018e26b55645b0bdee24d5"/><dir name="Resource"><file name="Engine.php" hash="0bd11f20d7c09898213c3a1ce3e5a0dd"/><dir name="Fulltext"><file name="Collection.php" hash="71ec86131861c132d7383bf9cb327b02"/></dir><file name="Fulltext.php" hash="b662e692f0a32428764f15f7db2b07d0"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="SynonymsFile.php" hash="12b218765f015ea31f03da822f4c2ca5"/></dir></dir><file name="Imagetype.php" hash="1391d49853b94714080de07fc662a831"/><file name="Removewords.php" hash="9b7d40d7ccf11d6d5fa101c8b06c5b9e"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="07edd7bca541d4dbeba73c2b70ec53a2"/><file name="config.xml" hash="fcc045b70908497276d132ce808a13aa"/><file name="system.xml" hash="4c29e89e96589b06a4e07c69f94d776f"/></dir><dir name="sql"><dir name="algoliasearch_setup"><file name="mysql4-install-0.1.0.php" hash="561f4f9e9f7021061964330a6c1eccec"/><file name="mysql4-upgrade-0.1.0-1.4.8.php" hash="1fae6deaf608f812844c8639b178cbc7"/><file name="mysql4-upgrade-1.4.8-1.5.0.php" hash="a7eaf9d86daeb0686b1cf03f9ed9c817"/><file name="mysql4-upgrade-1.5.5-1.6.0.php" hash="3aeb056f347896a0ddf888cefd21bfeb"/><file name="mysql4-upgrade-1.6.0-1.7.1.php" hash="e7854e9d144ca79894b07252488535e8"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="algoliasearch.xml" hash="58543413c69185fd8016db48c9d4522a"/></dir><dir name="template"><dir name="algoliasearch"><dir name="autocomplete"><file name="attribute.phtml" hash="3824426911a04e6eb82231823864ca36"/><file name="category.phtml" hash="5d1d7184c77353b0a351be9be4ab7ce6"/><file name="menu.phtml" hash="61b58ab6e3be1ac57a58744b887bcf62"/><file name="page.phtml" hash="1ae9460533070a9171fbc2edde06785e"/><file name="product.phtml" hash="826ee0dfebf3163a8737dc16d71a1a79"/><file name="suggestion.phtml" hash="819b312e34e41d7fa267ed776f45b8b4"/></dir><file name="autocomplete.phtml" hash="f459643574e8cbcff4642168ed5303e7"/><dir name="instantsearch"><file name="currentRefinements.phtml" hash="be70be35514f4ec2b8c52e1174a035bb"/><file name="hit.phtml" hash="29bcbf21091654df8b78bb0c5d81bd34"/><file name="refinementsItem.phtml" hash="9e3e31dde749ae01b28fc288ff09ded0"/><file name="stats.phtml" hash="6460c77e5cad476058226ec1f8dba0f9"/><file name="wrapper.phtml" hash="079a5326141c4b103de4f342bdef01a2"/></dir><dir name="internals"><file name="beforecontent.phtml" hash="19f2ee9532f4e46c77ade0157976b780"/><file name="configuration.phtml" hash="aa0ad059704cad3af938f083031783ed"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="algoliasearch"><file name="adminjs.phtml" hash="1c287afa9e605e0a82270708997e2191"/></dir></dir><dir name="layout"><file name="algoliasearch.xml" hash="f49d4d2a5328f7f0a260eaaa0fcb1d19"/></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="algoliasearch"><file name="algolia-admin-menu.png" hash="9202a559c30a43d4d4bbc2f9ee774fd9"/><file name="algolia-logo.png" hash="97425d16ed375d5c3c048a5541a74df9"/><file name="algoliasearch.css" hash="28d18bc7565098165ff629e1d4483d0a"/><dir name="images"><file name="ui-bg_diagonals-thick_18_b81900_40x40.png" hash="62568c006bb1066f40fd5f9cfe4489be"/><file name="ui-bg_diagonals-thick_20_666666_40x40.png" hash="406541454ec466d93217826588335194"/><file name="ui-bg_flat_10_000000_40x100.png" hash="85243ed808c91ae60d33bda3a6bdee3c"/><file name="ui-bg_glass_100_f6f6f6_1x400.png" hash="f912ffca9b1919ab26c64cf1332c5322"/><file name="ui-bg_glass_100_fdf5ce_1x400.png" hash="a9b41e3f4db0fb9be1cd2c649deb253f"/><file name="ui-bg_glass_65_ffffff_1x400.png" hash="ff9e9b45e03f11808144324fd5350612"/><file name="ui-bg_gloss-wave_35_f6a828_500x100.png" hash="08ece8908c07b1c0d18b8db076ff50fc"/><file name="ui-bg_highlight-soft_100_eeeeee_1x100.png" hash="72fe4b0e1bbb83dfd6787989d3583fbe"/><file name="ui-bg_highlight-soft_75_ffe45c_1x100.png" hash="81262299ac7f591fd1763c1ccee0691f"/><file name="ui-icons_222222_256x240.png" hash="3a3c5468f484f07ac4a320d9e22acb8c"/><file name="ui-icons_228ef1_256x240.png" hash="92b29683b6a48eae7de7eb4b1cfa039c"/><file name="ui-icons_ef8c08_256x240.png" hash="f492970693640894fb54166c75dd2925"/><file name="ui-icons_ffd27a_256x240.png" hash="dda1b6f694b0d196aefc66a1d6d758f6"/><file name="ui-icons_ffffff_256x240.png" hash="41612b0f4a034424f8321c9f824a94da"/></dir><file name=".DS_Store" hash="54199b2c67f3a34fb072f6b0f0ea12d8"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="algoliasearch"><file name="autocomplete.js" hash="1c64a6eebf21718889dcc1a3b99c24c3"/><file name="instantsearch.js" hash="271504a6f7764052338299b65b9a9ecd"/><dir name="internals"><dir name="adminhtml"><file name="admin_scripts.js" hash="ad31275773b26a575285d532e527ccaf"/><file name="algoliaAdminBundle.min.js" hash="b5eef6308cf24135c95769ccd501acf1"/><file name="algoliaAdminBundle.min.js.map" hash="64f4b8e7dc46a45096f27fe4a3b612fd"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><dir name="frontend"><file name="Function.prototype.bind.js" hash="eb15975feb0cc976face88cb194294ae"/><file name="algoliaBundle.min.js" hash="3f9c7aa6450fcc8f07e43d3fbaf67fc8"/><file name="algoliaBundle.min.js.map" hash="08123c593d7370cd77b67bf5783aaa9b"/><file name="common.js" hash="e1629a2a3d9aee1d227d2a393fb4b3d6"/><file name=".DS_Store" hash="194577a7e20bdcc7afbb718f502c134c"/></dir><file name=".DS_Store" hash="a45e62f7e16186820fbaf15726c910ef"/></dir><file name=".DS_Store" hash="a4f8c99c4ec5e8877ed0b5db7463cd74"/></dir></dir><dir name="lib"><dir name="AlgoliaSearch"><file name="AlgoliaException.php" hash="47e71cc8e04b8be4d1787580179004d2"/><file name="Client.php" hash="449e78af7467ffc93661ceca5ef4c9ee"/><file name="ClientContext.php" hash="86bdbc600f771a2beaead4ee85374d6e"/><file name="Index.php" hash="4527c2c1a4538101a33307f735613089"/><file name="IndexBrowser.php" hash="0264b1fb79575229a43627c1c12273ec"/><file name="Json.php" hash="b8790ee1406037369803fa606f258699"/><file name="PlacesIndex.php" hash="bd5f8c04de2573528d44e5277250212a"/><file name="SynonymType.php" hash="9d561527010de52acf1b88daa3100570"/><file name="Version.php" hash="6e5e88974dafae2b36cf6db838a6b49e"/><file name="loader.php" hash="7263343ae5271480b7a5ee92b451ca09"/><dir name="resources"><file name="ca-bundle.crt" hash="47961e7ef15667c93cd99be01b51f00a"/></dir><file name=".DS_Store" hash="50c2aebe3913ec5a14b5298371d00c28"/></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Algolia_Algoliasearch.csv" hash="5eeeecf4a6ac60b207cecd8d44ba9302"/></dir></target></contents>
|
21 |
<compatible/>
|
22 |
<dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php><extension><name>curl</name><min>7.16.2</min><max/></extension><extension><name>json</name><min/><max/></extension></required></dependencies>
|
23 |
</package>
|