How to Aceess this Values. use any loop?
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-1.9 fedex
add a comment |
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-1.9 fedex
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
add a comment |
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-1.9 fedex
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-1.9 fedex
magento-1.9 fedex
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
add a comment |
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
add a comment |
3 Answers
3
active
oldest
votes
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'];
1
welcome :) Happy Coding
– Ajay Patel
Mar 11 '16 at 9:04
add a comment |
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();
}
@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
add a comment |
Using below code
I assume $response is model here and trackings have only one item.
$response->getCollection()->getFirstItem()->getData();
Hope this will helpful.
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
|
show 3 more comments
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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'];
1
welcome :) Happy Coding
– Ajay Patel
Mar 11 '16 at 9:04
add a comment |
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'];
1
welcome :) Happy Coding
– Ajay Patel
Mar 11 '16 at 9:04
add a comment |
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'];
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'];
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
add a comment |
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
add a comment |
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();
}
@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
add a comment |
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();
}
@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
add a comment |
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();
}
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();
}
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
add a comment |
@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
add a comment |
Using below code
I assume $response is model here and trackings have only one item.
$response->getCollection()->getFirstItem()->getData();
Hope this will helpful.
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
|
show 3 more comments
Using below code
I assume $response is model here and trackings have only one item.
$response->getCollection()->getFirstItem()->getData();
Hope this will helpful.
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
|
show 3 more comments
Using below code
I assume $response is model here and trackings have only one item.
$response->getCollection()->getFirstItem()->getData();
Hope this will helpful.
Using below code
I assume $response is model here and trackings have only one item.
$response->getCollection()->getFirstItem()->getData();
Hope this will helpful.
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
|
show 3 more comments
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
|
show 3 more comments
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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