6
6
use Algolia \AlgoliaSearch \Helper \Configuration \AutocompleteHelper ;
7
7
use Algolia \AlgoliaSearch \Helper \Configuration \InstantSearchHelper ;
8
8
use Algolia \AlgoliaSearch \Service \AlgoliaConnector ;
9
- use Magento ;
10
9
use Magento \Cookie \Helper \Cookie as CookieHelper ;
10
+ use Magento \Customer \Api \GroupExcludedWebsiteRepositoryInterface ;
11
+ use Magento \Customer \Model \ResourceModel \Group \Collection as GroupCollection ;
11
12
use Magento \Directory \Model \Currency as DirCurrency ;
12
13
use Magento \Framework \App \Config \ScopeConfigInterface ;
13
14
use Magento \Framework \App \Filesystem \DirectoryList ;
16
17
use Magento \Framework \Serialize \SerializerInterface ;
17
18
use Magento \Store \Model \ScopeInterface ;
18
19
use Magento \Store \Model \StoreManagerInterface ;
19
- use Magento \Customer \Api \GroupExcludedWebsiteRepositoryInterface ;
20
- use Magento \Customer \Model \ResourceModel \Group \Collection as GroupCollection ;
21
20
22
21
class ConfigHelper
23
22
{
@@ -143,21 +142,21 @@ class ConfigHelper
143
142
public const ENABLE_INDEXER_QUEUE = 'algoliasearch_indexing_manager/full_indexing/queue ' ;
144
143
145
144
public function __construct (
146
- protected Magento \Framework \App \Config \ScopeConfigInterface $ configInterface ,
147
- protected Magento \Framework \App \Config \Storage \WriterInterface $ configWriter ,
148
- protected StoreManagerInterface $ storeManager ,
149
- protected Currency $ currency ,
150
- protected DirCurrency $ dirCurrency ,
151
- protected DirectoryList $ directoryList ,
152
- protected Magento \Framework \Module \ResourceInterface $ moduleResource ,
153
- protected Magento \Framework \App \ProductMetadataInterface $ productMetadata ,
154
- protected Magento \Framework \Event \ManagerInterface $ eventManager ,
155
- protected SerializerInterface $ serializer ,
156
- protected GroupCollection $ groupCollection ,
157
- protected GroupExcludedWebsiteRepositoryInterface $ groupExcludedWebsiteRepository ,
158
- protected CookieHelper $ cookieHelper ,
159
- protected AutocompleteHelper $ autocompleteConfig ,
160
- protected InstantSearchHelper $ instantSearchConfig
145
+ protected \ Magento \Framework \App \Config \ScopeConfigInterface $ configInterface ,
146
+ protected \ Magento \Framework \App \Config \Storage \WriterInterface $ configWriter ,
147
+ protected StoreManagerInterface $ storeManager ,
148
+ protected Currency $ currency ,
149
+ protected DirCurrency $ dirCurrency ,
150
+ protected DirectoryList $ directoryList ,
151
+ protected \ Magento \Framework \Module \ResourceInterface $ moduleResource ,
152
+ protected \ Magento \Framework \App \ProductMetadataInterface $ productMetadata ,
153
+ protected \ Magento \Framework \Event \ManagerInterface $ eventManager ,
154
+ protected SerializerInterface $ serializer ,
155
+ protected GroupCollection $ groupCollection ,
156
+ protected GroupExcludedWebsiteRepositoryInterface $ groupExcludedWebsiteRepository ,
157
+ protected CookieHelper $ cookieHelper ,
158
+ protected AutocompleteHelper $ autocompleteConfig ,
159
+ protected InstantSearchHelper $ instantSearchConfig
161
160
)
162
161
{}
163
162
@@ -784,11 +783,11 @@ public function getCategoryPageIdAttributeName($storeId = null): string
784
783
}
785
784
786
785
/**
787
- * @throws Magento\Framework\Exception\NoSuchEntityException
786
+ * @throws \ Magento\Framework\Exception\NoSuchEntityException
788
787
*/
789
788
public function getCurrencyCode (int $ storeId = null ): string
790
789
{
791
- /** @var Magento\Store\Model\Store $store */
790
+ /** @var \ Magento\Store\Model\Store $store */
792
791
$ store = $ this ->storeManager ->getStore ($ storeId );
793
792
return $ store ->getCurrentCurrencyCode ();
794
793
}
@@ -1022,7 +1021,7 @@ public function getBackendRenderingDisplayMode($storeId = null)
1022
1021
1023
1022
/**
1024
1023
* @return int
1025
- * @throws Magento\Framework\Exception\NoSuchEntityException
1024
+ * @throws \ Magento\Framework\Exception\NoSuchEntityException
1026
1025
*/
1027
1026
public function getStoreId ()
1028
1027
{
@@ -1045,11 +1044,11 @@ public function getStoreLocale($storeId)
1045
1044
/**
1046
1045
* @param $storeId
1047
1046
* @return string|null
1048
- * @throws Magento\Framework\Exception\NoSuchEntityException
1047
+ * @throws \ Magento\Framework\Exception\NoSuchEntityException
1049
1048
*/
1050
1049
public function getCurrency ($ storeId = null )
1051
1050
{
1052
- /** @var Magento\Store\Model\Store $store */
1051
+ /** @var \ Magento\Store\Model\Store $store */
1053
1052
$ store = $ this ->storeManager ->getStore ($ storeId );
1054
1053
return $ this ->currency ->getCurrency ($ store ->getCurrentCurrencyCode ())->getSymbol ();
1055
1054
}
@@ -1573,7 +1572,7 @@ public function isQueueIndexerEnabled(): bool
1573
1572
* DEPRECATED CONSTANTS & METHODS *
1574
1573
**************************************/
1575
1574
1576
- // --- AUTOCOMPLETE --- //
1575
+ // --- Autocomplete --- //
1577
1576
1578
1577
/**
1579
1578
* @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
@@ -1653,6 +1652,93 @@ public function isQueueIndexerEnabled(): bool
1653
1652
*/
1654
1653
public const AUTOCOMPLETE_MINIMUM_CHAR_LENGTH = AutocompleteHelper::MINIMUM_CHAR_LENGTH ;
1655
1654
1655
+ // --- InstantSearch --- //
1656
+
1657
+ /**
1658
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1659
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::IS_ENABLED
1660
+ */
1661
+ public const IS_INSTANT_ENABLED = InstantSearchHelper::IS_ENABLED ;
1662
+
1663
+ /**
1664
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1665
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::DOM_SELECTOR
1666
+ */
1667
+ public const INSTANT_SELECTOR = InstantSearchHelper::DOM_SELECTOR ;
1668
+
1669
+ /**
1670
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1671
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::NUMBER_OF_PRODUCT_RESULTS
1672
+ */
1673
+ public const NUMBER_OF_PRODUCT_RESULTS = InstantSearchHelper::NUMBER_OF_PRODUCT_RESULTS ;
1674
+
1675
+ /**
1676
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1677
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::REPLACE_CATEGORIES
1678
+ */
1679
+ public const REPLACE_CATEGORIES = InstantSearchHelper::REPLACE_CATEGORIES ;
1680
+
1681
+ /**
1682
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1683
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::FACETS
1684
+ */
1685
+ public const FACETS = InstantSearchHelper::FACETS ;
1686
+
1687
+ /**
1688
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1689
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::MAX_VALUES_PER_FACET
1690
+ */
1691
+ public const MAX_VALUES_PER_FACET = InstantSearchHelper::MAX_VALUES_PER_FACET ;
1692
+
1693
+ /**
1694
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1695
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::IS_DYNAMIC_FACETS_ENABLED
1696
+ */
1697
+ public const ENABLE_DYNAMIC_FACETS = InstantSearchHelper::IS_DYNAMIC_FACETS_ENABLED ;
1698
+
1699
+ /**
1700
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1701
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::SORTING_INDICES
1702
+ */
1703
+ public const SORTING_INDICES = InstantSearchHelper::SORTING_INDICES ;
1704
+
1705
+ /**
1706
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1707
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::SHOW_SUGGESTIONS_NO_RESULTS
1708
+ */
1709
+ public const SHOW_SUGGESTIONS_NO_RESULTS = InstantSearchHelper::SHOW_SUGGESTIONS_NO_RESULTS ;
1710
+
1711
+ /**
1712
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1713
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::IS_SEARCHBOX_ENABLED
1714
+ */
1715
+ public const SEARCHBOX_ENABLE = InstantSearchHelper::IS_SEARCHBOX_ENABLED ;
1716
+
1717
+ /**
1718
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1719
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::IS_ADD_TO_CART_ENABLED
1720
+ */
1721
+ public const XML_ADD_TO_CART_ENABLE = InstantSearchHelper::IS_ADD_TO_CART_ENABLED ;
1722
+
1723
+ /**
1724
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1725
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::IS_INFINITE_SCROLL_ENABLED
1726
+ */
1727
+ public const INFINITE_SCROLL_ENABLE = InstantSearchHelper::IS_INFINITE_SCROLL_ENABLED ;
1728
+
1729
+ /**
1730
+ * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1731
+ * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::HIDE_PAGINATION
1732
+ */
1733
+ public const HIDE_PAGINATION = InstantSearchHelper::HIDE_PAGINATION ;
1734
+
1735
+ /**
1736
+ * @deprecated This constant is retained purely for data patches to migrate from older versions
1737
+ */
1738
+ public const LEGACY_USE_VIRTUAL_REPLICA_ENABLED = 'algoliasearch_instant/instant/use_virtual_replica ' ;
1739
+
1740
+ // --- Autocomplete --- //
1741
+
1656
1742
/**
1657
1743
* @param $storeId
1658
1744
* @return bool
@@ -1813,90 +1899,7 @@ public function getAutocompleteMinimumCharacterLength(?int $storeId = null): int
1813
1899
return $ this ->autocompleteConfig ->getMinimumCharacterLength ($ storeId );
1814
1900
}
1815
1901
1816
- // --- InstantSearch ---
1817
-
1818
- /**
1819
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1820
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::IS_ENABLED
1821
- */
1822
- public const IS_INSTANT_ENABLED = InstantSearchHelper::IS_ENABLED ;
1823
-
1824
- /**
1825
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1826
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::DOM_SELECTOR
1827
- */
1828
- public const INSTANT_SELECTOR = InstantSearchHelper::DOM_SELECTOR ;
1829
-
1830
- /**
1831
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1832
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::NUMBER_OF_PRODUCT_RESULTS
1833
- */
1834
- public const NUMBER_OF_PRODUCT_RESULTS = InstantSearchHelper::NUMBER_OF_PRODUCT_RESULTS ;
1835
-
1836
- /**
1837
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1838
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::REPLACE_CATEGORIES
1839
- */
1840
- public const REPLACE_CATEGORIES = InstantSearchHelper::REPLACE_CATEGORIES ;
1841
-
1842
- /**
1843
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1844
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::FACETS
1845
- */
1846
- public const FACETS = InstantSearchHelper::FACETS ;
1847
-
1848
- /**
1849
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1850
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::MAX_VALUES_PER_FACET
1851
- */
1852
- public const MAX_VALUES_PER_FACET = InstantSearchHelper::MAX_VALUES_PER_FACET ;
1853
-
1854
- /**
1855
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1856
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::IS_DYNAMIC_FACETS_ENABLED
1857
- */
1858
- public const ENABLE_DYNAMIC_FACETS = InstantSearchHelper::IS_DYNAMIC_FACETS_ENABLED ;
1859
-
1860
- /**
1861
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1862
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::SORTING_INDICES
1863
- */
1864
- public const SORTING_INDICES = InstantSearchHelper::SORTING_INDICES ;
1865
-
1866
- /**
1867
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1868
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::SHOW_SUGGESTIONS_NO_RESULTS
1869
- */
1870
- public const SHOW_SUGGESTIONS_NO_RESULTS = InstantSearchHelper::SHOW_SUGGESTIONS_NO_RESULTS ;
1871
-
1872
- /**
1873
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1874
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::IS_SEARCHBOX_ENABLED
1875
- */
1876
- public const SEARCHBOX_ENABLE = InstantSearchHelper::IS_SEARCHBOX_ENABLED ;
1877
-
1878
- /**
1879
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1880
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::IS_ADD_TO_CART_ENABLED
1881
- */
1882
- public const XML_ADD_TO_CART_ENABLE = InstantSearchHelper::IS_ADD_TO_CART_ENABLED ;
1883
-
1884
- /**
1885
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1886
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::IS_INFINITE_SCROLL_ENABLED
1887
- */
1888
- public const INFINITE_SCROLL_ENABLE = InstantSearchHelper::IS_INFINITE_SCROLL_ENABLED ;
1889
-
1890
- /**
1891
- * @deprecated This constant has been moved to a domain specific config helper and will be removed in a future release
1892
- * @see \Algolia\AlgoliaSearch\Helper\Configuration\InstantSearchHelper::HIDE_PAGINATION
1893
- */
1894
- public const HIDE_PAGINATION = InstantSearchHelper::HIDE_PAGINATION ;
1895
-
1896
- /**
1897
- * @deprecated This constant is retained purely for data patches to migrate from older versions
1898
- */
1899
- public const LEGACY_USE_VIRTUAL_REPLICA_ENABLED = 'algoliasearch_instant/instant/use_virtual_replica ' ;
1902
+ // --- InstantSearch --- //
1900
1903
1901
1904
/**
1902
1905
* @param $storeId
@@ -1982,8 +1985,8 @@ public function isDynamicFacetsEnabled(?int $storeId = null): bool
1982
1985
* @param $currentCustomerGroupId
1983
1986
* @param $attrs
1984
1987
* @return array
1985
- * @throws Magento\Framework\Exception\LocalizedException
1986
- * @throws Magento\Framework\Exception\NoSuchEntityException
1988
+ * @throws \ Magento\Framework\Exception\LocalizedException
1989
+ * @throws \ Magento\Framework\Exception\NoSuchEntityException
1987
1990
* @deprecated This method has been deprecated and should no longer be used
1988
1991
* @see \Algolia\AlgoliaSearch\Service\Product\SortingTransformer
1989
1992
*/
0 commit comments