Mage_Sales_Block_Order_History Class Reference

Inheritance diagram for Mage_Sales_Block_Order_History:

Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getPagerHtml ()
 getViewUrl ($order)
 getTrackUrl ($order)
 getReorderUrl ($order)
 getBackUrl ()

Protected Member Functions

 _prepareLayout ()


Detailed Description

Definition at line 35 of file History.php.


Constructor & Destructor Documentation

__construct (  ) 

Constructor

By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes

Reimplemented from Varien_Object.

Definition at line 38 of file History.php.

00039     {
00040         parent::__construct();
00041         $this->setTemplate('sales/order/history.phtml');
00042 
00043         //TODO: add full name logic
00044         $orders = Mage::getResourceModel('sales/order_collection')
00045             ->addAttributeToSelect('*')
00046             ->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')
00047             ->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')
00048             ->addAttributeToFilter('customer_id', Mage::getSingleton('customer/session')->getCustomer()->getId())
00049             ->addAttributeToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
00050             ->addAttributeToSort('created_at', 'desc')
00051         ;
00052 
00053         $this->setOrders($orders);
00054 
00055         Mage::app()->getFrontController()->getAction()->getLayout()->getBlock('root')->setHeaderTitle(Mage::helper('sales')->__('My Orders'));
00056     }


Member Function Documentation

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 58 of file History.php.

00059     {
00060         parent::_prepareLayout();
00061 
00062         $pager = $this->getLayout()->createBlock('page/html_pager', 'sales.order.history.pager')
00063             ->setCollection($this->getOrders());
00064         $this->setChild('pager', $pager);
00065         $this->getOrders()->load();
00066         return $this;
00067     }

getBackUrl (  ) 

Definition at line 89 of file History.php.

00090     {
00091         return $this->getUrl('customer/account/');
00092     }

getPagerHtml (  ) 

Definition at line 69 of file History.php.

00070     {
00071         return $this->getChildHtml('pager');
00072     }

getReorderUrl ( order  ) 

Definition at line 84 of file History.php.

00085     {
00086         return $this->getUrl('*/*/reorder', array('order_id' => $order->getId()));
00087     }

getTrackUrl ( order  ) 

Definition at line 79 of file History.php.

00080     {
00081         return $this->getUrl('*/*/track', array('order_id' => $order->getId()));
00082     }

getViewUrl ( order  ) 

Definition at line 74 of file History.php.

00075     {
00076         return $this->getUrl('*/*/view', array('order_id' => $order->getId()));
00077     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:40 2009 for Magento by  doxygen 1.5.8