Jump to content

[Solved] Fatal Error - Can't generate invoice PDF from BO - fix for $?


banchijojo

Recommended Posts

I used to be able to generate invoices, delivery slips, etc. but recently I get a blank screen.

 

I turned on errors:

Fatal error: Undefined class constant 'TEMPLATE_INVOICE' in /home/content/l/a/k/lakemi222/html/auntdebbie/prestashop/controllers/admin/AdminPdfController.php on line 170

 

Line 170:

$this->generatePDF($order_invoice_list, PDF::TEMPLATE_INVOICE);

 

I've seen some posts about a png logo file will cause the invocie to crash. I did force my header to take a PNG for the FO logo by editing the header.tpl file - but in the BO, I uploaded a jpg for the invioices and images are set to "use JPG"    I changed the header.tpl back to original state and that did not fix the issue.

 

Was wondering is someone knew what this error meant, or even better, how to fix.

 

When I test Stripe payments, the payment gets accepted but I receive a blank screen with the follwing error: Fatal error: Undefined class constant 'TEMPLATE_INVOICE' in /home/content/l/a/k/lakemi222/html/auntdebbie/prestashop/classes/order/OrderHistory.php on line 419

 

This is all the same issue I am sure. Need cost estimate up front please.

 

Solved: I had the PDF.php uploaded in two different spots, once I deleleted the wrong location file, the pdfs worked again.

Edited by banchijojo (see edit history)
Link to comment
Share on other sites

Oh it's totally somehting I did I am sure. It was working yesterday. I've modified a few files (tpls) and disabled/enabled a few mods, fixed image sizes, cleard chache/force comple... But I've done nothing to the file or older that the error is referencing so that is why I am willing to pay someone. I do suppose I can just overwite by copy files that I made last week, but I am worried that might make a mountain out of a mole hill.

 

it's people like me that keep web developers employed LOL

Link to comment
Share on other sites

  • 3 years later...

 

Solved: I had the PDF.php uploaded in two different spots, once I deleleted the wrong location file, the pdfs worked again.

 

 

Where where the places u found u had that file double? or where should it only be?

 

i get this error atm:

 

( ! ) Fatal error: Uncaught Error: Undefined class constant 'TEMPLATE_INVOICE' in /home/credmb1q/public_html/controllers/admin/AdminPdfController.php on line 204 ( ! ) Error: Undefined class constant 'TEMPLATE_INVOICE' in /home/credmb1q/public_html/controllers/admin/AdminPdfController.php on line 204 Call Stack # Time Memory Function Location 1 0.0003 380128 {main}( ) .../index.php:0 2 0.0902 8341320 DispatcherCore->dispatch( ) .../index.php:58 3 0.1182 10884096 ControllerCore->run( ) .../Dispatcher.php:367 4 0.1813 15219544 AdminPdfControllerCore->postProcess( ) .../Controller.php:178 5 0.1813 15219544 AdminControllerCore->postProcess( ) .../AdminPdfController.php:31 6 0.1815 15220696 AdminPdfControllerCore->processGenerateInvoicePdf( ) .../AdminController.php:917 7 0.1815 15220728 AdminPdfControllerCore->generateInvoicePDFByIdOrderInvoice( ) .../AdminPdfController.php:61
Link to comment
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
×
×
  • Create New...