OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
account_order.php
Go to the documentation of this file.
1 <?php
2 
11 class Account_Order extends Account
12 {
17  protected $_iAllArtCnt = 0;
18 
23  protected $_iCntPages = null;
24 
29  protected $_sThisTemplate = 'page/account/order.tpl';
30 
36  protected $_aOrderList = null;
37 
43  protected $_aArticlesList = null;
44 
52  public function render()
53  {
55 
56  // is logged in ?
57  $oUser = $this->getUser();
58  if ( !$oUser ) {
59  return $this->_sThisTemplate = $this->_sThisLoginTemplate;
60  }
61 
62  return $this->_sThisTemplate;
63  }
64 
70  public function getOrderList()
71  {
72  if ( $this->_aOrderList === null ) {
73  $this->_aOrderList = array();
74 
75  // Load user Orderlist
76  if ( $oUser = $this->getUser() ) {
77  $iNrofCatArticles = (int) $this->getConfig()->getConfigParam( 'iNrofCatArticles' );
78  $iNrofCatArticles = $iNrofCatArticles?$iNrofCatArticles:1;
79  $this->_iAllArtCnt = $oUser->getOrderCount();
80  if ( $this->_iAllArtCnt && $this->_iAllArtCnt > 0 ) {
81  $this->_aOrderList = $oUser->getOrders( $iNrofCatArticles, $this->getActPage() );
82  $this->_iCntPages = round( $this->_iAllArtCnt/$iNrofCatArticles + 0.49 );
83  }
84  }
85  }
86  return $this->_aOrderList;
87  }
88 
94  public function getOrderArticleList()
95  {
96  if ( $this->_aArticlesList === null ) {
97 
98  // marking as set
99  $this->_aArticlesList = false;
100  $oOrdersList = $this->getOrderList();
101  if ( $oOrdersList && $oOrdersList->count() ) {
102  $this->_aArticlesList = oxNew( 'oxarticlelist' );
103  $this->_aArticlesList->loadOrderArticles( $oOrdersList );
104  }
105  }
106  return $this->_aArticlesList;
107  }
108 
114  public function getPageNavigation()
115  {
116  if ( $this->_oPageNavigation === null ) {
117  $this->_oPageNavigation = $this->generatePageNavigation();
118  }
119  return $this->_oPageNavigation;
120  }
121 
127  public function getBreadCrumb()
128  {
129  $aPaths = array();
130  $aPath = array();
131  $aPath['title'] = oxRegistry::getLang()->translateString( 'MY_ACCOUNT', oxRegistry::getLang()->getBaseLanguage(), false );
132  $aPath['link'] = oxRegistry::get("oxSeoEncoder")->getStaticUrl( $this->getViewConfig()->getSelfLink() . 'cl=account' );
133  $aPaths[] = $aPath;
134 
135  $aPath['title'] = oxRegistry::getLang()->translateString( 'ORDER_HISTORY', oxRegistry::getLang()->getBaseLanguage(), false );
136  $aPath['link'] = $this->getLink();
137  $aPaths[] = $aPath;
138 
139  return $aPaths;
140  }
141 }