I'm using sales_order_shipment_save_after observer to collect tracking numbers. I have tried $event->getOrder but it will not load any order object. I suppose it's the shipment observer I use as opposed to order observer. Usually, getId or getIncrementId on Order would ok. Right now I was able to get tracking number and shipment ID just fine. Is there a way to get order ID from shipment ID in Magento?
Here is what I got
$shipment = $event->getShipment();
$tracks = $shipment->getAllTracks();
foreach ($tracks as $track) {
$orderTracking = $track->getTrackNumber();
}