public function getFormAddBasket(ProductInterface $product)
    {
        $formBuilder = $this->formFactory->createNamedBuilder('add_basket', 'form', null, [
            'data_class' => $this->basketElementClass,
            'csrf_protection' => false,
        ]);

        $this->productPool->getProvider($product)->defineAddBasketForm($product, $formBuilder, false);

        $form = $formBuilder->getForm()->createView();

        return $form;
    }
public function getFormAddBasket(ProductInterface $product)
    {
        $formBuilder = $this->formFactory->createNamedBuilder('add_basket', 'form', null, [
            'data_class' => $this->basketElementClass,
            'csrf_protection' => false,
        ]);

        $this->productPool->getProvider($product)->defineAddBasketForm($product, $formBuilder, false);

        $form = $formBuilder->getForm()->createView();

        return $form;
    }
public function getFormAddBasket ( ProductInterface $ product ) { $ formBuilder = $ this -> formFactory -> createNamedBuilder ( 'add_basket' , 'form' , null , [ 'data_class' => $ this -> basketElementClass , 'csrf_protection' => false , ] ) ; $ this -> productPool -> getProvider ( $ product ) -> defineAddBasketForm ( $ product , $ formBuilder , false ) ; $ form = $ formBuilder -> getForm ( ) -> createView ( ) ; return $ form ; }
Returns a "add to basket" form for a specified product.

@param ProductInterface $product A product instance

@return FormView
Returns a add to basket form for a specified product .