0

I want to customize Success Page in Magento: frontend/base/default/template/checkout/success.phtml

I want to be exactly like in the attached image. And at very bottom to have "You may also be interested in" section. This section is already exist I use ultimo theme.

I found a code that seems to work but is not have all details like in this image.

the code is:

<?php 
    $order_id = Mage::getSingleton('checkout/session')->getLastRealOrderId(); 
    $order_details = Mage::getModel('sales/order')->loadByIncrementId($order_id); 
    $shipping_address_data = $order_details->getShippingAddress();
    ?>
                <table>
                 <tr> 
                    <th><?php echo $this->__('Description') ?></th
                    <th><?php echo $this->__('Description') ?></th>
                    <th><?php echo $this->__('Qty') ?></th>
                    <th><?php echo $this->__('Unit Price') ?></th>
                </tr>

            <?php foreach($order_details->getAllVisibleItems() as $item): 
    $configItem = Mage::getModel('catalog/product')->loadByAttribute('sku', $item->getSku());
    ?> 
                <tr>
                    <td><img src="<?php echo $this->helper('catalog/image')->init($configItem, 'small_image')->resize(200); ?>" width="200" height="200" class="media-object img-responsive" alt="<?php echo $this->getImageLabel($configItem, 'small_image'); ?>"/></td>
                    <td><?php echo $item->getName() ?></td>
                    <td><?php echo round($item->getQtyOrdered(), 0) ?></td>
                    <td><?php echo Mage::helper("core")->currency($item->getPrice()) ?></td>
                </tr>
                </table>
            <?php endforeach ?> 

            <?php echo "<br>" . $shipping_address_data['country_name']; ?>

enter image description here

1

What you need is to access order information with the following code:

$order = Mage::getSingleton('checkout/session')->getLastRealOrder();
$shippingAddress = $order->getShippingAddress();
$billingAddress = $order->getShippingAddress();

Then if you want to show something, for example the shipping street address, you can use:

$shippingAddress->getStreetFull()

As well as getting the whole shipping address with:

$shippingAddress->format('html')

Of course you will have to adapt to show the information in your template.

Hope this can help you.

| improve this answer | |
  • thank you for your answer but if you check my code everything is work there, i can access the products, I can get image from products, i just need to be like there, i mean designed like there, and most import is how to add that bottom upsell's. – Robert Feb 22 '16 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.