Posts by Damir Korpar

Overriding classes in Magento 2

Compared to its previous version, Magento 2 came out with a new concept of dependency injection where classes inject dependencies (different objects) for an object instead of that object manually creating them internally. That way overriding and manipulating with classes is much easier and allows us more ways of extending the native functionalities.

Read more

Featured products in Magento 2 with Catalog Products List widget

By checking various e-commerce websites one thing which can be found in almost all of them are featured products. A list of hand-picked products, usually placed on the home page, used for promotion. So far Magento lacked that most requested feature and developers had to look for other solutions or to code one of their own. Let’s look what’s the situation like in Magento 2.

Read more

Magento Grid Serializer for Ajax Grids

Ajax Admin Grids

In Magento selectable grids, each time after a grid operation is performed (whether it’s filtering the results, pagination or something else), the selected values get lost. In other words, Magento by default keeps only values selected after the grid is initialized in the beginning and loses them each time the grid gets reloaded by Ajax call. Fortunately, Magento has a built-in library called Grid Serializer to solve this issue.

Read more

Bestseller products in Magento

Bestsellers

Bestseller products is one of the features people tend to ask about and look for when it comes to Magento. Default installation already has bestseller products option included…but these are static ones defined in a CMS page. We’re going to take it to the next level and automate it.

Read more

Magento Switchable Install Script Setup Class

When doing some database upgrades in Magento, and in general, the best and the smartest way would be to create install or upgrade scripts to keep a persistent data structure. When a core setup is not enough and attributes have to be created or updated, either the customer or catalog product setup class has to be defined. Switching between those two classes is not solved very well in Magento and this little snippet will make the switching as easy as pie.

Read more

Magento Global Tags

Tags

Most of you are familiar how Magento product tags work. They are scoped by store, can be added by both customers on frontend and admin in backend, they have to be reviewed and approved, etc. Sometimes, depending on a situation, there’s a need for a different approach. Sometimes there’s a need for tags to be store independent.

Read more

Overriding Magento blocks, models, helpers and controllers

There is no project that uses framework as is. Every now and then there is a need to change something, to add something new or to override something already written. Due to many reasons it’s a bad habit and bad programming if core files are modified and it’s not recommended at all. Therefore Magento brought in an excellent way how to override/overwrite those files.

Read more