xiverisx Posted July 14, 2011 Share Posted July 14, 2011 Hi everyone, all day i searched everywhere but couldn't to solve my problem.I am using Prestashop 1.4.3 with bank wire payment.Problem: In Default prestashop PDF invoices are generated only then page admin, changes order status to: payment accepted. When customer or admin can download that PDF file with such link: http://example.com/pdf-invoice.php?id_order=7I need to configure Prestashop so: When the order is confirmed generate PDF invoice and attach it to email sent to customer automaticaly. So the question is what files and how i should edit and change, that customer could see his PDF invoice without page admin changing status to: Payment Accepted.At default prestashop visiting page:http://example.com/pdf-invoice.php?id_order=7Gives you error: Invoice not found Link to comment Share on other sites More sharing options...
Sxilderik Posted July 15, 2011 Share Posted July 15, 2011 HelloYou say "Solved" but do not say how you solved it.I'm facing a similar problem : I want my bank wire descriptions to show the invoice number, not the order number, and found out after a full afternoon of code exploring that the invoice number is not available because there is no invoice yet !I want the invoice to be generated for a bankwire. How do one achieves this ?Thanks Link to comment Share on other sites More sharing options...
xiverisx Posted July 15, 2011 Author Share Posted July 15, 2011 Yes, by default prestashop generates PDF only when page admin changes order status to: payment accepted when in the customer orders list appears link to generated PDF. (By the way i was using prestashop 1.4.3.)So steps which i made that shop customer will see PDF invoice in his order list page was:1) open history.tpl and find: {if (isset($order.invoice) && $order.invoice && isset($order.invoice_number) && $order.invoice_number) && isset($invoiceAllowed) && $invoiceAllowed == true} getPageLink('pdf-invoice.php', true)}?id_order={$order.id_order|intval}" title="{l s='Invoice'}"> getPageLink('pdf-invoice.php', true)}?id_order={$order.id_order|intval}" title="{l s='Invoice'}">{l s='PDF'} {else}-{/if} when change it to: getPageLink('pdf-invoice.php', true)}?id_order={$order.id_order|intval}" title="{l s='Invoice'}"> getPageLink('pdf-invoice.php', true)}?id_order={$order.id_order|intval}" title="{l s='Invoice'}">{l s='PDF'} 2) open class file OrderState.php static public function invoiceAvailable($id_order_state) { $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT `invoice` AS ok FROM `'._DB_PREFIX_.'order_state` WHERE `id_order_state` = '.(int)($id_order_state)); return $result['ok']; } and change to: static public function invoiceAvailable($id_order_state) { $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT `invoice` AS ok FROM `'._DB_PREFIX_.'order_state` WHERE `id_order_state` = '.(int)($id_order_state)); return true; } Link to comment Share on other sites More sharing options...
Sxilderik Posted July 15, 2011 Share Posted July 15, 2011 Thank you !Actually, I realized later on that the fact that the PDF was generated or not was irrelevant to my problem. The invoice exists already, even though its pdf is not created.My problem was that I wanted to display the invoice number in the bankwire mail.The only thing I had to do, to be able to use a {invoice_number} tag in the mail template, was to add this line $data['{invoice_number}'] = $order->invoice_number;juste after the $order = new Order((int)($this->id_order));lineto the addWithemail function in classes/OrderHistory.phpThis simple piece of code took me several hours to dig out Link to comment Share on other sites More sharing options...
etsilhooq Posted January 29, 2017 Share Posted January 29, 2017 Is it possible to do this on PS 1.6 ? Generate the PDF invoice when bank wire is chosed and NOT when paiment is accepted ? Thanks. Link to comment Share on other sites More sharing options...
eleazar Posted January 29, 2017 Share Posted January 29, 2017 Is it possible to do this on PS 1.6 ? Generate the PDF invoice when bank wire is chosed and NOT when paiment is accepted ? Thanks. Sure, in Prestashop 1.5 and 1.6 it's just a matter of how you configure the order statuses in BO. Go for instance to Orders --> Status --> Processing in progress Check both options - Allow a customer a customer to view pdf versions of his/her invoices. - Hide this status in all customer orders.(optional) From this moment on the button is active directly after you received an order and you can generate the invoice, whatever payment mehod your customer chose. As far as I know in Prestashop 1.4 btw you can also do it the same way, without any code changes. Link to comment Share on other sites More sharing options...
attila729 Posted January 29, 2017 Share Posted January 29, 2017 (edited) Hi, mate,[/size]1. I see an error in the invoice from payments with Bank Transfer.. in this invoice the bank fields are empty while it should be completed..[/size]2. In the invoice with cash on delivery paymants is presente the bank fields.. is possible to delete only in this invoice cash on delivery paymants?[/size]thank you very much[/size] [/size] Edited January 30, 2017 by attila729 (see edit history) Link to comment Share on other sites More sharing options...
Heavius Posted January 31, 2017 Share Posted January 31, 2017 1. I see an error in the invoice from payments with Bank Transfer.. in this invoice the bank fields are empty while it should be completed..[/size] Hi, I came across a similar issue. Apparently this has something to doe with old code for PrestaShop 1.4 in a PayPal module. You can get rid of the Bank account table at the bottom of your invoice by commenting out some code. Please check this post: https://www.prestashop.com/forums/topic/560290-upgrade-1617-problem-with-invoice-pdf-template/ I assume you can also change the code in a way that you can actually use the table. Link to comment Share on other sites More sharing options...
attila729 Posted February 1, 2017 Share Posted February 1, 2017 Hi, I came across a similar issue. Apparently this has something to doe with old code for PrestaShop 1.4 in a PayPal module. You can get rid of the Bank account table at the bottom of your invoice by commenting out some code. Please check this post: https://www.prestashop.com/forums/topic/560290-upgrade-1617-problem-with-invoice-pdf-template/ I assume you can also change the code in a way that you can actually use the table. Hi mate, i see that topic but i want this data bank field with data bank complete exemple: Banca: HSBC Titolare : Company IBAN: UK......xxxxxxxxxxxx etc.... what i to do it? thx Link to comment Share on other sites More sharing options...
manfield Posted March 14, 2017 Share Posted March 14, 2017 Hi mates, first of all the best solution to remove that box is to unHook the Module. Go to Modules and Services > Positions Search for displayPDFInvoice hook and remove the PayPal Module If you want, instead to change that box content, i suggest you to override your invoice template and put static info inside. Otherwise I think I will develop a simple module that grabs information from Bank Wire module and put them automatically in the invoice. It will be ready in a week. Cheers. Manfredi Link to comment Share on other sites More sharing options...
harlyman Posted March 26, 2017 Share Posted March 26, 2017 Hi mates, first of all the best solution to remove that box is to unHook the Module. Go to Modules and Services > Positions Search for displayPDFInvoice hook and remove the PayPal Module If you want, instead to change that box content, i suggest you to override your invoice template and put static info inside. Otherwise I think I will develop a simple module that grabs information from Bank Wire module and put them automatically in the invoice. It will be ready in a week. Cheers. Manfredi Im using the Invoice payment module for my B2B customers and need my bank details on invoices and this would solve my problem, have you made this module? and is it available? Link to comment Share on other sites More sharing options...
manfield Posted March 27, 2017 Share Posted March 27, 2017 Hi, the module is ready. I will post it here later today. Cheers! M Link to comment Share on other sites More sharing options...
manfield Posted March 27, 2017 Share Posted March 27, 2017 Here we go, you may download the module here: It prints bank information on the invoices, when BankWire module is installed and configured. Enjoy and ...share it! Manfredi 1 Link to comment Share on other sites More sharing options...
harlyman Posted March 27, 2017 Share Posted March 27, 2017 Here we go, you may download the module here: It prints bank information on the invoices, when BankWire module is installed and configured. Enjoy and ...share it! Manfredi Works great thank you, it solved mye problem:) 1 Link to comment Share on other sites More sharing options...
[email protected] Posted August 2, 2019 Share Posted August 2, 2019 does it work on 1.7 prestashop also ? Link to comment Share on other sites More sharing options...
rewuxiin Posted March 12, 2020 Share Posted March 12, 2020 On 8/2/2019 at 9:32 PM, [email protected] said: does it work on 1.7 prestashop also ? I myself was looking for a solution. I will post it here suddenly there are the same ones. 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