cancel
Showing results for 
Search instead for 
Did you mean: 

AbstractProduct substitution

AbstractProduct substitution

Hello,

\Magento\Catalog\Block\Product\AbstractProduct is deprecated since 101.1.0.

Could anyone tell what is the good/substitute solution?

2 REPLIES

Re: AbstractProduct substitution

Which API functions within it are you looking to use.  https://github.com/magento/magento2/blob/2.2-develop/app/code/Magento/Catalog/Block/Product/View.php might be useful if you need getAddToCartURL

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: AbstractProduct substitution

Yeah the view.php class seems like a good workaround until AbstractProduct gets a replacement. View.php extends AbstractProduct so it has everything you need, and ideally when abstract product gets replaced the view class will get updated to extend that and your underlying class will just continue to happily keep working without realizing what happened.