Skip to content

product

Auto Added by WPeMatico

Hide Products in ProductCollection => Problem with Pagination and Filters

I would like to hide some articles in a certain category. So far I have solved this using a plugin: di.xml: <type name=“MagentoCatalogModelLayerCategoryCollectionFilter”> <plugin sortOrder=“1” name=“Vendor_Modulename::aroundProductCollection” type=“VendorModuleNamePluginCatalogCollectionFilter”/> </type> <?php namespace VendorModuleNamePluginCatalog; use MagentoCatalogModelLayerCategoryCollectionFilter as CategoryCollectionFilter; use MagentoCatalogModelResourceModelProductCollection as ProductCollection; use… Read More »Hide Products in ProductCollection => Problem with Pagination and Filters

Magento 2: Get Product Collection With Multiple SKUs Filter

I’m trying to get product collection with multiple skus filter, don’t know what I’m missing or doing wrong: $objectManager = MagentoFrameworkAppObjectManager::getInstance(); $productCollectionFactory = $objectManager->create(‘MagentoCatalogModelResourceModelProductCollectionFactory’); $collection = $productCollectionFactory->create(); $collection->addAttributeToSelect([‘name’,’sku’]); $collection->addAttributeToFilter(‘sku’, [‘in’ => [‘IS-OB-2165′,’TM-VIVO-Y15’]]); $collection->setPageSize(3); foreach ($collection as $product) { print_r($product->getName()); }

Magento 2 Task “Update attributes for 2 selected products”: 1 item(s) are currently being updated.1 item(s) have been scheduled for update

Magento version 2.3.5 Does anyone know how to solve this? Cron is working fine I cross-check with indexing and when run this command – php bin/magento queue:consumers:start product_action_attribute.update then the problem is solved but it’s not a good way, again… Read More »Magento 2 Task “Update attributes for 2 selected products”: 1 item(s) are currently being updated.1 item(s) have been scheduled for update