public function RemoveInvalidDiscounts($sMessangerName = null)
    {
        // since the min value of the basket for which a discount may work is affected by other discounts,
        // we need to remove the discounts first, and then add them one by one back to the basket
        // we suppress the add messages, but keep the negative messages

        $oMessageManager = TCMSMessageManager::GetInstance();

        // get copy of discounts
        $aDiscountList = $this->_items;
        $this->Destroy();
        foreach ($aDiscountList as $iDiscountKey => $oDiscount) {
            /** @var $oDiscount TdbShopDiscount */
            $cDiscountAllowUseCode = $oDiscount->AllowUseOfDiscount();
            if (TdbShopDiscount::ALLOW_USE == $cDiscountAllowUseCode) {
                $this->AddItem($oDiscount);
            } else {
                if (!is_null($sMessangerName)) {
                    // send message that the discount was removed
                    $aMessageData = $oDiscount->GetObjectPropertiesAsArray();
                    $aMessageData['iRemoveReasoneCode'] = $cDiscountAllowUseCode;
                    $oMessageManager->AddMessage($sMessangerName, 'DISCOUNT-ERROR-NO-LONGER-VALID-FOR-BASKET', $aMessageData);
                }
            }
        }
    }