Web Analytics

Fill the form & Get Installation Support

Working with registry objects in Magento 2

Besides the improvements, Magento 2 still has the old features like allow you to have the registry to register global variable using stable registry method.

However, instead of Mage::registry, in Magento 2, it has become \Magento\Framework\Registry. There are two main methods to set registry variable such as register for installing and registry for restoring data.

In this post, we are going to show you the way to create or use your own custom registry & retrieve global Magento 2 registry objects like category, cms page, current product, cms block, et cetera.

You just need to follow code snippet below in order to work with registry objects in Magento 2:

It is quite a simple tutorial. Believe that you can apply it in the same way.

Fill the below form if you have any Magento programming need.





    Recent Articles

    Author Info

    Author Image

    Magento Certified Developer

    Hire J. Lakum

    Get a Free Quote





      /* second popup */

      Connect With Us