Skip to content

magento man

Integrity constraint violation: 1062 Duplicate entry ‘3-2-9’ for key ‘PRIMARY’, query was: ALTER TABLE `catalog_category_product_index_tmp`

Integrity constraint violation: 1062 Duplicate entry ‘3-2-9’ for key ‘PRIMARY’, query was: ALTER TABLE catalog_category_product_index_tmp ADD CONSTRAINT PRIMARY KEY (category_id,product_id,store_id), COMMENT=’Catalog Category Product Indexer temporary table’ this error comes when I run the setup:upgrade command in Magento 2 please make… Read More »Integrity constraint violation: 1062 Duplicate entry ‘3-2-9’ for key ‘PRIMARY’, query was: ALTER TABLE `catalog_category_product_index_tmp`

How to use addFieldToFilter & addFieldToSelect in magento2

I need to known how to use addFieldToFilter & addFieldToSelect in frontend? And can I use like below $searchQuery = $wholeData[“searchQuery”] ?? “”; $searchQuery = trim($searchQuery); $agentCollection = $this->_agents->create()->addNameToSelect(); if ($agentId > 0) { $agentCollection->addFieldToFilter(“id”, $agentId); } else { $agentCollection->addFieldToSelect(“email”)… Read More »How to use addFieldToFilter & addFieldToSelect in magento2

Notice: Undefined index: extension in vendor/magento/framework/File/Uploader.php on line 59

I am trying to import product image programmatically but I am getting Below error Notice: Undefined index: extension in vendor/magento/framework/File/Uploader.php on line 59 Code For Import Image: <?php namespace VendorDemoModel; use MagentoCatalogApiProductRepositoryInterface; use MagentoFrameworkAppFilesystemDirectoryList; use MagentoFrameworkExceptionNoSuchEntityException; /* * Class ProductImagesImporter… Read More »Notice: Undefined index: extension in vendor/magento/framework/File/Uploader.php on line 59