0

I want to preview all the details inside the object such as Order, Customers after saving the event. I tired below way but it not printing the object inside attributes....

Customer Object Magento\Customer\Model\Data\Customer

$order = $observer->getEvent()->getOrder();
$var_dump($order);

and

$customer= $observer->getEvent()->getCustomer();
$var_dump($customer);

also 

print_r($customer->debug());
0

try this

$customer = $observer->getCustomerDataObject(); 
print_r($customer->debug());
|improve this answer|||||
0

Try this

$order = $observer->getEvent()->getOrder();
print_r($order->getData()); 
// or specific variable name like
print_r($order->getOrderId()); 
and

$customer= $observer->getEvent()->getCustomer();
print_r($customer->getId());
print_r($customer->getName());
print_r($customer->getEmail());
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.