Adding blocks to the head section in Magento 2
As we all know, the page’s HTML <head> section contains different meta tags, CSS and JS files definition, pieces of JS code etc. As a rule, we don’t need any complex logic to add some proper content there. However, let’s imagine the situation when we need to insert some element that depends on the system configuration or so into the head section.
Magento 1 vs. Magento 2. The reasons for upgrade to Magento 2
We remember the time when we were waiting for Magento 2 release and were so excited when it happened. Magento team put a lot of effort into that release and delighted us with new improvements. Since that time, many store owners come curious to know if they should move the store from Magento 1 to Magento 2 and if so – when it should happen.
Magento 2 directives
Have you ever edited a CMS page? Perhaps you’ve inserted a custom image or just added a link to another page of your store. What did you do for that? We assume that you simply copy-pasted the link from your browser and inserted it to the CMS page directly. Then, you have edited one more CMS page or block in the same way. It looks like a good solution. However, imagine that one day you will need a solution for changing, let’s say, a domain name of your store. You will need to fix the old domain name in each of the edited CMS pages and blocks to prevent redirect to it. This is not good approach and, to improve that process, we should use directives.
n98-magerun2 tool for Magento 2 overview
We’ve already described the handy CLI tool for Magento 1 developers called n98-magerun and the ability to speed up the development process using it – in the article. And now we would like to talk about new n98-magerun2 for Magento 2 provided by netz98. It worth mentioning that its previous version was very popular among Magento developers and we think that n98-magerun2 should be another very useful command line interface tool for new Magento version.
So, let’s install n98-magerun2 and try how it works.
Logging system in Magento 2
Logging system is a very useful tool in Magento. It is important for developers in the code debugging process, the log files help us determine how the store works, what issues are there, which of the functions do not work correctly. In this article we are going to describe the logging system in Magneto 2 and how it differs from Magento 1.
Magento 2 system configuration
System configuration is a simple way to store single values required for application functionality in both Magento 1 and 2. In this post we will show you how to add custom system configuration settings in Magento 2.
System configuration values in Magento 2 are stored in the core_config_data database table, which is exactly the same as in Magento 1. But the xml config files differ.
Choose your perfect Event in Magento 2
One of the most powerful and commonly used technique for extending the standard logic in Magento is an event system. We have described this system in details in our previous article. It’s really useful for developers to know how the event system works. Moreover, choosing the most suitable event for a custom logic implementation is also very important part in development – so, in this article, we are going to review a list of the framework-level events that help understand which event will be perfect to observe in Magento 2.
Massive update of related products, up-sells and cross-sells in Magento 1 and Magento 2
When we need to update information for products, we can do it directly on the edit product page – however, this process requires much time in case we work with hundreds of products. And there is another way to do it as both Magento 1 and Magento 2 have the ability of massive update of related products, up-sells and cross-sells. Let’s find out more information in this article.
Event system in Magento 1 vs. Magento 2
We are going to talk about event system approach in development. The event is a very flexible way to extend application logic. This approach is actual in both Magento 1 and Magento 2. Let’s go ahead and check how it works.
Redirects in Magento 2
Redirects is a widely used approach not only in Magento but in most of other web applications. Saying “redirect” we usually mean a rule or a set of rules for sending user from one URL to another. Using Magento 1 you can easily handle redirects by writing just one line of the code, but in Magento 2, because of its new architecture based on Dependency injection, the process of building a redirect is a bit more complex. Let’s review a new redirect creation by building a simple extension that redirects user from a category page to a product view page if there’s only one product in this category.