File tree Expand file tree Collapse file tree 4 files changed +13
-9
lines changed Expand file tree Collapse file tree 4 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 9
9
10
10
interface ReplicaManagerInterface
11
11
{
12
+ public const REPLICA_TRANSFORM_MODE_STANDARD = 1 ;
13
+ public const REPLICA_TRANSFORM_MODE_VIRTUAL = 2 ;
14
+ public const REPLICA_TRANSFORM_MODE_ACTUAL = 3 ;
15
+
16
+ public const SORT_KEY_VIRTUAL_REPLICA = 'virtualReplica ' ;
17
+
12
18
/**
13
19
* Configure replicas in Algolia based on the sorting configuration in Magento
14
20
*
Original file line number Diff line number Diff line change 2
2
3
3
namespace Algolia \AlgoliaSearch \Helper ;
4
4
5
- use Algolia \AlgoliaSearch \Model \Product \ReplicaManager ;
5
+ use Algolia \AlgoliaSearch \Api \Product \ReplicaManagerInterface ;
6
6
use Magento ;
7
+ use Magento \Cookie \Helper \Cookie as CookieHelper ;
8
+ use Magento \Customer \Api \GroupExcludedWebsiteRepositoryInterface ;
7
9
use Magento \Customer \Model \ResourceModel \Group \Collection as GroupCollection ;
8
10
use Magento \Directory \Model \Currency as DirCurrency ;
9
11
use Magento \Framework \App \Filesystem \DirectoryList ;
13
15
use Magento \Framework \Serialize \SerializerInterface ;
14
16
use Magento \Store \Model \ScopeInterface ;
15
17
use Magento \Store \Model \StoreManagerInterface ;
16
- use Magento \Customer \Api \GroupExcludedWebsiteRepositoryInterface ;
17
- use Magento \Cookie \Helper \Cookie as CookieHelper ;
18
-
19
18
20
19
class ConfigHelper
21
20
{
@@ -1869,7 +1868,7 @@ public function useVirtualReplica(?int $storeId = null): bool
1869
1868
return (bool ) count (array_filter (
1870
1869
$ this ->getSorting ($ storeId ),
1871
1870
function ($ sort ) {
1872
- return $ sort [ReplicaManager ::SORT_KEY_VIRTUAL_REPLICA ];
1871
+ return $ sort [ReplicaManagerInterface ::SORT_KEY_VIRTUAL_REPLICA ];
1873
1872
}
1874
1873
));
1875
1874
}
Original file line number Diff line number Diff line change 15
15
use Algolia \AlgoliaSearch \Helper \Entity \Product \PriceManager ;
16
16
use Algolia \AlgoliaSearch \Helper \Image as ImageHelper ;
17
17
use Algolia \AlgoliaSearch \Helper \Logger ;
18
- use Algolia \AlgoliaSearch \Model \Product \ReplicaManager ;
19
18
use Magento \Bundle \Model \Product \Type as BundleProductType ;
20
19
use Magento \Catalog \Model \Product ;
21
20
use Magento \Catalog \Model \Product \Attribute \Source \Status ;
@@ -1426,7 +1425,7 @@ protected function decorateReplicasSetting(array $sortingIndices): array {
1426
1425
return array_map (
1427
1426
function ($ sort ) {
1428
1427
$ replica = $ sort ['name ' ];
1429
- return !! $ sort [ReplicaManager ::SORT_KEY_VIRTUAL_REPLICA ]
1428
+ return !! $ sort [ReplicaManagerInterface ::SORT_KEY_VIRTUAL_REPLICA ]
1430
1429
? "virtual( $ replica) "
1431
1430
: $ replica ;
1432
1431
},
Original file line number Diff line number Diff line change 2
2
3
3
namespace Algolia \AlgoliaSearch \Model \Source ;
4
4
5
- use Algolia \AlgoliaSearch \Model \Product \ReplicaManager ;
5
+ use Algolia \AlgoliaSearch \Api \Product \ReplicaManagerInterface ;
6
6
7
7
/**
8
8
* Algolia custom sort order field
@@ -35,7 +35,7 @@ protected function getTableData()
35
35
'sortLabel ' => [
36
36
'label ' => 'Label ' ,
37
37
],
38
- ReplicaManager ::SORT_KEY_VIRTUAL_REPLICA => [
38
+ ReplicaManagerInterface ::SORT_KEY_VIRTUAL_REPLICA => [
39
39
'label ' => 'Enable Virtual Replica? ' ,
40
40
'values ' => ['0 ' => __ ('No ' ), '1 ' => __ ('Yes ' )],
41
41
],
You can’t perform that action at this time.
0 commit comments