Skip to content

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

Zend Pdf round corners in rectangle section

I wrote the below code to show rectangle in pdf file $page->setFillColor(new Zend_Pdf_Color_GrayScale(0.92)); $page->setLineColor(new Zend_Pdf_Color_GrayScale(0.92)); $page->drawRectangle($x, $oldY+20, ($pageWidth/2)-50, $this->y-10); $page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); $page->setLineColor(new Zend_Pdf_Color_GrayScale(0)); AND Output is But I need round corners in rectangle how can I do this in Magento… Read More »Zend Pdf round corners in rectangle section