add basket total discount calculation

This commit is contained in:
Daniel Seifert 2015-02-04 17:03:02 +01:00
parent d1aba87fd9
commit a05ad3a52d

View File

@ -34,4 +34,26 @@ class d3_dev_oxbasket extends d3_dev_oxbasket_parent
$oBasketItem->d3ClearArticle();
}
}
/**
* Calculates total basket discount value.
*/
protected function _calcBasketTotalDiscount()
{
if ($this->_oTotalDiscount === null || (!$this->isAdmin())) {
$this->_oTotalDiscount = $this->_getPriceObject();
if (is_array($this->_aDiscounts)) {
foreach ($this->_aDiscounts as $oDiscount) {
// skipping bundle discounts
if ($oDiscount->sType == 'itm') {
continue;
}
// add discount value to total basket discount
$this->_oTotalDiscount->add($oDiscount->dDiscount);
}
}
}
}
}