VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: lanthan on June 15, 2014, 21:08:56 PM

Title: Invoice and delivery .pdf different header and footer
Post by: lanthan on June 15, 2014, 21:08:56 PM
Hi,

VM2.6.6, J2.5.22, PHP5.3

I have to have header and footer image only for the invoice .pdf, because the invoice will be send by e-mail. My delivery note will be printed on an original letter paper as it will be send with the goods.

com_virtuemart->helpers->vmpdf.php line 235 and 195. There are the functions for header and footer. Right?
Does anyone know, which variable I can check whether it is invoice or delivery note? ($this->doctype == 'invoice') is not set here.

If anyone has a solution or idea I would be very glad if you would share this with me.

Thanks.
Title: Re: Invoice and delivery .pdf different header and footer
Post by: GJC Web Design on June 16, 2014, 09:43:22 AM
just get the vars

Invoice is layout=invoice. del is layout=deliverynote


$layout = JRequest::getVar('layout');
if($layout=='invoice'){
  //invoice footer
}else{
  //delivery footer
}


Title: Re: Invoice and delivery .pdf different header and footer
Post by: lanthan on June 16, 2014, 23:19:27 PM
Thanks. I will try this tomorrow and will reply if it works.
Title: Re: Invoice and delivery .pdf different header and footer
Post by: lanthan on June 17, 2014, 14:29:19 PM
It works perfect! Thanks again!