File tree Expand file tree Collapse file tree 4 files changed +41
-1
lines changed Expand file tree Collapse file tree 4 files changed +41
-1
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * integer_net Magento Module
4
+ *
5
+ * @copyright Copyright (c) 2017 integer_net GmbH (http://www.integer-net.de/)
6
+ * @author Andreas von Studnitz <[email protected] >
7
+ */
8
+
9
+ namespace IntegerNet \Solr \Plugin ;
10
+
11
+ use Magento \Search \Helper \Data as Subject ;
12
+ use Magento \Store \Model \StoreManagerInterface ;
13
+
14
+ class SearchHelperPlugin
15
+ {
16
+ /**
17
+ * @var StoreManagerInterface
18
+ */
19
+ private $ storeManager ;
20
+
21
+ public function __construct (StoreManagerInterface $ storeManager )
22
+ {
23
+ $ this ->storeManager = $ storeManager ;
24
+ }
25
+
26
+ /**
27
+ * @return string
28
+ */
29
+ public function aroundGetSuggestUrl ()
30
+ {
31
+ /** @var \Magento\Store\Model\Store $store */
32
+ $ store = $ this ->storeManager ->getStore ();
33
+ return $ store ->getBaseUrl () . 'autosuggest.php?store_id= ' . $ store ->getId ();
34
+ }
35
+ }
Original file line number Diff line number Diff line change 3
3
<type name =" Magento\Framework\View\Result\Layout" >
4
4
<plugin name =" updateLayout" type =" IntegerNet\Solr\Model\Plugin\LayoutPlugin" />
5
5
</type >
6
+ <type name =" Magento\Search\Helper\Data" >
7
+ <plugin name =" integernetSolrSearchHelper" type =" IntegerNet\Solr\Plugin\SearchHelperPlugin" />
8
+ </type >
6
9
</config >
Original file line number Diff line number Diff line change 3
3
<module name =" IntegerNet_Solr" setup_version =" 1.1.1" >
4
4
<sequence >
5
5
<module name =" Magento_Search" />
6
+ <module name =" Magento_CatalogSearch" />
7
+ <module name =" Magento_LayeredNavigation" />
6
8
</sequence >
7
9
</module >
8
10
</config >
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ $helper = $this->helper('Magento\Search\Helper\Data');
15
15
<input id="search"
16
16
data-mage-init='{"quickSearch":{
17
17
"formSelector":"#search_mini_form",
18
- "url":"<?php /* @escapeNotVerified */ /* echo $helper->getSuggestUrl();*/ ?> /autosuggest.php?store_id=1 ",
18
+ "url":"<?php /* @escapeNotVerified */ echo $ helper ->getSuggestUrl (); ?> ",
19
19
"destinationSelector":"#search_autocomplete"}
20
20
}'
21
21
type="text"
You can’t perform that action at this time.
0 commit comments