Skip to content

Commit 6ed5a70

Browse files
committed
ACP2E-3461: PageBuilder Carousel Widget shows products that doesn't match conditions
1 parent 7939bd0 commit 6ed5a70

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

app/code/Magento/ConfigurableProduct/Plugin/CatalogWidget/Block/Product/ProductsListPlugin.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,22 @@ public function afterCreateCollection(ProductsList $subject, Collection $result)
7878
$connection = $this->resource->getConnection();
7979
$productIds = $connection->fetchCol(
8080
$connection
81-
->select()
82-
->from(['e' => $this->resource->getTableName('catalog_product_entity')], ['link_table.parent_id'])
83-
->joinInner(
84-
['link_table' => $this->resource->getTableName('catalog_product_super_link')],
85-
'link_table.product_id = e.' . $linkField,
86-
[]
87-
)
88-
->where('link_table.product_id IN (?)', $searchProducts)
81+
->select()
82+
->from(
83+
['e' => $this->resource->getTableName('catalog_product_entity')],
84+
['entity_table.entity_id']
85+
)
86+
->joinInner(
87+
['link_table' => $this->resource->getTableName('catalog_product_super_link')],
88+
'link_table.product_id = e.entity_id',
89+
[]
90+
)
91+
->joinInner(
92+
['entity_table' => $this->resource->getTableName('catalog_product_entity')],
93+
'entity_table.' . $linkField . ' = link_table.parent_id',
94+
[]
95+
)
96+
->where('link_table.product_id IN (?)', $searchProducts)
8997
);
9098

9199
$configurableProductCollection = $this->productCollectionFactory->create();

0 commit comments

Comments
 (0)