public function loadCartPurchasablesAmount(CartInterface $cart)
    {
        $currency = $this
            ->currencyWrapper
            ->get();

        $purchasableAmount = Money::create(0, $currency);

        /**
         * Calculate Amount and PurchasableAmount.
         */
        foreach ($cart->getCartLines() as $cartLine) {

            /**
             * @var CartLineInterface $cartLine
             */
            $cartLine = $this->loadCartLinePrices($cartLine);

            /**
             * @var MoneyInterface $purchasableAmount
             * @var MoneyInterface $totalAmount
             */
            $convertedPurchasableAmount = $this
                ->currencyConverter
                ->convertMoney(
                    $cartLine->getPurchasableAmount(),
                    $currency
                );

            $purchasableAmount = $purchasableAmount
                ->add($convertedPurchasableAmount->multiply(
                    $cartLine->getQuantity()
                ));
        }

        $cart->setPurchasableAmount($purchasableAmount);
    }
public function loadCartPurchasablesAmount(CartInterface $cart)
    {
        $currency = $this
            ->currencyWrapper
            ->get();

        $purchasableAmount = Money::create(0, $currency);

        /**
         * Calculate Amount and PurchasableAmount.
         */
        foreach ($cart->getCartLines() as $cartLine) {

            /**
             * @var CartLineInterface $cartLine
             */
            $cartLine = $this->loadCartLinePrices($cartLine);

            /**
             * @var MoneyInterface $purchasableAmount
             * @var MoneyInterface $totalAmount
             */
            $convertedPurchasableAmount = $this
                ->currencyConverter
                ->convertMoney(
                    $cartLine->getPurchasableAmount(),
                    $currency
                );

            $purchasableAmount = $purchasableAmount
                ->add($convertedPurchasableAmount->multiply(
                    $cartLine->getQuantity()
                ));
        }

        $cart->setPurchasableAmount($purchasableAmount);
    }
public function loadCartPurchasablesAmount ( CartInterface $ cart ) { $ currency = $ this -> currencyWrapper -> get ( ) ; $ purchasableAmount = Money :: create ( 0 , $ currency ) ; /**
         * Calculate Amount and PurchasableAmount.
         */ foreach ( $ cart -> getCartLines ( ) as $ cartLine ) { /**
             * @var CartLineInterface $cartLine
             */ $ cartLine = $ this -> loadCartLinePrices ( $ cartLine ) ; /**
             * @var MoneyInterface $purchasableAmount
             * @var MoneyInterface $totalAmount
             */ $ convertedPurchasableAmount = $ this -> currencyConverter -> convertMoney ( $ cartLine -> getPurchasableAmount ( ) , $ currency ) ; $ purchasableAmount = $ purchasableAmount -> add ( $ convertedPurchasableAmount -> multiply ( $ cartLine -> getQuantity ( ) ) ) ; } $ cart -> setPurchasableAmount ( $ purchasableAmount ) ; }
Load cart purchasables prices.

@param CartInterface $cart Cart
Load cart purchasables prices .