check your below line $customer = $objectManager->create('Magento\Customer\ Model\Customer')->load($customer);. It should be $customer ...
... get order details in checkout_submit_all_after event. My Observer class is php namespace Cloudways\EventsObservers\Observer\Product ...
You can't get product id like this $observer->getEvent()->getProduct()->getId();. This is order event not product event public function ...
use Magento\ Framework\Event\ObserverInterface;
checkout_onepage_controller_success_action give you order id's. by using $ observer->getEvent()->getOrderIds() . This does not given order object directly so , ...
How to Get Order Data From Magento 2 “sales_order_place_after” Event
How to Get Order Status in sales order place after event Magento 2
magento 2 order status change event & sales_order_save_after observer. Create a file events.xml in app/code/[Namspace]/[Module_Name]/etc
Admin may want to retrieve the order status or the complete order data to send it to the
Get Magento insight from. Magento 2