Post by B.G » Thu Jan 04, 2018 10:32 pm

hello
i made pdf.php file in /controller/checkout/

Code: Select all

<?php
    class ControllerCheckoutPdf extends Controller {
	public function index() {
	
	    require_once(DIR_SYSTEM . '/library/mpdf/vendor/autoload.php'); // Include mdpf
     
                $html = '<div id="pdf-content">  Content to display </div>';
                $mpdf = new mPDF('utf-8', 'A4-P');
               
                $mpdf->SetHTMLHeader('<div class="pdf-header"><img class="left" src="image/catalog/logos/logo.png"/> </div>');                    
                $mpdf->SetHTMLFooter('<div class="pdf-footer" align="right"> </div> <div style="font-size:90%">Footer</div>'); 

                $mpdf->WriteHTML($html);
                $mpdf->Output(); 
	}  
}	

	?>
made button in cart.tpl

Code: Select all

<div><a href="<?php echo $pdf; ?>" class="btn btn-default"><?php echo $text_pdf; ?></a>
everything works but

i want to make pdf with Shopping Cart items like invoice to download from Shopping Cart without login

B.G
Newbie

Posts

Joined
Fri Dec 22, 2017 5:59 pm

Post by straightlight » Fri Jan 05, 2018 6:00 am

The $data['pdf'] and $data['text_pdf'] would also need to be defined in your controller in order to use $pdf and $text_pdf in your theme file. In v3.x releases, the $data['text_pdf'] does not entirely required to be defined but just in case.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by vishdech » Sun Feb 07, 2021 4:12 am

Hey guys,
any updates?
Need the same "cart to pdf" facility for my website.

Newbie

Posts

Joined
Fri May 15, 2020 1:24 am

Post by straightlight » Mon Feb 08, 2021 10:08 pm

Custom job or look on the Marketplace.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 51 guests