natalie123123 Posted September 23, 2011 Share Posted September 23, 2011 Hi, I'm using Prestashop Version: 1.4.4.0 and I'd like to include customer email addresses in invoices along with their names, addresses etc. I've tried to locate the right spot to edit in pdf.php, but I'm struggling. I'd really appreciate some help with this. Thanks Link to comment Share on other sites More sharing options...
CartExpert.net Posted September 23, 2011 Share Posted September 23, 2011 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 More sharing options...
sudhakarm1 Posted December 8, 2011 Share Posted December 8, 2011 How do you display Mobile no. and phone no.? Link to comment Share on other sites More sharing options...
sudhakarm1 Posted December 8, 2011 Share Posted December 8, 2011 thanks, the email is getting displayed..How do we display phone no. and mobile no. Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 8, 2011 Share Posted December 8, 2011 Hello! The code for mobile is: $addressType[$type]['displayed'] .= $addressType[$type]['addressObject']->phone_mobile ."\n"; The code for phone is: $addressType[$type]['displayed'] .= $addressType[$type]['addressObject']->phone ."\n"; Link to comment Share on other sites More sharing options...
sudhakarm1 Posted December 8, 2011 Share Posted December 8, 2011 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"; Link to comment Share on other sites More sharing options...
sudhakarm1 Posted December 8, 2011 Share Posted December 8, 2011 Thanks Robin, For all the help. Link to comment Share on other sites More sharing options...
CartExpert.net Posted December 8, 2011 Share Posted December 8, 2011 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 More sharing options...
ClickStars Posted December 30, 2011 Share Posted December 30, 2011 Hi Cart Expert, how about Prestashop Version: 1.4.4.1 How do I display phone no. and mobile no. thanks Link to comment Share on other sites More sharing options...
CartExpert.net Posted January 3, 2012 Share Posted January 3, 2012 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*/ ); Link to comment Share on other sites More sharing options...
bprado Posted February 3, 2012 Share Posted February 3, 2012 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 More sharing options...
Kruk Posted April 12, 2012 Share Posted April 12, 2012 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 More sharing options...
Yuvarajan Posted May 9, 2012 Share Posted May 9, 2012 How about version 1.2.5.0? I've to add email in invoice pdf. 'generateHeaderAddresses' function is not there... Link to comment Share on other sites More sharing options...
AnilaN Posted May 22, 2012 Share Posted May 22, 2012 Thanks a lot!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now