Prestashop Invoice

1 view
Skip to first unread message

Melissa Alvarado

unread,
Aug 5, 2024, 4:57:38 AM8/5/24
to lecthulicon
WheneverI update any product images, maybe because of better quality, new design etc., the old photos are still generated in invoice pdf and delivery slips pdf. I have regenerated all the images / thumbnails in BO but they won't update in the PDF's. Cleared cache both in BO and manually.

This one is really bugging me, I have updated the product image of most products (newer "better looking" images), but all the invoices I generate in the BO and such, displays the old product images. This is the same between Prestashop 1.6, 1.7 and 8.0 as far as I can tell.


The invoice and delivery slip PDF must be fetching the images from some folder? Why won't this folder update with new product images if provided for that product? For example, if I add a basic product image at first, then after two or three months I taka a professional image and replace the previous one, I would surely like the invoice PDF to also get this new photo.


When I do this it doesn't attach an invoice to the email confirmation indeed, but I am not able as admin to see the invoice in the BO, inside the order. Is not available any more even for me.

So, I don't want at the email that customers receives to be attached an invoice but I want as admin to see it in the orders sections or when I click the order.

How I can do that ?


I have took a look at the order statuses and I did different combinations. My logic I believe is very simple.

I don't want to be attached anything in customers email but I would like to see it (or generate it) from Back Office.

From Orders statuses I uncheck Attach invoice PDF to email and Allow a customer to download and view PDF versions of his/her invoices.

When I do this the icon of the invoice disappears from the orders list and it is deactivated also in the order detail page. (it says No invoice)


I don't know why I don't have this button as you do. The only solution I have found is I have created a new order status, I checked only the Allow a customer to download and view PDF versions of his/her invoices, and named it Create Invoice. After, I go to the order detail page, I choose this status, update and I have the invoice.


The issue appears to have been related to setting up a store, under Preferences -> Store Contacts -> Store Contacts, as seen in other posts on this forum. The problem on my side was that I was resending the invoice from a previous order, instead of generating a new order. My assumption was that when resending the email, it would regenerate the PDF.


Hi dhevans79, I have same problem in one of my PS 1.6.1.11.

Contact info is filled but on invoice is only shop name and country showed

files lookig as not changed. Same as files in other PS, where shop adres displaying correct.


And I finded, eshop adress of exist invoices is saved in DTB tables

order_invoice

and future invoices set by

frl_store

Note: frl_store is table for BO /index.php?controller=AdminStores - Detail


You could try this module. It's the only one I could find. But beware the developer speaks almost zero English (she's from Spain).

I'll get it for testing but it seems to do the trick!

-modules-to-improve-usability/299-it-allows-to-share-files-between-administrator-and-client-module.html


I'm testing my new module.

I am adding the option to select the status of the order, when the own PDF invoice will be sent by email to the customer as an attachment.

The PDF invoice will also be visible in the customer's detail.


Yes I understand that in order to develop something you need the exact interface our software is suppose to call to upload the pdf, but here I am more looking to understand the feasibility of doing that than asking you to develop something. I would like to do it to acquire competence on prestashop.


More or less like is done to add an image to a product: -use/image-management/ ?

Basically I need to do what this module does : =7, but via the webservice and not via the backoffice. This module does it only through the BackOffice.



I don't know how to add a new endpoint to the prestashop webservice that does so and I did not find any documentation. I only saw that you can create a new entity , register the hook 'addWebserviceResources' and then you have the CRUD for your entity, but here I am not looking at all to add a CRUD but just an endpoint that read a file in input , store it somewhere and link it to the order.


actually we bought a module that does so , but only via the BackOffice. When I access to the BackOffice order page I can upload a pdf that is automatically linked to the order and customer can download it without problems.


I tried to make a test with Postman calling the same url but , as expected, it did not work. So I was wondering if there is a way to create a custom endpoint accepting a form data from where I can then call th eAdminHsCustomInvoice controller.



Do yo think would it be possible?


I had a quick best practice question. I am modifying invoice tpl files in the "pdf" folder. What is the best way of doing this? just change the tpl files in that folder or can I do an override somewhere safer? I have been looking online but cannot see a definite answer. I see how to override existing modules, even core controller files, but not sure about the pdf. Can I just copy the pdf folder to my own module's override folder? (which I prefer) or prestashop's override folder? Adding it to the theme's folder makes me think I could potentially lose my changes if the theme has an update.


Is this possible to update once generated invoices with new tax rules? We were not pax payer few months ago and sent invoices without VAT to our customers. Now we are VAT company and need to re-generate invoices once again with added VAT. When I try to generate invoice for these old orders I still get invoice without tax, despite it is now enabled.


Can I change order status that the invoice is not present? Looks like the pdf invoice is somewhere cached and after I try to download old invoices I get them in exactly same state that they were when they were generated, despite new rules have been implemented to our store.


Is is possible to mark somewhere in PS that there were no invoice generated for an order so I can generate it completely fresh? Invoices for orders placed after the tax rules were enabled are completely OK.


This seems to be an old bug. Tried almost everything and cannot get logo to show up on invoices. Found the header.tpl and manually adding some text does work but no luck with logo img. Anybody have any idea where the URL or URI is generated for $logo_path in header.tpl. I think it is an issue with directories but not sure.


Found that but if you look at the code above that getLogo() you will notice code for $logo. If my understanding is correct if $invoiceLog or $logo is empty it will return nothing. Considering that my logo is showing, assuming $logo is the variable used for that then there is an issue in the code for $ invoiceLogo


Just tried something and replaced PS_LOGO_INVOICE with PS_LOGO and that did not work, so one can assume there is no problem there. Back to assignCommonHeaderData() again. A bit stuck not sure how to progress, any ideas


yes I do, i specifically did that first. In the interim I have discovered that $logo_path is not empty. I just printed the variable in the pdf and the url was printed. So it looks like there is a problem with the way the pdf is generated. I have tried adding alt in html code to see if it will print the url if the image is not there and that does not work either.


hi Ress in order to try and find where the problem is I added code to see if it makes any difference, which it does obviously, then delete the added code to return it to default again. So what I have discovered is that the variable $logo_path is not empty and changing the src tag to just a td tag and printing the content of $logo_path in the pdf actually does work. So I know the image was fetched but for some reason it does not display on the pdf.


Strange that I have lodged a similar issue but with $order_link in the payment module where the variable is empty in the email sent and that was definitely confirmed as a bug with no solution thus far which means I cannot send my customers a payment link which makes the entire platform pretty useless; that is if you cannot get your customers to pay you.


This issue of no logo however makes the issued invoice illegal according to Australian law and thus again makes the platform useless. If I cannot find a solution soon I will have to migrate to a working platform.


During the generation of the PDF the server try to fetch the image from it's own address, like www.shop.com. If the server is behind a firewall that firewall needs to support that the server on the inside makes a call to the address on the outside. It's sometime called hairpinning, some time NAT reflection and surely a bunch of more names. This isn't working in all setups.


Dear fellow forum members I have following problem.

I disabled invoices in BO (menu Orders/Invoices) yet still invoice address is appearing on the checkout screen as "use the same address for invoice" option.


5. Paste the following where you want the customer comment message to appear. NOTE! This has to be after the listing of products. (Because it utilizes a remaining variable from the product foreach loop.)

3a8082e126
Reply all
Reply to author
Forward
0 new messages