示例#1
0
 function getBasePrice($dAmount = 1)
 {
     if ($this->dBasePriceCache) {
         return $this->dBasePriceCache;
     } else {
         return parent::getBasePrice();
     }
 }
示例#2
0
 /**
  * Checks if discount applies for article
  *
  * @param oxArticle $oArticle article object
  *
  * @return bool
  */
 public function isForArticle($oArticle)
 {
     // item discounts may only be applied for basket
     if ($this->oxdiscount__oxaddsumtype->value == 'itm') {
         return false;
     }
     if ($this->oxdiscount__oxamount->value || $this->oxdiscount__oxprice->value) {
         return false;
     }
     if ($this->oxdiscount__oxpriceto->value && $this->oxdiscount__oxpriceto->value < $oArticle->getBasePrice()) {
         return false;
     }
     if ($this->isGlobalDiscount()) {
         return true;
     }
     $sArticleId = $oArticle->getProductId();
     if (!isset($this->_aHasArticleDiscounts[$sArticleId])) {
         $blResult = $this->_isArticleAssigned($oArticle) || $this->_isCategoriesAssigned($oArticle->getCategoryIds());
         $this->_aHasArticleDiscounts[$sArticleId] = $blResult;
     }
     return $this->_aHasArticleDiscounts[$sArticleId];
 }
示例#3
0
 /**
  * Test enable price load.
  *
  * @depends testDisablePriceLoad
  *
  * @param oxArticle $oArticle
  *
  * @return null
  */
 public function testEnablePriceLoad(oxArticle $oArticle)
 {
     $oArticle->enablePriceLoad();
     $this->assertNotNull($oArticle->getBasePrice());
 }