Skip to content

magento man

Unable to add attribute to product by InstallData

I would like to add a custom attribute to the product and create an installData.php according to the guide. However, nothing changed after se:up. Please help. app/code/My/Module/Setup/InstallData.php <?php namespace MyModuleSetup; use MagentoEavSetupEavSetup; use MagentoEavSetupEavSetupFactory; use MagentoFrameworkSetupInstallDataInterface; use MagentoFrameworkSetupModuleContextInterface; use MagentoFrameworkSetupModuleDataSetupInterface;… Read More »Unable to add attribute to product by InstallData

Uncaught Error: Call to undefined method Magento\Catalog\Model\ResourceModel\Product\Interceptor::_construct()

I am getting the following error in my Magento application sometimes, it’s not breaking the application always but in regular interval I am getting this error. The application CPU usage is also going high sometimes. Application is using redis for… Read More »Uncaught Error: Call to undefined method Magento\Catalog\Model\ResourceModel\Product\Interceptor::_construct()

Magento2 Admin Grid Product Image Display

I need to display product image in admin grid view. I tried below code. class Image extends MagentoBackendBlockWidgetGridColumnRendererAbstractRenderer { public function render(MagentoFrameworkDataObject $row) { //$this->helper(‘MagentoCatalogHelperProduct’)->getImageUrl($product); //$helper = $this->helper(‘MagentoCatalogHelperImage’)->init($product,’cart_page_product_thumbnail’) ->constrainOnly(true)->keepAspectRatio(true)->keepFrame(false)->setImageFile($product->getImage())->getUrl(); $id=$row->getId(); $objectManager = MagentoFrameworkAppObjectManager::getInstance(); $store = $objectManager->get(‘MagentoStoreModelStoreManagerInterface’)->getStore(); $product = $objectManager->get(‘MagentoCatalogModelProduct’)->load($id); $imageHelper… Read More »Magento2 Admin Grid Product Image Display