Example #1
0
 /**
  * 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);
 }
Example #2
0
 /**
  * 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;
 }