How to Aceess this Values. use any loop?












0















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()



enter image description here










share|improve this question

























  • I am not sure it is possible without a loop. You have function getAllTrackings but if you are sure you want the first, you'll need to array_shift on both trackings and progressdetails.

    – Christophe Ferreboeuf
    Mar 10 '16 at 8:48
















0















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()



enter image description here










share|improve this question

























  • I am not sure it is possible without a loop. You have function getAllTrackings but if you are sure you want the first, you'll need to array_shift on both trackings and progressdetails.

    – Christophe Ferreboeuf
    Mar 10 '16 at 8:48














0












0








0








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()



enter image description here










share|improve this question
















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()



enter image description here







magento-1.9 fedex






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 35 mins ago









Teja Bhagavan Kollepara

3,01241949




3,01241949










asked Mar 10 '16 at 8:34









Ashvin MonparaAshvin Monpara

1,096620




1,096620













  • I am not sure it is possible without a loop. You have function getAllTrackings but if you are sure you want the first, you'll need to array_shift on both trackings and progressdetails.

    – Christophe Ferreboeuf
    Mar 10 '16 at 8:48



















  • I am not sure it is possible without a loop. You have function getAllTrackings but if you are sure you want the first, you'll need to array_shift on both trackings and progressdetails.

    – Christophe Ferreboeuf
    Mar 10 '16 at 8:48

















I am not sure it is possible without a loop. You have function getAllTrackings but if you are sure you want the first, you'll need to array_shift on both trackings and progressdetails.

– Christophe Ferreboeuf
Mar 10 '16 at 8:48





I am not sure it is possible without a loop. You have function getAllTrackings but if you are sure you want the first, you'll need to array_shift on both trackings and progressdetails.

– Christophe Ferreboeuf
Mar 10 '16 at 8:48










3 Answers
3






active

oldest

votes


















1














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'];






share|improve this answer





















  • 1





    welcome :) Happy Coding

    – Ajay Patel
    Mar 11 '16 at 9:04



















0














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();
}





share|improve this answer


























  • @AshvinMonpara see my edit

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:50











  • i try this anwer but not give any data

    – Ashvin Monpara
    Mar 10 '16 at 9:06



















0














Using below code



I assume $response is model here and trackings have only one item.



$response->getCollection()->getFirstItem()->getData();


Hope this will helpful.






share|improve this answer





















  • 1





    I don't think this code will work if several trackings are being returned.

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:45











  • thanks i have create cron.php But Not Give any Data

    – Ashvin Monpara
    Mar 10 '16 at 8:47













  • That is correct but in question have only one trackings so i suggest this one.

    – Prashant Valanda
    Mar 10 '16 at 8:48











  • @PrashantValanda how do you know there's only one tracking ? As we can see the end of the response

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:50











  • I have this code in cron.php but not give any data

    – Ashvin Monpara
    Mar 10 '16 at 8:51












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f105573%2fhow-to-aceess-this-values-use-any-loop%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














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'];






share|improve this answer





















  • 1





    welcome :) Happy Coding

    – Ajay Patel
    Mar 11 '16 at 9:04
















1














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'];






share|improve this answer





















  • 1





    welcome :) Happy Coding

    – Ajay Patel
    Mar 11 '16 at 9:04














1












1








1







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'];






share|improve this answer















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'];







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 11 '16 at 8:58

























answered Mar 10 '16 at 9:22









Ajay PatelAjay Patel

1,0491627




1,0491627








  • 1





    welcome :) Happy Coding

    – Ajay Patel
    Mar 11 '16 at 9:04














  • 1





    welcome :) Happy Coding

    – Ajay Patel
    Mar 11 '16 at 9:04








1




1





welcome :) Happy Coding

– Ajay Patel
Mar 11 '16 at 9:04





welcome :) Happy Coding

– Ajay Patel
Mar 11 '16 at 9:04













0














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();
}





share|improve this answer


























  • @AshvinMonpara see my edit

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:50











  • i try this anwer but not give any data

    – Ashvin Monpara
    Mar 10 '16 at 9:06
















0














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();
}





share|improve this answer


























  • @AshvinMonpara see my edit

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:50











  • i try this anwer but not give any data

    – Ashvin Monpara
    Mar 10 '16 at 9:06














0












0








0







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();
}





share|improve this answer















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();
}






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 10 '16 at 8:45

























answered Mar 10 '16 at 8:39









Raphael at Digital PianismRaphael at Digital Pianism

55k22121279




55k22121279













  • @AshvinMonpara see my edit

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:50











  • i try this anwer but not give any data

    – Ashvin Monpara
    Mar 10 '16 at 9:06



















  • @AshvinMonpara see my edit

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:50











  • i try this anwer but not give any data

    – Ashvin Monpara
    Mar 10 '16 at 9:06

















@AshvinMonpara see my edit

– Raphael at Digital Pianism
Mar 10 '16 at 8:50





@AshvinMonpara see my edit

– Raphael at Digital Pianism
Mar 10 '16 at 8:50













i try this anwer but not give any data

– Ashvin Monpara
Mar 10 '16 at 9:06





i try this anwer but not give any data

– Ashvin Monpara
Mar 10 '16 at 9:06











0














Using below code



I assume $response is model here and trackings have only one item.



$response->getCollection()->getFirstItem()->getData();


Hope this will helpful.






share|improve this answer





















  • 1





    I don't think this code will work if several trackings are being returned.

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:45











  • thanks i have create cron.php But Not Give any Data

    – Ashvin Monpara
    Mar 10 '16 at 8:47













  • That is correct but in question have only one trackings so i suggest this one.

    – Prashant Valanda
    Mar 10 '16 at 8:48











  • @PrashantValanda how do you know there's only one tracking ? As we can see the end of the response

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:50











  • I have this code in cron.php but not give any data

    – Ashvin Monpara
    Mar 10 '16 at 8:51
















0














Using below code



I assume $response is model here and trackings have only one item.



$response->getCollection()->getFirstItem()->getData();


Hope this will helpful.






share|improve this answer





















  • 1





    I don't think this code will work if several trackings are being returned.

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:45











  • thanks i have create cron.php But Not Give any Data

    – Ashvin Monpara
    Mar 10 '16 at 8:47













  • That is correct but in question have only one trackings so i suggest this one.

    – Prashant Valanda
    Mar 10 '16 at 8:48











  • @PrashantValanda how do you know there's only one tracking ? As we can see the end of the response

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:50











  • I have this code in cron.php but not give any data

    – Ashvin Monpara
    Mar 10 '16 at 8:51














0












0








0







Using below code



I assume $response is model here and trackings have only one item.



$response->getCollection()->getFirstItem()->getData();


Hope this will helpful.






share|improve this answer















Using below code



I assume $response is model here and trackings have only one item.



$response->getCollection()->getFirstItem()->getData();


Hope this will helpful.







share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 10 '16 at 8:57

























answered Mar 10 '16 at 8:44









Prashant ValandaPrashant Valanda

9,85212355




9,85212355








  • 1





    I don't think this code will work if several trackings are being returned.

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:45











  • thanks i have create cron.php But Not Give any Data

    – Ashvin Monpara
    Mar 10 '16 at 8:47













  • That is correct but in question have only one trackings so i suggest this one.

    – Prashant Valanda
    Mar 10 '16 at 8:48











  • @PrashantValanda how do you know there's only one tracking ? As we can see the end of the response

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:50











  • I have this code in cron.php but not give any data

    – Ashvin Monpara
    Mar 10 '16 at 8:51














  • 1





    I don't think this code will work if several trackings are being returned.

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:45











  • thanks i have create cron.php But Not Give any Data

    – Ashvin Monpara
    Mar 10 '16 at 8:47













  • That is correct but in question have only one trackings so i suggest this one.

    – Prashant Valanda
    Mar 10 '16 at 8:48











  • @PrashantValanda how do you know there's only one tracking ? As we can see the end of the response

    – Raphael at Digital Pianism
    Mar 10 '16 at 8:50











  • I have this code in cron.php but not give any data

    – Ashvin Monpara
    Mar 10 '16 at 8:51








1




1





I don't think this code will work if several trackings are being returned.

– Raphael at Digital Pianism
Mar 10 '16 at 8:45





I don't think this code will work if several trackings are being returned.

– Raphael at Digital Pianism
Mar 10 '16 at 8:45













thanks i have create cron.php But Not Give any Data

– Ashvin Monpara
Mar 10 '16 at 8:47







thanks i have create cron.php But Not Give any Data

– Ashvin Monpara
Mar 10 '16 at 8:47















That is correct but in question have only one trackings so i suggest this one.

– Prashant Valanda
Mar 10 '16 at 8:48





That is correct but in question have only one trackings so i suggest this one.

– Prashant Valanda
Mar 10 '16 at 8:48













@PrashantValanda how do you know there's only one tracking ? As we can see the end of the response

– Raphael at Digital Pianism
Mar 10 '16 at 8:50





@PrashantValanda how do you know there's only one tracking ? As we can see the end of the response

– Raphael at Digital Pianism
Mar 10 '16 at 8:50













I have this code in cron.php but not give any data

– Ashvin Monpara
Mar 10 '16 at 8:51





I have this code in cron.php but not give any data

– Ashvin Monpara
Mar 10 '16 at 8:51


















draft saved

draft discarded




















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f105573%2fhow-to-aceess-this-values-use-any-loop%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

What other Star Trek series did the main TNG cast show up in?

Berlina muro

Berlina aerponto