Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8635895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:05:09+00:00 2026-06-12T10:05:09+00:00

I have this code: $session = Mage::getSingleton(‘checkout/session’); foreach ($session->getQuote()->getAllItems() as $item) { echo $item->getName();

  • 0

I have this code:

$session = Mage::getSingleton('checkout/session');

foreach ($session->getQuote()->getAllItems() as $item) {
    echo $item->getName();
    echo $item->getId();
    echo Mage::helper('core')->formatPrice($item->getPrice());
}

But I want to get shipping address and order status of each item I ordered.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:05:10+00:00Added an answer on June 12, 2026 at 10:05 am

    To get all orders for the current log in customer

    $customerId = Mage::getSingleton('customer/session')->getCustomer()->getId();
    
    $_orders = Mage::getModel("sales/order")->getCollection()
                       ->addAttributeToSelect('*')
                       ->addFieldToFilter('customer_id', $customerId);
                       /* to get last order only -- uncomment
                       ->setOrder('created_at', Varien_Data_Collection_Db::SORT_ORDER_DESC)
                       ->setPageSize(1);
                       */
    
    
    foreach($_orders as $order) {
        foreach($order->getAllItems() as $item){
            echo $item->getName();
            echo $item->getId();
            echo Mage::helper('core')->formatPrice($item->getPrice());
        }
    
      //display status
      echo $order->getStatusLabel();
      //display shipping address
      print_r($order->getShippingAddress()->getData());
    }
    

    To get order info for a particular order by order_id then

    $order_id = 123; // put your order id here
    $_order = Mage::getModel('sales/order')->load($order_id);
    
    if(!$_order->getID()){
        echo 'Order not found.';
    }
    else{
    
       //display shipping address
       print_r($_order->getShippingAddress()->getData());
    
       foreach($_order->getAllItems() as $order) {
         echo $order->getName();
         echo $order->getId();
         echo Mage::helper('core')->formatPrice($order->getPrice());
         echo $order->getStatusLabel();
    
       }
    }
    

    This code get the customer cart (so this is before you place an order)

    $session = Mage::getSingleton('checkout/session');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have code like this: <ul> <?php foreach($persons as $key) : ?> <?php if($this->session->userdata('id_user')
In one page of our site, I have this code: $_SESSION['returnURL'] = /store/checkout/onepage; and
I have code like this: <?php if ($this->session->userdata('permission') == 4 || $this->session->userdata('permission') == 3)
Is it possible to cancel the Session Lock Event? I have this code to
i have this code trying to print an image in an html using session
Right now in Spring security I have this code: <session-management> <concurrency-control max-sessions=1 error-if-maximum-exceeded=true />
i have this code, and i'm trying to create a session in order to
I have this code: int CityID= ((User)Session[LoggedInUser]).CityID; //When I debugg I get CityID =
I have this code and its working fine Registration person = (Registration) session.get(Registration.class, 8);
I have this code in page_load method: string orgId = Session[Lineage].ToString().Split(';')[depth]; hidOrg.Value = orgId;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.