コード例 #1
0
ファイル: Article.php プロジェクト: Alpha-Sys/oxideshop_ce
 /**
  * Applies currency factor
  *
  * @param oxPrice $oPrice Price object
  * @param object  $oCur   Currency object
  */
 protected function _applyCurrency(\OxidEsales\EshopCommunity\Core\Price $oPrice, $oCur = null)
 {
     if (!$oCur) {
         $oCur = $this->getConfig()->getActShopCurrencyObject();
     }
     $oPrice->multiply($oCur->rate);
 }
コード例 #2
0
ファイル: Price.php プロジェクト: Alpha-Sys/oxideshop_ce
 /**
  * Compares this object to another oxPrice objects. Comparison is performed on brutto price.
  * Result is equal to:
  *   0 - when prices are equal.
  *   1 - when this price is larger than $oPrice.
  *  -1 - when this price is smaller than $oPrice.
  *
  * @param oxPrice $oPrice price object
  *
  * @return null
  */
 public function compare(\OxidEsales\EshopCommunity\Core\Price $oPrice)
 {
     $dBruttoPrice1 = $this->getBruttoPrice();
     $dBruttoPrice2 = $oPrice->getBruttoPrice();
     if ($dBruttoPrice1 == $dBruttoPrice2) {
         $iRes = 0;
     } elseif ($dBruttoPrice1 > $dBruttoPrice2) {
         $iRes = 1;
     } else {
         $iRes = -1;
     }
     return $iRes;
 }