actually i do this for retrieve my order details on magento checkout success page
<?php
$order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order_details = Mage::getModel('sales/order')->loadByIncrementId($order_id);
$shipping_address_data = $order_details->getShippingAddress();
?>
<tr>
<th><?php echo $this->__('Item Description') ?></th>
<th><?php echo $this->__('Manufacture') ?></th>
<th><?php echo $this->__('Color') ?></th>
<th><?php echo $this->__('Size') ?></th>
<th><?php echo $this->__('Qty') ?></th>
<th><?php echo $this->__('Unit Price') ?></th>
</tr>
<?php foreach($order_details->getAllVisibleItems() as $item): ?>
<tr>
<td><?php echo $item->getName() ?></td>
<td><?php echo $item->getManufacture() ?> </td>
<td><?php echo $item->getSize() ?> </td>
<td><?php echo $item->getColor() ?></td>
<td><?php echo round($item->getQtyOrdered(), 0) ?></td>
<td><?php echo Mage::helper("core")->currency($item->getPrice()) ?></td>
</tr>
<?php endforeach ?>
<?php echo "<br>" . $shipping_address_data['country_name']; ?>
All is work fine except size, color, manufacture, and country name ( not showing )
Actually what's wrong with the code, anyone have a suggestion ?
Thanks
$item is not give whole product dat
a,it is give how may product item
was ordered and it product some product name ,qty etc.
If you want get product ,then you will need to load product by item product id.
$_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$item->getSku());
echo $_product->getManufacture() ;
echo $_product->getSize(); //size optionid
echo $_product->getColor(); //color otion id
echo $_product->getAttributeText('color');
echo $_product->getAttributeText('size'); // size optionlabel
use getAllItems instead of getAllVisibleItems
<?php
foreach($order_details->getAllItems () as $item):
echo "<pre>";print_r($item->getData());die;
endforeach;
?>
print your result and check if you are getting the attributes value