Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 17th, 2012  |  syntax: None  |  size: 2.97 KB  |  hits: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <h2>Order History</h2>
  2. <?php
  3. if(is_object($this->getOrderHistory()) && $this->getOrderHistory()->getSize() > 1): ?>
  4.     <ul class="order-history">
  5.         <?php foreach($this->getOrderHistory() as $order): ?>
  6.         <li>Order number: #<?php echo $order->getIncrementId(); ?> Date: <?php echo $this->formatDate($order->getCreatedAt(),Mage_Core_Model_Locale::FORMAT_TYPE_FULL); ?>
  7.             <table class="data-table">
  8.                 <thead>
  9.                     <tr>
  10.                         <th><?php echo $this->__('Code'); ?></th>
  11.                         <th><?php echo $this->__('Product'); ?></th>
  12.                         <th><?php echo $this->__('Price'); ?> (&pound;)</th>
  13.                         <th><?php echo $this->__('Volume'); ?></th>
  14.                     </tr>
  15.                 </thead>
  16.                 <tbody>
  17.                     <?php
  18.                      foreach($order->getAllVisibleItems() as $item): ?>
  19.                         <tr><td><?php echo $item->getSku(); ?></td><td><?php echo $this->stripTags($item->getName(), null, true); ?></td><td><?php echo Mage::getModel('directory/currency')->format($item->getData('price'), array('display'=>Zend_Currency::NO_SYMBOL), false); ?></td><td><?php echo ceil($item->getData('qty_ordered')); ?></td></tr>
  20.                     <?php endforeach; ?>
  21.                 </tbody>
  22.                 <tfoot>
  23.                     <tr>
  24.                         <td colspan="4" class="a-right">
  25.                             <?php $totals = Mage::getModel('sales/quote')->load($order->getQuoteId())->getTotals();
  26.                             foreach($totals as $total): ?>
  27.                                 <?php echo $total->getTitle(); ?>: <b><?php echo Mage::helper('core')->currency($total->getValue(),true,false) ?></b>
  28.                             <?php endforeach; ?>
  29.                         </td>
  30.                     </tr>
  31.                 </tfoot>
  32.             </table>
  33.             <div class="shipping-details">
  34.             <p class="shipping-address"><?php $shipping = $order->getShippingAddress();
  35.                 foreach($shipping->getStreet() as $street): ?>
  36.                     <?php echo $street; ?><br />
  37.                 <?php endforeach; ?>
  38.                 <?php echo $shipping->getCity(); ?><br />
  39.                 <?php echo $shipping->getRegion(); ?><br />
  40.                 <?php echo $shipping->getPostcode(); ?><br />
  41.             </p>
  42.             <?php if($order->getStatus() == Mage_Sales_Model_Order::STATE_COMPLETE): ?>
  43.                 <p>
  44.                     <b><?php echo $this->__('On'); ?></b>: <?php echo $this->formatDate($order->getUpdatedAt(),Mage_Core_Model_Locale::FORMAT_TYPE_FULL); ?>
  45.                 </p>
  46.             <?php endif; ?>
  47.             <p>
  48.                 <b><?php echo $this->__('Ordered by')?></b>: <?php echo $shipping->getFirstname(); ?> <?php echo $shipping->getLastname(); ?>
  49.             </p>
  50.             </div>
  51.         </li>
  52.         <?php endforeach; ?>
  53.     </ul>
  54. <?php else: ?>
  55.     <p class="notice">You have not made any orders yet.</p>
  56. <?php endif; ?>