如何将magento checkout成功页面作为发票

has anyone know the reference or link to make magento checkout onepage success style as invoice, i use to copying some code from review.phtml page into checkout_onepage_success

<div id="checkout-review-table-wrapper">
    <table class="data-table" id="checkout-review-table">
        <?php if ($this->helper('tax')->displayCartBothPrices()): $colspan = $rowspan = 2; else: $colspan = $rowspan = 1; endif; ?>
        <col />
        <col width="1" />
        <col width="1" />
        <col width="1" />
        <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
        <col width="1" />
        <col width="1" />
        <?php endif; ?>
        <thead>
            <tr>
                <th rowspan="<?php echo $rowspan ?>"><?php echo $this->__('Product Name') ?></th>
                <th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Price') ?></th>
                <th rowspan="<?php echo $rowspan ?>" class="a-center"><?php echo $this->__('Qty') ?></th>
                <th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Subtotal') ?></th>
            </tr>
            <?php if ($this->helper('tax')->displayCartBothPrices()): ?>
                <tr>
                    <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
                    <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
                    <th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
                    <th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
                </tr>
            <?php endif; ?>
        </thead>
        <?php echo $this->getChildHtml('totals'); ?>
        <tbody>
        <?php foreach($this->getItems() as $_item): ?>
            <?php echo $this->getItemHtml($_item)?>
        <?php endforeach ?>
        </tbody>
    </table>
</div>
<?php echo $this->getChildHtml('items_after'); ?>
<script type="text/javascript">
//<![CDATA[
    decorateTable('checkout-review-table');
    truncateOptions();
//]]>
</script>

but it only showing the table header, i also need include the adress to it instead the order table, thanks

You can get the recent order ID and then load the order on success.phtml file.

$order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);

After you can use

$order

to fetch whatever data you want to use. In your case, you can get all the items via

$items = $order->getAllItems();

and then loop through it.

//get the order details.
$order_id = Mage::getSingleton('checkout/session')
>getLastRealOrderId();
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
//get billing address.
$billingAddress = $order->getBillingAddress();
//get shipping address.
$shippingAddress = $order->getShippingAddress();