add basket total discount calculation
This commit is contained in:
parent
d1aba87fd9
commit
a05ad3a52d
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user