File tree Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Expand file tree Collapse file tree 4 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ class ConfigHelper
108
108
public const CONNECTION_TIMEOUT = 'algoliasearch_advanced/advanced/connection_timeout ' ;
109
109
public const READ_TIMEOUT = 'algoliasearch_advanced/advanced/read_timeout ' ;
110
110
public const WRITE_TIMEOUT = 'algoliasearch_advanced/advanced/write_timeout ' ;
111
+ public const AUTO_PRICE_INDEXING_ENABLED = 'algoliasearch_advanced/advanced/auto_price_indexing ' ;
111
112
112
113
public const PROFILER_ENABLED = 'algoliasearch_advanced/advanced/enable_profiler ' ;
113
114
@@ -1284,6 +1285,15 @@ public function getWriteTimeout($storeId = null)
1284
1285
return $ this ->configInterface ->getValue (self ::WRITE_TIMEOUT , ScopeInterface::SCOPE_STORE , $ storeId );
1285
1286
}
1286
1287
1288
+ public function isAutoPriceIndexingEnabled (?int $ storeId = null ): bool
1289
+ {
1290
+ return $ this ->configInterface ->isSetFlag (
1291
+ self ::AUTO_PRICE_INDEXING_ENABLED ,
1292
+ ScopeInterface::SCOPE_STORE ,
1293
+ $ storeId
1294
+ );
1295
+ }
1296
+
1287
1297
/**
1288
1298
* @param $storeId
1289
1299
* @return array|bool|float|int|mixed|string
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Algolia \AlgoliaSearch \Model \Config ;
4
+
5
+ use Magento \Config \Model \Config \CommentInterface ;
6
+ use Magento \Framework \UrlInterface ;
7
+
8
+ class AutomaticPriceIndexingComment implements CommentInterface
9
+ {
10
+ public function __construct (
11
+ protected UrlInterface $ urlInterface
12
+ ) { }
13
+
14
+ public function getCommentText ($ elementValue )
15
+ {
16
+ $ url = $ this ->urlInterface ->getUrl ('https://www.algolia.com/doc/integration/magento-2/how-it-works/indexing-queue/#configure-the-queue ' );
17
+
18
+ $ comment = array ();
19
+ $ comment [] = 'Algolia relies on the core Magento Product Price index when serializing product data. If the price index is not up to date, Algolia will not be able to accurately determine what should be included in the search index. ' ;
20
+ $ comment [] = 'If you are experiencing problems with products not syncing to Algolia due to this issue, enabling this setting will allow Algolia to automatically update the price index as needed. ' ;
21
+ $ comment [] = 'NOTE: This can introduce a marginal amount of overhead to the indexing process so only enable if necessary. Be sure to <a href=" ' . $ url . '" target="_blank">optimize the indexing queue</a> based on the impact of this operation. ' ;
22
+ return implode ('<br><br> ' , $ comment );
23
+ }
24
+ }
Original file line number Diff line number Diff line change 1337
1337
<field id =" write_timeout" translate =" label comment" type =" text" sortOrder =" 110" showInDefault =" 1" >
1338
1338
<label >Write Timeout (In Seconds)</label >
1339
1339
</field >
1340
+ <field id =" auto_price_indexing" translate =" label comment" type =" select" sortOrder =" 120" showInDefault =" 1" showInWebsite =" 1" showInStore =" 1" >
1341
+ <label >Enable automatic price indexing</label >
1342
+ <source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
1343
+ <comment >
1344
+ <model >Algolia\AlgoliaSearch\Model\Config\AutomaticPriceIndexingComment</model >
1345
+ </comment >
1346
+ <depends >
1347
+ <field id =" active" >1</field >
1348
+ </depends >
1349
+ </field >
1340
1350
<field id =" enable_profiler" translate =" label comment" type =" select" sortOrder =" 130" showInDefault =" 1" >
1341
1351
<label >Enable Profiler</label >
1342
1352
<source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
Original file line number Diff line number Diff line change 94
94
<connection_timeout >2</connection_timeout >
95
95
<read_timeout >30</read_timeout >
96
96
<write_timeout >30</write_timeout >
97
+ <auto_price_indexing >0</auto_price_indexing >
97
98
<enable_profiler >0</enable_profiler >
98
99
</advanced >
99
100
<queue >
You can’t perform that action at this time.
0 commit comments