[checkoutpdfinvoice] FPDF error in embedded gallery's FIX

jelzo

Joined: 2008-04-10
Posts: 67
Posted: Sun, 2009-06-28 21:10

Embedded gallery's get the following error while viewing the invoice from the checkoutpdfinvoice module.

Quote:
FPDF error: Cannot open modules/checkoutpdfinvoice/templates/pdf/invoice_master.pdf !

I have fixed this by editing "modules/checkoutpdfinvoice/PDFOut.inc".

I added the following line (replace gallery2 with your own variable path, mosty gallery2):

Quote:
$requesturi=$_SERVER["REQUEST_URI"];
if (strstr($requesturi,'gallery2')) {$relativepath='';}
else {$relativepath='gallery2/';};

And changed:

Quote:
// set the sourcefile
$pdf->setSourceFile('modules/checkoutpdfinvoice/templates/pdf/invoice_master.pdf');

To:

Quote:
// set the sourcefile
$pdf->setSourceFile($relativepath.'modules/checkoutpdfinvoice/templates/pdf/invoice_master.pdf');

Good luck!

-JelZo

p.s.: if anyone knows how to get the relative path variable(see example), please tell me.