Skip to content

Commit 4a033e1

Browse files
author
Jan Petr
authored
Merge pull request #627 from algolia/develop
Develop
2 parents cff6d98 + ff009f2 commit 4a033e1

File tree

30 files changed

+592
-513
lines changed

30 files changed

+592
-513
lines changed

.styleci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
preset: PSR2
2+
23
linting: true
4+
5+
enabled:
6+
- long_array_syntax
7+
38
finder:
49
path:
5-
- "code"
10+
- "app/code"

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
## Change Log
22

3+
### 1.7.1
4+
5+
#### FEATURES
6+
- Option to stop the extension from overriding synonyms (#580)
7+
- New attribute `main_categories` which contains product's category structure without path (#581)
8+
- Option to index only categories where product actually is without it's parent categories (#584)
9+
- **Breaks hierarchical widget, use wisely**
10+
- Option to display popular queries (suggestions) without categories (#586)
11+
- Option to reindex all category's products on category save (#598)
12+
- Option to use non-selectable attribute as custom ranking by writing it's name in configuration (#603)
13+
- Added categories' level attributes to Products' Attributes select boxes so it's possible to use specific levels for relevancy purposes (#621)
14+
15+
#### UPDATES
16+
- Improved relevancy for suggestions by setting [removeWordsIfNoResults](https://www.algolia.com/doc/api-client/php/parameters#removewordsifnoresults) to `lastWords` (#575)
17+
- All CSS selectors were prefixed with Algolia containers and unused styles were removed (#578)
18+
- **BC break** - please check the look & feel of your results
19+
- The note about new version is less agressive and does not feel as error anymore (#579)
20+
- Bundled products now does not take news dates and special price dates from it's sub-products (#580)
21+
- New versions of [instantsearch.js](https://github.com/algolia/instantsearch.js) and [autocomplete.js](https://github.com/algolia/autocomplete.js) libraries (#588)
22+
- Column `data` in `algoliasearch_queue` table changed to LONGTEXT (#596, #597)
23+
- Optimized number of products processed by removing duplicate products from processing (#599)
24+
- Enable to select `in_stock` attribute as attribute for faceting (#602)
25+
- Updated PHP client (#611)
26+
- Updated "Disable extension" label (#619)
27+
- Searchable attributes are set as Unordered by default (#624)
28+
29+
#### FIXES
30+
- Info panel with sorting selectbox is now hidden on no results (#576)
31+
- Issue with decimal numbers displayed in current price refinements (#588)
32+
- PHP 5.3 compatibility (#605, #608)
33+
- Displaying all products by clearing all filters by clearAll instantsearch.js widget on instant search category page (#604, #609)
34+
- Fixed bug when `categories_without_path` was always set as searchable attribute (#621)
35+
336
### 1.7.0
437

538
#### FEATURES

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This extension replaces the default search of Magento with a typo-tolerant, fast
77

88
See features and benefits of [Algolia Search Extension for Magento](https://community.algolia.com/magento).
99

10-
![Latest version](https://img.shields.io/badge/latest-1.7.0-green.svg)
10+
![Latest version](https://img.shields.io/badge/latest-1.7.1-green.svg)
1111
![Magento 1.6.2](https://img.shields.io/badge/magento-1.6.2-blue.svg)
1212
![Magento 1.7.1](https://img.shields.io/badge/magento-1.7.1-blue.svg)
1313
![Magento 1.8.1](https://img.shields.io/badge/magento-1.8.1-blue.svg)

app/code/community/Algolia/Algoliasearch/Block/System/Config/Form/Field/CategoryAdditionalAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public function __construct()
4646
'order' => array(
4747
'label' => 'Ordered',
4848
'options' => array(
49-
'ordered' => 'Ordered',
5049
'unordered' => 'Unordered',
50+
'ordered' => 'Ordered',
5151
),
5252
'rowMethod' => 'getOrder',
5353
),

app/code/community/Algolia/Algoliasearch/Block/System/Config/Form/Field/CustomRankingCategoryAttributes.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ public function __construct()
2222
$options[$attribute['attribute']] = $attribute['attribute'];
2323
}
2424

25+
$options['custom_attribute'] = '[use custom attribute]';
26+
2527
return $options;
2628
},
2729
'rowMethod' => 'getAttribute',
30+
'width' => 150,
31+
),
32+
'custom_attribute' => array(
33+
'label' => 'Custom attribute',
34+
'style' => 'width: 120px;',
2835
),
2936
'order' => array(
3037
'label' => 'Asc / Desc',

app/code/community/Algolia/Algoliasearch/Block/System/Config/Form/Field/CustomRankingProductAttributes.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ public function __construct()
2222
$options[$attribute['attribute']] = $attribute['attribute'];
2323
}
2424

25+
$options['custom_attribute'] = '[use custom attribute]';
26+
2527
return $options;
2628
},
2729
'rowMethod' => 'getAttribute',
30+
'width' => 150,
31+
),
32+
'custom_attribute' => array(
33+
'label' => 'Custom attribute',
34+
'style' => 'width: 120px;',
2835
),
2936
'order' => array(
3037
'label' => 'Asc / Desc',

app/code/community/Algolia/Algoliasearch/Block/System/Config/Form/Field/ProductAdditionalAttributes.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ public function __construct()
4646
'order' => array(
4747
'label' => 'Ordered',
4848
'options' => array(
49-
'ordered' => 'Ordered',
5049
'unordered' => 'Unordered',
50+
'ordered' => 'Ordered',
5151
),
5252
'rowMethod' => 'getOrder',
5353
),
54-
'index_no_value' => [
54+
'index_no_value' => array(
5555
'label' => 'Index empty value',
56-
'options' => [
56+
'options' => array(
5757
'1' => 'Yes',
5858
'0' => 'No',
59-
],
59+
),
6060
'rowMethod' => 'getIndexNoValue',
61-
],
61+
),
6262
),
6363
'buttonLabel' => 'Add Attribute',
6464
'addAfter' => false,

app/code/community/Algolia/Algoliasearch/Helper/Config.php

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Algolia_Algoliasearch_Helper_Config extends Mage_Core_Helper_Abstract
2828
const EXCLUDED_PAGES = 'algoliasearch/autocomplete/excluded_pages';
2929
const MIN_POPULARITY = 'algoliasearch/autocomplete/min_popularity';
3030
const MIN_NUMBER_OF_RESULTS = 'algoliasearch/autocomplete/min_number_of_results';
31+
const DISPLAY_SUGGESTIONS_CATEGORIES = 'algoliasearch/autocomplete/display_categories_with_suggestions';
3132
const RENDER_TEMPLATE_DIRECTIVES = 'algoliasearch/autocomplete/render_template_directives';
3233

3334
const NUMBER_OF_PRODUCT_RESULTS = 'algoliasearch/products/number_product_results';
@@ -36,6 +37,7 @@ class Algolia_Algoliasearch_Helper_Config extends Mage_Core_Helper_Abstract
3637
const RESULTS_LIMIT = 'algoliasearch/products/results_limit';
3738
const SHOW_SUGGESTIONS_NO_RESULTS = 'algoliasearch/products/show_suggestions_on_no_result_page';
3839
const INDEX_OUT_OF_STOCK_OPTIONS = 'algoliasearch/products/index_out_of_stock_options';
40+
const INDEX_WHOLE_CATEGORY_TREE = 'algoliasearch/products/index_whole_category_tree';
3941

4042
const CATEGORY_ATTRIBUTES = 'algoliasearch/categories/category_additional_attributes2';
4143
const INDEX_PRODUCT_COUNT = 'algoliasearch/categories/index_product_count';
@@ -50,6 +52,7 @@ class Algolia_Algoliasearch_Helper_Config extends Mage_Core_Helper_Abstract
5052
const XML_PATH_IMAGE_HEIGHT = 'algoliasearch/image/height';
5153
const XML_PATH_IMAGE_TYPE = 'algoliasearch/image/type';
5254

55+
const ENABLE_SYNONYMS = 'algoliasearch/synonyms/enable_synonyms';
5356
const SYNONYMS = 'algoliasearch/synonyms/synonyms';
5457
const ONEWAY_SYNONYMS = 'algoliasearch/synonyms/oneway_synonyms';
5558
const SYNONYMS_FILE = 'algoliasearch/synonyms/synonyms_file';
@@ -61,6 +64,7 @@ class Algolia_Algoliasearch_Helper_Config extends Mage_Core_Helper_Abstract
6164
const REMOVE_BRANDING = 'algoliasearch/advanced/remove_branding';
6265
const AUTOCOMPLETE_SELECTOR = 'algoliasearch/advanced/autocomplete_selector';
6366
const INDEX_PRODUCT_ON_CATEGORY_PRODUCTS_UPDATE = 'algoliasearch/advanced/index_product_on_category_products_update';
67+
const INDEX_ALL_CATEGORY_PRODUCTS_ON_CATEGORY_UPDATE = 'algoliasearch/advanced/index_all_category_product_on_category_update';
6468

6569
const SHOW_OUT_OF_STOCK = 'cataloginventory/options/show_out_of_stock';
6670
const LOGGING_ENABLED = 'algoliasearch/credentials/debug';
@@ -72,6 +76,11 @@ public function indexOutOfStockOptions($storeId = null)
7276
return Mage::getStoreConfigFlag(self::INDEX_OUT_OF_STOCK_OPTIONS, $storeId);
7377
}
7478

79+
public function indexWholeCategoryTree($storeId = null)
80+
{
81+
return Mage::getStoreConfigFlag(self::INDEX_WHOLE_CATEGORY_TREE, $storeId);
82+
}
83+
7584
public function showCatsNotIncludedInNavigation($storeId = null)
7685
{
7786
return Mage::getStoreConfigFlag(self::SHOW_CATS_NOT_INCLUDED_IN_NAVIGATION, $storeId);
@@ -92,6 +101,11 @@ public function indexProductOnCategoryProductsUpdate($storeId = null)
92101
return Mage::getStoreConfigFlag(self::INDEX_PRODUCT_ON_CATEGORY_PRODUCTS_UPDATE, $storeId);
93102
}
94103

104+
public function indexAllCategoryProductsOnCategoryUpdate($storeId = null)
105+
{
106+
return Mage::getStoreConfigFlag(self::INDEX_ALL_CATEGORY_PRODUCTS_ON_CATEGORY_UPDATE, $storeId);
107+
}
108+
95109
public function getNumberOfQueriesSuggestions($storeId = null)
96110
{
97111
return Mage::getStoreConfig(self::NB_OF_QUERIES_SUGGESTIONS, $storeId);
@@ -112,6 +126,11 @@ public function showSuggestionsOnNoResultsPage($storeId = null)
112126
return Mage::getStoreConfigFlag(self::SHOW_SUGGESTIONS_NO_RESULTS, $storeId);
113127
}
114128

129+
public function displaySuggestionsCategories($storeId = null)
130+
{
131+
return Mage::getStoreConfigFlag(self::DISPLAY_SUGGESTIONS_CATEGORIES, $storeId);
132+
}
133+
115134
public function isEnabledFrontEnd($storeId = null)
116135
{
117136
// Frontend = Backend + Frontent
@@ -387,7 +406,7 @@ public function getAttributesToRetrieve($group_id)
387406
$attributes[] = 'price.'.$currency.'.special_to_date';
388407
}
389408

390-
return array('attributesToRetrieve' => $attributes);
409+
return $attributes;
391410
}
392411

393412
public function getCategoryAdditionalAttributes($storeId = null)
@@ -446,24 +465,12 @@ public function getFacets($storeId = null)
446465

447466
public function getCategoryCustomRanking($storeId = null)
448467
{
449-
$attrs = unserialize(Mage::getStoreConfig(self::CATEGORY_CUSTOM_RANKING, $storeId));
450-
451-
if (is_array($attrs)) {
452-
return $attrs;
453-
}
454-
455-
return array();
468+
return $this->getCustomRanking(self::CATEGORY_CUSTOM_RANKING, $storeId);
456469
}
457470

458471
public function getProductCustomRanking($storeId = null)
459472
{
460-
$attrs = unserialize(Mage::getStoreConfig(self::PRODUCT_CUSTOM_RANKING, $storeId));
461-
462-
if (is_array($attrs)) {
463-
return $attrs;
464-
}
465-
466-
return array();
473+
return $this->getCustomRanking(self::PRODUCT_CUSTOM_RANKING, $storeId);
467474
}
468475

469476
public function getCurrency($storeId = null)
@@ -514,6 +521,11 @@ public function getExtensionVersion()
514521
return (string) Mage::getConfig()->getNode()->modules->Algolia_Algoliasearch->version;
515522
}
516523

524+
public function isEnabledSynonyms($storeId = null)
525+
{
526+
return Mage::getStoreConfigFlag(self::ENABLE_SYNONYMS, $storeId);
527+
}
528+
517529
public function getSynonyms($storeId = null)
518530
{
519531
$synonyms = unserialize(Mage::getStoreConfig(self::SYNONYMS, $storeId));
@@ -545,4 +557,21 @@ public function getSynonymsFile($storeId = null)
545557

546558
return Mage::getBaseDir('media').'/algoliasearch-admin-config-uploads/'.$filename;
547559
}
560+
561+
private function getCustomRanking($configName, $storeId = null)
562+
{
563+
$attrs = unserialize(Mage::getStoreConfig($configName, $storeId));
564+
565+
if (is_array($attrs)) {
566+
foreach ($attrs as $index => $attr) {
567+
if ($attr['attribute'] == 'custom_attribute') {
568+
$attrs[$index]['attribute'] = $attr['custom_attribute'];
569+
}
570+
}
571+
572+
return $attrs;
573+
}
574+
575+
return array();
576+
}
548577
}

0 commit comments

Comments
 (0)