I have got the api response now i want to get only one value from the response.
I want to this value from response [progressdetails] = > array()
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI have got the api response now i want to get only one value from the response.
I want to this value from response [progressdetails] = > array()
foreach($response as $tracking_status){
$data = $tracking_status-> getAllData();
print_r($data);
}
you can also used:
$response = Mage::getModel('usa/shipping_carrier_fedex')->getTracking(track_number);
$trackData = $response->getAllTrackings();
$progressData = $trackData[0]->getData('progressdetail');
$deliveredStatus = $progressData[0]['activity'];
You use the following code assuming $response
contains your response:
foreach ($response->getTrackings() as $tracking)
{
$progressDetails = $tracking->getProgressdetail();
}
If you want to get the first progress details of the first tracking you can do:
$trackings = $response->getTrackings();
if ($trackings)
{
$firstTracking = $trackings[0];
$progressDetails = $firstTracking->getProgressdetail();
}
Using below code
I assume $response is model here and trackings have only one item.
$response->getCollection()->getFirstItem()->getData();
Hope this will helpful.