Skip to content

Elasticsearch7 returns string but not array for the category page

When I tried to load my category page, the following error showing… TypeError: Return value of MagentoElasticsearch7ModelClientElasticsearch::query() must be of the type array, string returned in /home/758955.cloudwaysapps.com/svjdbvkfqv/public_html/vendor/magento/module-elasticsearch-7/Model/Client/Elasticsearch.php:367> Versions details Windows 10 Magento 2.4.2 Elasticsearch 7.6 installed in cloudways I updated… Read More »Elasticsearch7 returns string but not array for the category page

Inject dependency based on php version

I use soap to do some calls to a remote server, php has changed method signature for __doRequest between php 7.4 & 8.x, is there any di.xml tag that can conditionally change the loaded class based on the php version?

Deleted the Product image, but still the image exists in the product grid in magento 2

I have deleted the product image using following code $imageProcessor = $_objectManager->create(‘MagentoCatalogModelProductGalleryProcessor’); $images = $product->getMediaGalleryImages(); $productGallery = $_objectManager->create(‘MagentoCatalogModelResourceModelProductGallery’); foreach($images as $child) { $objectManager = MagentoFrameworkAppObjectManager::getInstance(); $productGallery = $objectManager->create(‘MagentoCatalogModelResourceModelProductGallery’); $productGallery->deleteGallery($child[‘value_id’]); $product->setMediaGalleryEntries([]); $imageProcessor->removeImage($product, $child[‘file’]); $product->save(); } Image successfully deleted. But due to… Read More »Deleted the Product image, but still the image exists in the product grid in magento 2