How to run SQL commands in magento

Although I wouldn’t recommend running accessing the database “directly” via SQL commands, it might be useful as a last resource to do so. But, how would one be able to implement it? By using the ResourceConnection class in \Magento\Framework\App we would be able to establish a connection to the database and get an object that implements the AdapterInterface defined in[…]

Read more

Useful FREE tests you should run on your website

#1 Favicon To check if favicon is correct and look good on iOS, Android, Windows… well, basically everywhere run your website’s url through https://realfavicongenerator.net/favicon_checker.This is an awesome online tools that will check all browsers, platforms and technologies for you and better yet will allows you to fix them! Yes, it will create all versions of your favicon for all situations[…]

Read more

How to optimize the Magento 2 queue consumers

If your are having problem with the magento 2 cron jobs and it gets stuck or long-running you can try to optimize the way magento handles the queue consumers. By default consumers should continue polling for messages if the number of processed messages is less than the max_messages value (which can be specified in the env.php file). This is actually only[…]

Read more

Content Security Policy problem when changing store views in Magento

I recently came across a problem with the store view switch caused by the default content security policies used by default. When using different domains on store views you might notice that the redirect will not work when you chose a different store view in the language dropdown. This is caused by the content security policies that magento, by default,[…]

Read more

Minimize Magento downtime when deploying changes in production mode

Here are a few suggestions to minimize downtime on Magento, whenever you need to deploy changes in production mode. Changes on phtml template files in the child theme(no downtime) All templates are updated in folder var/view_processed (no need to delete it first) Changes in less, css, js files in the child theme(no downtime if css and js are served from[…]

Read more

How to Disable Magento 2 Reviews And Ratings

You can easily disable magento 2 reviews and ratings functionality directly in the magento backend. Go to Stores > Settings > Configuration. Open the Catalog tab and choose the Catalog option. Navigate to the Product Reviews section and set No in the Enabled field. Save the changes. If you are running a version were you do not have that option then remove[…]

Read more