Jump to content

Add customer email to invoices


natalie123123

Recommended Posts

Hello!

 

Go to 'generateHeaderAddresses' function in PDF.php

 

Where you have

$pdf->MultiCell($width, 6.0, $addressType[$type]['displayed'], 0, 'L', 0);

 

right above it put:

$c = new Customer($addressType[$type]['addressObject']->id_customer);
$addressType[$type]['displayed'] .= $c->email ."\n";

 

This will put the email address under delivery and invoice address as well.

 

If you want to it be displayed only under one of them, put the above code in a 'if' statement.

 

if ($type == "delivery")
{
//code here
}

 

OR

 

if ($type == "invoice")
{
//code here
}

Link to comment
Share on other sites

  • 2 months later...

Hi Cart Expert,

 

Do I need to add this below the line

 

$c = new Customer($addressType[$type]['addressObject']->id_customer);

$addressType[$type]['displayed'] .= $c->email ."\n";

 

Not necessary. Depends if you want to display the number above or beneath the email address.

 

Happy we could help you.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Its not necesary to modify the source code, just go to Back Office > Shipping > Countries, select the country and add in "Address layout" "phone_mobile"

 

For example, for the united states:

 

 

firstname lastname

company

address1 address2

city, State:name postcode

Country:name

phone

phone_mobile

Link to comment
Share on other sites

  • 2 months later...

Hello!

 

Go to Classes/PDF.php line 440.

Change these lines:

$ignore_fields = array(
  'phone' => 1,
   'mobile_phone' =>1
 );

 

to

 

$ignore_fields = array(
  /*'phone' => 1,
   'mobile_phone' =>1*/
 );

 

How about version 1.4.6.2? I can't find these lines in PDF.php, there's only this:

 

$patternRules = array(

'avoid' => array(

'address2',

'company',

'phone',

'phone_mobile'));

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

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...