Skip to main content
add script
Source Link
Jimit Bhavsar
  • 1k
  • 1
  • 16
  • 38

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;
        }
  
        }
  }
}

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?

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;
        }
  
        }
  }
}
deleted 2 characters in body
Source Link
sv3n
  • 11.7k
  • 7
  • 41
  • 73

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 https://magento.stackexchange.com/questions/166917/get-post-data-in-checkout-success-observer/166918 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?

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 https://magento.stackexchange.com/questions/166917/get-post-data-in-checkout-success-observer/166918 link but not able to get post data.

Can any one help me how can i get post data?

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?

Source Link
Jimit Bhavsar
  • 1k
  • 1
  • 16
  • 38

Not able to get post data from observer : M2

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 https://magento.stackexchange.com/questions/166917/get-post-data-in-checkout-success-observer/166918 link but not able to get post data.

Can any one help me how can i get post data?