public function refreshCouponAmount(CartInterface $cart)
    {
        $couponAmount = Money::create(
            0,
            $this
                ->currencyWrapper
                ->get()
        );

        $coupons = $this
            ->cartCouponManager
            ->getCoupons($cart);

        foreach ($coupons as $coupon) {
            $currentCouponAmount = $this
                ->cartCouponApplicatorCollector
                ->getCouponAbsoluteValue(
                    $cart,
                    $coupon
                );
            $coupon->setAbsolutePrice($currentCouponAmount);
            $couponAmount = $couponAmount->add($currentCouponAmount);
        }

        $cart->setCouponAmount($couponAmount);
    }
public function refreshCouponAmount(CartInterface $cart)
    {
        $couponAmount = Money::create(
            0,
            $this
                ->currencyWrapper
                ->get()
        );

        $coupons = $this
            ->cartCouponManager
            ->getCoupons($cart);

        foreach ($coupons as $coupon) {
            $currentCouponAmount = $this
                ->cartCouponApplicatorCollector
                ->getCouponAbsoluteValue(
                    $cart,
                    $coupon
                );
            $coupon->setAbsolutePrice($currentCouponAmount);
            $couponAmount = $couponAmount->add($currentCouponAmount);
        }

        $cart->setCouponAmount($couponAmount);
    }
public function refreshCouponAmount ( CartInterface $ cart ) { $ couponAmount = Money :: create ( 0 , $ this -> currencyWrapper -> get ( ) ) ; $ coupons = $ this -> cartCouponManager -> getCoupons ( $ cart ) ; foreach ( $ coupons as $ coupon ) { $ currentCouponAmount = $ this -> cartCouponApplicatorCollector -> getCouponAbsoluteValue ( $ cart , $ coupon ) ; $ coupon -> setAbsolutePrice ( $ currentCouponAmount ) ; $ couponAmount = $ couponAmount -> add ( $ currentCouponAmount ) ; } $ cart -> setCouponAmount ( $ couponAmount ) ; }
Calculates coupons price given actual Cart.

@param CartInterface $cart Cart
Calculates coupons price given actual Cart .