OXID eShop CE  4.8.11
 All Classes Files Functions Variables Pages
pricealarm_mail.php
Go to the documentation of this file.
1 <?php
2 
9 {
17  public function render()
18  {
19  $myConfig = $this->getConfig();
20 
22  // #889C - Netto prices in Admin
23  $sIndex="";
24  if ( $myConfig->getConfigParam( 'blEnterNetPrice' ) )
25  $sIndex = " * ". (1+$myConfig->getConfigParam( 'dDefaultVAT' )/100);
26 
27  $sShopID = $myConfig->getShopId();
28  //articles price in subshop and baseshop can be different
29  $this->_aViewData['iAllCnt'] = 0;
30  $sQ = "select oxprice, oxartid from oxpricealarm where oxsended = '000-00-00 00:00:00' and oxshopid = '$sShopID' ";
31  $rs = oxDb::getDb()->execute($sQ);
32  if ($rs != false && $rs->recordCount() > 0) {
33  $aSimpleCache = array();
34  while (!$rs->EOF) {
35  $sPrice = $rs->fields[0];
36  $sArtID = $rs->fields[1];
37  if (isset($aSimpleCache[$sArtID])) {
38  if ($aSimpleCache[$sArtID] <= $sPrice) {
39  $this->_aViewData['iAllCnt'] += 1;
40  }
41  } else {
42  $oArticle = oxNew( "oxarticle" );
43  if ( $oArticle->load($sArtID)) {
44  $dArtPrice = $aSimpleCache[$sArtID] = $oArticle->getPrice()->getBruttoPrice();
45  if ($dArtPrice <= $sPrice) {
46  $this->_aViewData['iAllCnt'] += 1;
47  }
48  }
49  }
50  $rs->moveNext();
51  }
52  }
53  return "pricealarm_mail.tpl";
54  }
55 }