Controller/PricingController.php
public function postAction(Request $request)
    {
        try {
            $data = $request->request->all();
            $this->validatePostData($data);
            $locale = $this->getLocale($request);

            // Calculate prices for given item
            $price = $this->getPriceCalculationManager()->retrieveItemPrices(
                $data['items'],
                $data['currency'],
                $locale
            );

            $view = $this->view($price, 200);
        } catch (PriceCalculationException $pce) {
            $view = $this->view($pce->getMessage(), 400);
        }

        return $this->handleView($view);
    }
public function postAction(Request $request)
    {
        try {
            $data = $request->request->all();
            $this->validatePostData($data);
            $locale = $this->getLocale($request);

            // Calculate prices for given item
            $price = $this->getPriceCalculationManager()->retrieveItemPrices(
                $data['items'],
                $data['currency'],
                $locale
            );

            $view = $this->view($price, 200);
        } catch (PriceCalculationException $pce) {
            $view = $this->view($pce->getMessage(), 400);
        }

        return $this->handleView($view);
    }
public function postAction ( Request $ request ) { try { $ data = $ request -> request -> all ( ) ; $ this -> validatePostData ( $ data ) ; $ locale = $ this -> getLocale ( $ request ) ; // Calculate prices for given item $ price = $ this -> getPriceCalculationManager ( ) -> retrieveItemPrices ( $ data [ 'items' ] , $ data [ 'currency' ] , $ locale ) ; $ view = $ this -> view ( $ price , 200 ) ; } catch ( PriceCalculationException $ pce ) { $ view = $ this -> view ( $ pce -> getMessage ( ) , 400 ) ; } return $ this -> handleView ( $ view ) ; }
Calculates total prices of all given items.

@param Request $request

@return Response
Calculates total prices of all given items .