samiorfali Posted July 12, 2010 Share Posted July 12, 2010 Hi Guys,I need your help as I'm no programmer and I know nothing about coding. Also I'm pretty new to prestashop and similar e-commerce shops.I need to customize the information in the invoice. I searched around but I couldn't have related topic.The problem is that the invoice is using the website logo, however I want to put the company name which is deferent from the website. Also I need to have the company ID in the invoice.I'd appreciate any help (simplified help) so I can apply myself.Thank you very muchSami Link to comment Share on other sites More sharing options...
samiorfali Posted July 12, 2010 Author Share Posted July 12, 2010 please guys .... help Link to comment Share on other sites More sharing options...
samiorfali Posted July 12, 2010 Author Share Posted July 12, 2010 Any one... please help me Link to comment Share on other sites More sharing options...
rocky Posted July 13, 2010 Share Posted July 13, 2010 You need to edit classes/PDF.php. You can change the logo on lines 139-140 (in PrestaShop v1.3.1): if (file_exists(_PS_IMG_DIR_.'/logo.jpg')) $this->Image(_PS_IMG_DIR_.'/logo.jpg', 10, 8, 0, 15); This code loads your website's logo if it exists. You can change link from logo.jpg to something like logo_pdf.jpg and upload that image to the img directory in the root of your PrestaShop.PrestaShop uses FPDF to write its PDFs. You can read more about it here. You'll need to add a new $this->Cell() function call to add your company ID. The first parameter is the cell width, the second the cell height and the third is the text to display. Link to comment Share on other sites More sharing options...
jdmorrisn Posted October 16, 2010 Share Posted October 16, 2010 Hi, I have tried to change the logo according to these instructions but all it does is give me an error message:FPDF error: Some data has already been output, can't send PDF fileNothing I do makes any difference - I just have to put the original file back. Why is the pdf file so difficult to edit? Link to comment Share on other sites More sharing options...
msk69 Posted October 16, 2010 Share Posted October 16, 2010 you only have to edit the image name, and place an additional image into the directory for the invoice.works fine with me. Link to comment Share on other sites More sharing options...
jdmorrisn Posted October 16, 2010 Share Posted October 16, 2010 Yes, I did that - exactly as described in this post. I added one jpg image to the same folder, exactly the same size as the original and just changed the name. I also changed the name in the pdf.php file as described. But it doesn't work - just gives this error. Link to comment Share on other sites More sharing options...
msk69 Posted October 16, 2010 Share Posted October 16, 2010 So you get:if (file_exists(_PS_IMG_DIR_.'/logoinvoice.jpg')) $this->Image(_PS_IMG_DIR_.'/logoinvoice.jpg', 10, 8, 0, 15); for example?Maybe the permision of the image? Link to comment Share on other sites More sharing options...
jdmorrisn Posted October 16, 2010 Share Posted October 16, 2010 Exactly the same as yours.I made a test just to check and I realise that even if I download the file to my desktop and then re-upload the same file by ftp, without any changes whatsoever, it gives me this error. So for some reason this file just does not like to be touched.I have tried to delete the file via ftp and reupload the new one; upload it as a text file and then change to php. But the only file that produces a pdf invoice is the original pdf.php file that I backed up. I'm baffled and frustrated. Link to comment Share on other sites More sharing options...
msk69 Posted October 16, 2010 Share Posted October 16, 2010 hmm, maybe a permission error. if you use filezilla you can see if the file has server rights or not.i have it on one shared package where the rights gets fxckxd up sometimes. Or you uploaded it as ascii or binary, do not remember right now which way it should be, as i'm on a guest pc with no filezilla installed. Link to comment Share on other sites More sharing options...
jdmorrisn Posted October 16, 2010 Share Posted October 16, 2010 Hi thanks for the help - I checked permissions previously and they are all on 755 as they should be. 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