I am with magento 2.3.4, and I want to capture the information:
product
order
client
I would also like to know how I can print the data on the console. I am using the observer when ordering checkout_onepage_controller_success_action
I am trying to capture the information from the observer but nothing shows me
<?php
namespace Nasser\Integracion\Observer;
use Magento\Framework\Event\ObserverInterface;
class Test implements ObserverInterface{
protected $_logger;
protected $requester;
protected $messageManager;
public function __construct(
\Psr\Log\LoggerInterface $logger,
\Nasser\Integracion\Helper\Requester $requester,
\Magento\Framework\Message\ManagerInterface $messageManager
)
{
$this->_logger=$logger;
$this->requester=$requester;
$this->messageManager = $messageManager;
}
public function execute(\Magento\Framework\Event\Observer $observer){
$data = $observer->getEvent()->getData();
$this->_logger->info('Data', $data);
// $this->messageManager->addNotice(__('Hola este'));
$erpId = $this->requester->createPedido([]);
}}
I hope you can help me