0

Our Magento store is running community version 2.4.2. I noticed 'registry' is deprecated.intelephense(1007) notice at several lines in many files. Below is a screenshot of a part of a file that has this notice at different places. Please let me know if it will be fixed when I update the Magento.

enter image description here

2 Answers 2

1

A service class as an alternative option for Registry should be a class that gets needed data from the session and passes it for further/later usage. It must not contain any business logic in there – this should be done in the place where data was requested. The short answer is “from the session”. More exactly from Magento\Framework\Session\SessionManager class or any other class that inherits from it – also depends on your needs.

In Magento core there are the following specific sessions on the front-end:

Magento Customer Session – Magento\Customer\Model\Session

Magento Checkout Session – Magento\Checkout\Model\Session

Magento Catalog Session – Magento\Catalog\Model\Session

Newsletter Session – Magento\Newsletter\Model\Session

0

Here, You can find Alternatives for deprecated Registry class – Magento 2.3 Link

I am not sure It is working with 2.4.3.

Thanks...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.