Why & How to Implement Virtual Types in Magento 2?

Likes (1)   Dislikes (0)  
  (1 reviews)

Virtual Types in Magento 2 is something that is not an actual class implemented anywhere in our module file system. Rather it is a configured class that is generated automatically for us by Magento 2 code generation library. Yes, we have to just configure a Virtual Type definition in our di.xml file and run the

How to write log to custom files in Magento 2

Likes (2)   Dislikes (0)  
  (2 reviews)

Logging is a very important aspect of any programming language. Logs help us debug our code and finally identify issues in it. We do write logs to keep track of things, to debug our code and to report errors in any programming language. Magento 2 provided us a great logging library from PSR. But this

How to Collect Totals In Magento 2 Application

Likes (2)   Dislikes (0)  
  (2 reviews)

For a merchant the default Magento business implementation is not always enough. They always demand something that can add to their revenueđź’°. As a developer we should have this knowledge to implement or showcase them the way Magento 2 adds additional costsđź’˛on top of the existing features. In this tutorial we will learn about the

How to use Magento 2 ViewModel like a Pro

Likes (3)   Dislikes (0)  
magento2-view-models

This is just a thing of personal preference how would you like to manage your code and all that. Stop using old school Blocks or Helpers for reading data and providing to PHTML. Use new PSR compatible ViewModels concept instead. Follow the Separation of Concern principle to the fullest. Make your code more readable, maintainable and reusable. Inject your ViewModels via layout and start consuming them from views.

How to Configure Redis on Magento 2 Using Docker Compose

Likes (1)   Dislikes (0)  

Redis is a key value pair in memory database. This is incredible fast for data retrieval. We can use Redis for cache and session storage. Magento 2 has an optional implementation of Redis for both cache and session storage which we can configure if required. In most of the production Magento 2 websites you will see the Redis integration. In this tutorial we will integrate Redis with docker compose for Magento 2.

How to setup Magento 2 on Docker for development

Likes (1)   Dislikes (0)  
Setup Magento 2 on top of Docker

In this tutorial, we will set up Magento 2 development environment on top of Docker. We will install a fresh Magento v2.4.5 on Docker. Assuming we have nothing yet, no code base no database, etc. Everything we will start from scratch on the docker container. We will prepare a docker-compose file for Magento 2 setup