OXID eShop CE  4.10.4
 All Classes Namespaces Files Functions Variables Pages
account_noticelist.php
Go to the documentation of this file.
1 <?php
2 
11 {
12 
18  protected $_sThisTemplate = 'page/account/noticelist.tpl';
19 
25  protected $_aNoticeProductList = null;
26 
32  protected $_aSimilarProductList = null;
33 
39  protected $_aRecommList = null;
40 
47 
53  protected $_aSimilarRecommListIds = null;
54 
65  public function render()
66  {
68 
69  // is logged in ?
70  $oUser = $this->getUser();
71  if (!$oUser) {
72  return $this->_sThisTemplate = $this->_sThisLoginTemplate;
73  }
74 
75  return $this->_sThisTemplate;
76  }
77 
86  public function getNavigationParams()
87  {
88  $aParams = parent::getNavigationParams();
89 
90 
91  return $aParams;
92  }
93 
99  public function getNoticeProductList()
100  {
101  if ($this->_aNoticeProductList === null) {
102  if ($oUser = $this->getUser()) {
103  $this->_aNoticeProductList = $oUser->getBasket('noticelist')->getArticles();
104  }
105  }
106 
108  }
109 
115  public function getSimilarProducts()
116  {
117  // similar products list
118  if ($this->_aSimilarProductList === null && count($this->getNoticeProductList())) {
119 
120  // just ensuring that next call will skip this check
121  $this->_aSimilarProductList = false;
122 
123  // loading similar products
124  if ($oSimilarProd = current($this->getNoticeProductList())) {
125  $this->_aSimilarProductList = $oSimilarProd->getSimilarProducts();
126  }
127  }
128 
130  }
131 
137  public function getSimilarRecommListIds()
138  {
139  if ($this->_aSimilarRecommListIds === null) {
140  $this->_aSimilarRecommListIds = false;
141 
142  $aNoticeProdList = $this->getNoticeProductList();
143  if (is_array($aNoticeProdList) && count($aNoticeProdList)) {
144  $this->_aSimilarRecommListIds = array_keys($aNoticeProdList);
145  }
146  }
147 
149  }
150 
156  public function getBreadCrumb()
157  {
158  $aPaths = array();
159  $aPath = array();
160 
161  $oLang = oxRegistry::getLang();
162  $sSelfLink = $this->getViewConfig()->getSelfLink();
163 
164  $iBaseLanguage = $oLang->getBaseLanguage();
165  $aPath['title'] = $oLang->translateString('MY_ACCOUNT', $iBaseLanguage, false);
166  $aPath['link'] = oxRegistry::get("oxSeoEncoder")->getStaticUrl($sSelfLink . "cl=account");
167  $aPaths[] = $aPath;
168 
169  $aPath['title'] = $oLang->translateString('MY_WISH_LIST', $iBaseLanguage, false);
170  $aPath['link'] = $this->getLink();
171  $aPaths[] = $aPath;
172 
173  return $aPaths;
174  }
175 }