File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,7 @@ public function getProductIdsByCategory()
119
119
$ productIds = [];
120
120
$ catIds = $ this ->getSliderCategoryIds ();
121
121
$ collection = $ this ->_productCollectionFactory ->create ();
122
+
122
123
if (is_array ($ catIds )) {
123
124
$ collection ->addAttributeToSelect ('* ' )->addCategoriesFilter (array ('in ' => $ catIds ));
124
125
} else {
@@ -135,11 +136,11 @@ public function getProductIdsByCategory()
135
136
$ productIdsRandom = [];
136
137
137
138
foreach ($ keys as $ key => $ value ) {
138
- $ productCollection = $ this -> _productCollectionFactory -> create ()-> addIdFilter ($ value );
139
+ $ productCollection = $ collection -> addIdFilter ($ productIds [ $ value] );
139
140
$ mpProductIds = $ this ->getProductParentIds ($ productCollection );
140
141
141
142
if (!in_array ($ mpProductIds , $ productIdsRandom ) && !empty ($ mpProductIds )) {
142
- $ productIdsRandom [$ value ] = $ mpProductIds ;
143
+ $ productIdsRandom [] = $ mpProductIds[ $ value ] ;
143
144
144
145
if ($ key >= ($ this ->getProductsCount () - 1 )) {
145
146
break ;
You can’t perform that action at this time.
0 commit comments