This tutorial is about Get post data, in observer Magento 2 .i.e how to get post data, in Checkout success observer in Magento 2 or any save after observer action. And in this tutorial, I will try to explain it briefly and in a simple way.
We can add the request to a class through dependency injection and access it via a singleton.
Use the following code:
public function __construct(
$this->_request = $request;
Inside function get post data in the following way:
That’s it from this tutorial. I hope it serves the purpose. Since these are learning tutorials, please feel free to drop any suggestions or queries in the comments section. That will definitely be highly appreciated.
Give A Rating
Average Rating / 5. Vote Count