File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
app/code/Magento/CatalogWidget/Block/Product Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 77namespace Magento \CatalogWidget \Block \Product ;
88
99use Magento \Catalog \Api \CategoryRepositoryInterface ;
10+ use Magento \Catalog \Api \Data \ProductInterface ;
1011use Magento \Catalog \Block \Product \AbstractProduct ;
1112use Magento \Catalog \Block \Product \Context ;
1213use Magento \Catalog \Block \Product \Widget \Html \Pager ;
1314use Magento \Catalog \Model \Product ;
15+ use Magento \Catalog \Model \Product \Attribute \Source \Status as ProductStatus ;
1416use Magento \Catalog \Model \Product \Visibility ;
1517use Magento \Catalog \Model \ResourceModel \Product \Collection ;
1618use Magento \Catalog \Model \ResourceModel \Product \CollectionFactory ;
@@ -371,6 +373,7 @@ public function getBaseCollection(): Collection
371373 */
372374 $ collection = $ this ->_addProductAttributesAndPrices ($ collection )
373375 ->addStoreFilter ()
376+ ->addAttributeToFilter (ProductInterface::STATUS , ProductStatus::STATUS_ENABLED )
374377 ->addAttributeToSort ('entity_id ' , 'desc ' )
375378 ->setPageSize ($ this ->getPageSize ())
376379 ->setCurPage ($ this ->getRequest ()->getParam ($ this ->getData ('page_var_name ' ), 1 ));
You can’t perform that action at this time.
0 commit comments