New answers tagged

0 votes

How to Get Recently viewed Products in Magento 2

try this ...... definatly work public function __construct( \Magento\Reports\Block\Product\Viewed $recentlyViewed, array $data = [] ){ $this->recentlyViewed = $recentlyViewed; } public ...
0 votes

No Administrators role was found, data fixture needs to be run

The error is caused because your database isn't complete, I had the same issue by creating a DB dump via Magerun 2 using the param --strip=@development. Your authorization_role and authorization_role ...
0 votes

I see my MySQL logins on my home page

If I understand your question correctly you are wondering why Magento shows an error when MySQL has been shut down instead of the 404 page? The 404 page is stored in the database. If you shut down the ...
  • 485
1 vote

Duplicate entry in DB after upgrading to 2.4.3

You can just use this script here https://takeoff.digital/2022/09/15/duplicate-primary-key-error-in-magento-2/ Please read the explanations in the above url if it doesn't make sense for you as this ...
0 votes
Accepted

My sql query to get product count for Attribute

This helped me to get the query string $collection = $this->productCollectionFactory->create() ->addAttributeToSelect('*') ->addFieldToFilter('status','1')...
0 votes

My sql query to get product count for Attribute

$collection = $this->productCollectionFactory->create() ->addAttributeToSelect('*') ->addFieldToFilter('status','1') ->...
0 votes

My sql query to get product count for Attribute

Can use echo $collection->getSelect() Example: $collection = $this->productCollectionFactory->create() ->addAttributeToSelect('*') ->addFieldToFilter('...
1 vote

How to apply filter on magento 2 collection like below query?

Use Zend_Db_Expr Example: $collection->getSelect()->where(new \Zend_Db_Expr("CONCAT(',', subscriptions, ',') LIKE (?)"), '%,4793,%');
0 votes

Syntax error or access violation: 1071 Specified key was too long when running setup:upgrade

The limit for UTF8 is 767/3 = 255 characters, for UTF8m see reference here With this in mind, I'd ensure that these title fields are less that 255 together. How about changing from varchar(300) to ...
0 votes

What is the foreign key relationships in database to connect sales_order with each sale_order_Item?

sales_order_item is connected to sales_order via the "order_id" column in the item table which links to the "entity_id" column in the order table
0 votes

How to get my custom table data from magento 2

How to get my custom table data from magento 2 . using Rest API . table display in postman
0 votes
Accepted

Custom mysql triggers deleted automatically in Magento 2.4.2

I found solution for this. We can use mview.xml file for create mysql triggers in custom table (custom indexer). I wanted to make an entry in catalogsearch_fulltext_cl if any changes happens in my ...

Top 50 recent answers are included