public function handleSalesQuoteCollectTotalsAfter(Varien_Event_Observer $observer)
    {
        $event = $observer->getEvent();
        /** @var Mage_Sales_Model_Quote $quote */
        $quote = $event->getQuote();
        /** @var Mage_Sales_Model_Resource_Quote_Address_Collection */
        $addresses = $quote->getAddressesCollection();
        foreach ($addresses as $address) {
            $appliedRuleIds = $address->getAppliedRuleIds();
            if (is_array($appliedRuleIds)) {
                $appliedRuleIds = implode(',', $appliedRuleIds);
            }
            $data = (array) $address->getEbayEnterpriseOrderDiscountData();
            $data[$appliedRuleIds] = [
                'id' => $appliedRuleIds,
                'amount' => $address->getBaseShippingDiscountAmount(),
                'description' => $this->helper->__('Shipping Discount'),
            ];
            $address->setEbayEnterpriseOrderDiscountData($data);
        }
    }
public function handleSalesQuoteCollectTotalsAfter(Varien_Event_Observer $observer)
    {
        $event = $observer->getEvent();
        /** @var Mage_Sales_Model_Quote $quote */
        $quote = $event->getQuote();
        /** @var Mage_Sales_Model_Resource_Quote_Address_Collection */
        $addresses = $quote->getAddressesCollection();
        foreach ($addresses as $address) {
            $appliedRuleIds = $address->getAppliedRuleIds();
            if (is_array($appliedRuleIds)) {
                $appliedRuleIds = implode(',', $appliedRuleIds);
            }
            $data = (array) $address->getEbayEnterpriseOrderDiscountData();
            $data[$appliedRuleIds] = [
                'id' => $appliedRuleIds,
                'amount' => $address->getBaseShippingDiscountAmount(),
                'description' => $this->helper->__('Shipping Discount'),
            ];
            $address->setEbayEnterpriseOrderDiscountData($data);
        }
    }
public function handleSalesQuoteCollectTotalsAfter ( Varien_Event_Observer $ observer ) { $ event = $ observer -> getEvent ( ) ; /** @var Mage_Sales_Model_Quote $quote */ $ quote = $ event -> getQuote ( ) ; /** @var Mage_Sales_Model_Resource_Quote_Address_Collection */ $ addresses = $ quote -> getAddressesCollection ( ) ; foreach ( $ addresses as $ address ) { $ appliedRuleIds = $ address -> getAppliedRuleIds ( ) ; if ( is_array ( $ appliedRuleIds ) ) { $ appliedRuleIds = implode ( ',' , $ appliedRuleIds ) ; } $ data = ( array ) $ address -> getEbayEnterpriseOrderDiscountData ( ) ; $ data [ $ appliedRuleIds ] = [ 'id' => $ appliedRuleIds , 'amount' => $ address -> getBaseShippingDiscountAmount ( ) , 'description' => $ this -> helper -> __ ( 'Shipping Discount' ) , ] ; $ address -> setEbayEnterpriseOrderDiscountData ( $ data ) ; } }
Account for shipping discounts not attached to an item.
Combine all shipping discounts into one.

@see self::handleSalesConvertQuoteAddressToOrderAddress
@see Mage_SalesRule_Model_Validator::processShippingAmount
@param Varien_Event_Observer
@return void
Account for shipping discounts not attached to an item . Combine all shipping discounts into one .