Sonata\BasketBundle\Controller\BasketController::finalReviewStepAction PHP Method

finalReviewStepAction() public method

Order process step 6: order's review & conditions acceptance checkbox.
public finalReviewStepAction ( ) : RedirectResponse | Response
return Symfony\Component\HttpFoundation\RedirectResponse | Symfony\Component\HttpFoundation\Response
    public function finalReviewStepAction()
    {
        $basket = $this->get('sonata.basket');
        $violations = $this->get('validator')->validate($basket, array('elements', 'delivery', 'payment'));
        if ($violations->count() > 0) {
            // basket not valid
            // todo : add flash message rendering in template
            foreach ($violations as $violation) {
                $this->get('session')->getFlashBag()->add('error', 'Error: ' . $violation->getMessage());
            }
            return new RedirectResponse($this->generateUrl('sonata_basket_index'));
        }
        if ($this->get('request')->getMethod() == 'POST') {
            if ($this->get('request')->get('tac')) {
                // send the basket to the payment callback
                return $this->forward('SonataPaymentBundle:Payment:sendbank');
            }
        }
        $this->get('sonata.seo.page')->setTitle($this->get('translator')->trans('basket_review_title', array(), 'SonataBasketBundle'));
        return $this->render('SonataBasketBundle:Basket:final_review_step.html.twig', array('basket' => $basket, 'tac_error' => $this->get('request')->getMethod() == 'POST'));
    }