File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,18 +110,20 @@ public function getType()
110110 public function getItems ()
111111 {
112112 $ result = [];
113- $ postCollection = $ this ->getBlogPostCollection ();
114- $ i = 0 ;
115- if ($ postCollection ) {
116- /** @var \Magefan\Blog\Model\Post $post */
117- foreach ($ postCollection as $ post ) {
118- $ result [] = $ this ->itemFactory ->create ([
119- 'title ' => $ post ->getTitle (),
120- 'url ' => $ post ->getPostUrl (),
121- 'type ' => $ this ->getType ()]);
122- $ i ++;
123- if ($ i == $ this ->maxAutocompleteResults ) {
124- break ;
113+ if ($ this ->configurationHelper ->isEnabled ($ this ->getType ())) {
114+ $ postCollection = $ this ->getBlogPostCollection ();
115+ $ i = 0 ;
116+ if ($ postCollection ) {
117+ /** @var \Magefan\Blog\Model\Post $post */
118+ foreach ($ postCollection as $ post ) {
119+ $ result [] = $ this ->itemFactory ->create ([
120+ 'title ' => $ post ->getTitle (),
121+ 'url ' => $ post ->getPostUrl (),
122+ 'type ' => $ this ->getType ()]);
123+ $ i ++;
124+ if ($ i == $ this ->maxAutocompleteResults ) {
125+ break ;
126+ }
125127 }
126128 }
127129 }
You can’t perform that action at this time.
0 commit comments