Jump to content
Jluis

Prestashop generate pdf

Recommended Posts

salut ,

je suis en train de générer un fichier pdf à partir d'une custom template , au niveau de la fonction display de mon controlleur front , il affiche l'erreur ci-dessous :
 

ceci est la fonction display :

 public function display()
    {
        //echo"test";

       $cart =new Cart(Context::getContext()->cart->id);
       $cart1 = (object)$cart;
        $pdfk = new PDF(cart , PDF::TEMPLATE_CART_PRINT, $this->context->smarty,'P');
        //var_dump( $pdf);
        $pdfk->render();
    }

 

error.PNG

Share this post


Link to post
Share on other sites

et en faisant :

public function display()
{
  $cart =new Cart(Context::getContext()->cart->id);
  $pdfk = new PDF($cart , PDF::TEMPLATE_CART_PRINT, Context::getContext()->smarty);
  $pdfk->render();
}

 

Share this post


Link to post
Share on other sites
Posted (edited)

de même , j'ai basculé à utiliser TCPDF  ,  j'ai besoin de récupérer les produits du panier 
 

$cart =new Cart(Context::getContext()->cart->id);

    
 $products = $cart->getProducts();

mais rien n'est affiché

Edited by Jluis (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More