Magento 2 Product list aggregate rating fix

During our work with the Magento 2 Rich Snippets module, we noticed numerous errors on the product list page when switched to list mode. The errors were generated by the standard Magento 2 Luma theme, when attempting to aggregate rating markup rendering for each product in the product list. This article outlines a configurable solution to address this issue. We will have an opportunity to disable this fix for any custom theme which doesn’t have this error or in case the next Magento 2 version has a fix for this included.

Setting up Magento 2 cron jobs

Scheduled background processes are important in any large system. Clean ups and keeping cache and indexes up to date allow to keep your system healthy, while some processes are simply need to be stretched in time in order to avoid high system load, memory leaks or certain services overload (massive emails sending). Setting up a cron job for such processes and for the processes that should be repeated from time to time is always a good idea. In this blog post we will describe how to set a certain part of code as a cron job in Magento 2.

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 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.

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.