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 7
7
namespace Magento \CatalogWidget \Block \Product ;
8
8
9
9
use Magento \Catalog \Api \CategoryRepositoryInterface ;
10
+ use Magento \Catalog \Api \Data \ProductInterface ;
10
11
use Magento \Catalog \Block \Product \AbstractProduct ;
11
12
use Magento \Catalog \Block \Product \Context ;
12
13
use Magento \Catalog \Block \Product \Widget \Html \Pager ;
13
14
use Magento \Catalog \Model \Product ;
15
+ use Magento \Catalog \Model \Product \Attribute \Source \Status as ProductStatus ;
14
16
use Magento \Catalog \Model \Product \Visibility ;
15
17
use Magento \Catalog \Model \ResourceModel \Product \Collection ;
16
18
use Magento \Catalog \Model \ResourceModel \Product \CollectionFactory ;
@@ -371,6 +373,7 @@ public function getBaseCollection(): Collection
371
373
*/
372
374
$ collection = $ this ->_addProductAttributesAndPrices ($ collection )
373
375
->addStoreFilter ()
376
+ ->addAttributeToFilter (ProductInterface::STATUS , ProductStatus::STATUS_ENABLED )
374
377
->addAttributeToSort ('entity_id ' , 'desc ' )
375
378
->setPageSize ($ this ->getPageSize ())
376
379
->setCurPage ($ this ->getRequest ()->getParam ($ this ->getData ('page_var_name ' ), 1 ));
You can’t perform that action at this time.
0 commit comments