I have a question. In Prestashop there is a system to generate a pdf (for example an invoice). I need to generate a pdf with the message insert into the cart page. How I can do this?
Thank you! Bye!! :-D
I have a question. In Prestashop there is a system to generate a pdf (for example an invoice). I need to generate a pdf with the message insert into the cart page. How I can do this?
Thank you! Bye!! :-D
You will need 3 elements: renderer, template and controller
Without more details, it's difficult to be precise, but in general you can look at order return, it's the simplest one of the pdf documents;
You need to create a class extending HtmlTemplate (look at classes/pdf/HTMLTemplateOrderReturn.php for example)
You need to create a smarty template as a model for PDF document (look at pdf/order-return.tpl)
After that, in your controller you have to call PDF::render like in controllers/front/PdforderReturnController.php
For frontoffice you should add in your cart controller the link to your controller, specyfing cart id (or other params) in url.
For backoffice you can create module and displya the link using displayAdminOrderContentOrder / displayAdminOrderTabOrder hooks or override AdminOrderController (which is not encouraged)