I want to get the current product information in a controller.
I created a function in block, and called that function in my phtml file.
How can I accomplish this task?
I want to get the current product information in a controller.
I created a function in block, and called that function in my phtml file.
How can I accomplish this task?
2
Answers
To get product detail through controller you can refer to following links :
http://blog.chapagain.com.np/magento-2-get-current-category-current-product/
https://www.mageplaza.com/how-get-current-product-category-magento-2.html
With reference from this article – https://www.atwix.com/magento-2/alternatives-for-deprecated-registry-class-magento-2-3/
You can: