OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
account_noticelist.php
Go to the documentation of this file.
1 <?php
2 
11 {
16  protected $_sThisTemplate = 'page/account/noticelist.tpl';
17 
23  protected $_aNoticeProductList = null;
24 
30  protected $_aSimilarProductList = null;
31 
37  protected $_aRecommList = null;
38 
45 
51  protected $_aSimilarRecommListIds = null;
52 
63  public function render()
64  {
66 
67  // is logged in ?
68  $oUser = $this->getUser();
69  if ( !$oUser ) {
70  return $this->_sThisTemplate = $this->_sThisLoginTemplate;
71  }
72 
73  return $this->_sThisTemplate;
74  }
75 
84  public function getNavigationParams()
85  {
86  $aParams = parent::getNavigationParams();
87 
88 
89  return $aParams;
90  }
91 
97  public function getNoticeProductList()
98  {
99  if ( $this->_aNoticeProductList === null ) {
100  if ( $oUser = $this->getUser() ) {
101  $this->_aNoticeProductList = $oUser->getBasket( 'noticelist' )->getArticles();
102  }
103  }
105  }
106 
112  public function getSimilarProducts()
113  {
114  // similar products list
115  if ( $this->_aSimilarProductList === null && count( $this->getNoticeProductList() ) ) {
116 
117  // just ensuring that next call will skip this check
118  $this->_aSimilarProductList = false;
119 
120  // loading similar products
121  if ( $oSimilarProd = current( $this->getNoticeProductList() ) ) {
122  $this->_aSimilarProductList = $oSimilarProd->getSimilarProducts();
123  }
124  }
125 
127  }
128 
134  public function getSimilarRecommListIds()
135  {
136  if ( $this->_aSimilarRecommListIds === null ) {
137  $this->_aSimilarRecommListIds = false;
138 
139  $aNoticeProdList = $this->getNoticeProductList();
140  if ( is_array( $aNoticeProdList ) && count( $aNoticeProdList ) ) {
141  $this->_aSimilarRecommListIds = array_keys( $aNoticeProdList );
142  }
143  }
145  }
146 
152  public function getBreadCrumb()
153  {
154  $aPaths = array();
155  $aPath = array();
156 
157  $aPath['title'] = oxRegistry::getLang()->translateString( 'MY_ACCOUNT', oxRegistry::getLang()->getBaseLanguage(), false );
158  $aPath['link'] = oxRegistry::get("oxSeoEncoder")->getStaticUrl( $this->getViewConfig()->getSelfLink() . "cl=account" );
159  $aPaths[] = $aPath;
160 
161  $aPath['title'] = oxRegistry::getLang()->translateString( 'MY_WISH_LIST', oxRegistry::getLang()->getBaseLanguage(), false );
162  $aPath['link'] = $this->getLink();
163  $aPaths[] = $aPath;
164 
165  return $aPaths;
166  }
167 }