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