add used vouchers to order

This commit is contained in:
Daniel Seifert 2015-02-04 16:41:20 +01:00
parent fd3f10017f
commit d1aba87fd9

View File

@ -34,7 +34,6 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
// add this order articles to basket and recalculate basket // add this order articles to basket and recalculate basket
$this->_addOrderArticlesToBasket($oBasket, $oOrderArticles); $this->_addOrderArticlesToBasket($oBasket, $oOrderArticles);
// recalculating basket // recalculating basket
$oBasket->calculateBasket(true); $oBasket->calculateBasket(true);
$oBasket->d3ClearBasketItemArticles(); $oBasket->d3ClearBasketItemArticles();
@ -63,6 +62,7 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
public function d3getLastOrder() public function d3getLastOrder()
{ {
$this->load($this->d3getLastOrderId()); $this->load($this->d3getLastOrderId());
$this->_d3AddVouchers();
} }
/** /**
@ -78,4 +78,17 @@ class d3_dev_oxorder extends d3_dev_oxorder_parent
return $oBasket; return $oBasket;
} }
protected function _d3AddVouchers()
{
$sSelect = "SELECT oxid FROM oxvouchers WHERE oxorderid = ".oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->quote($this->getId()).";";
$aResult = oxDb::getDb(oxDb::FETCH_MODE_ASSOC)->getArray($sSelect);
foreach ($aResult as $aFields) {
$oVoucher = oxNew('oxvoucher');
$oVoucher->load($aFields['oxid']);
$this->_aVoucherList[$oVoucher->getId()] = $oVoucher;
}
}
} }