Jump to content

Change the way pdf are generated in order history page


Recommended Posts

Hello everyone I am currently trying to find what are the classes to override to change how the pdf are generated and distributed to the customer , I want to keep the same links but I want to give an other pdf that the one generated by prestashop , how could it be done ?

Thank you everyone  .

Link to comment
Share on other sites

I have generated a pdf through an other service externally 

I want to use it instead of the one used by prestashop  in the Order history page ,

But I cannot find where the method in charge of the variable order.details.invoice_url  (used in history.tpl)

is located , I already tried multiple classes (Order,OrderHistory,OrderDetail,OrderInvoice) but none of the methods I commented seems to have an effect on the history page .

Link to comment
Share on other sites

Assuming you want to change the link here

grafik.thumb.png.1aa94bbbfa5f68302ec64a6cfee407f4.png

In PS8 you need to extend the corresponding twig file src\PrestaShopBundle\Resources\views\Admin\Sell\Order\Order\Blocks\View\documents.html.twig.
But please note there are more links to the invoice e.g. in order overview and on top of the order detail page

Link to comment
Share on other sites

Yes, simplest way it to change the link here and reference to the file on external service (or to a copy on the PS server). Screen looks like an old PS version, so it will be in some tpl file - if you don't see changes in tpl clear the PS cache.

Link to comment
Share on other sites

Please ignore my screenshot, thats PS8 backoffice. I understand you want to change it in frontoffice (customer order history) - in classic theme it would be file themes\classic\templates\customer\history.tpl

Link to comment
Share on other sites

You should get a fatal error if you comment this method, maybe you have an override active (which you should use anyway instead of changing core controller directly)?

grafik.png.8cb6ee21a77953f26e9e606ab69d1915.png

Link to comment
Share on other sites

My plan was to use an override

but I wanted to be sure that it was the correct method used to do this , 

How did you manage to get this error ? 

the only thing I managed to do is to comment the whole class and get a 500 error , 

but nothing more , I have one override and this is an Product override that is empty 

Link to comment
Share on other sites

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