i want to get form data from checkout page in 2nd step, so i have use event observer.
I have use this controller_action_predispatch_checkout
event.
I want to get post data so i have try this link Get post data, in Checkout success observer but not able to get post data.
Can any one help me how can i get post data?
event.xml
<event name="controller_action_predispatch_checkout">
<observer name="ptg_paymentevent_observer_checkoutpredispatchobserver" instance="Ptg\Paymentevent\Observer\Checkoutpredispatchobserver" />
</event>
Checkoutpredispatchobserver.php
<?php
namespace Ptg\Paymentevent\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer as EventObserver;
class Checkoutpredispatchobserver implements ObserverInterface
{
protected $_request;
public function __construct(
\Magento\Framework\App\RequestInterface $request
)
{
$this->_request = $request;
}
public function execute(\Magento\Framework\Event\Observer $observer)
{
//$order= $observer->getData('order');
//$order->doSomething(); product = $observer->getEvent()->getProduct();
$reqeustParams = $this->_request->getParams();
echo '<pre>';
var_dump($reqeustParams);
echo '</pre>';
return $this;
}
}
}
}