Northys Posted April 13, 2014 Share Posted April 13, 2014 (edited) Hello, in the Czech Republic we have to send terms and conditions to customers in confirmation e-mail. I have found these lines in classes/PaymentModule.php:340 // Join PDF invoice if (intval(Configuration::get('PS_INVOICE')) AND Validate::isLoadedObject($orderStatus) AND $orderStatus->invoice AND $order->invoice_number) { $fileAttachment['content'] = PDF::invoice($order, 'S'); $fileAttachment['name'] = Configuration::get('PS_INVOICE_PREFIX', intval($order->id_lang)).sprintf('%06d', $order->invoice_number).'.pdf'; $fileAttachment['mime'] = 'application/pdf'; } and I have file terms_and_conditions.pdf. How can I attach it? Can you please help me? Edited April 13, 2014 by Northys (see edit history) Link to comment Share on other sites More sharing options...
spott Posted May 24, 2014 Share Posted May 24, 2014 I have same problem. Did You find solution? Link to comment Share on other sites More sharing options...
Northys Posted May 24, 2014 Author Share Posted May 24, 2014 I asked my friend who has kinda big shop (20 orders a day) and he's not sending it and nobody cares. So I haven't implemented this. Maybe it would be easier in new versions of presta, I'm not sure. Will check it and let you know. Link to comment Share on other sites More sharing options...
PeterWesson Posted December 12, 2014 Share Posted December 12, 2014 Although it is a pretty old topic, I'll still post a possible solution, because this threat appears high in google search, and it is quite frustrating to find something like this unanswered. The Send method of Mail class can accept as argument an "array of array" (see the Send method comment). So you can replace the code above with something like: $file_attachement[0]['content'] = $pdf->render(false); $file_attachement[0]['name'] = Configuration::get('PS_INVOICE_PREFIX', (int)$order->id_lang, null, $order->id_shop).sprintf('%06d', $order->invoice_number).'.pdf'; $file_attachement[0]['mime'] = 'application/pdf'; // Your terms of service pdf $file_attachement[1]['content'] = file_get_contents(_PS_ROOT_DIR_.'/folder/terms_and_conditions.pdf'); $file_attachement[1]['name'] = 'terms-and-conditions.pdf'; $file_attachement[1]['mime'] = 'application/pdf'; Where file_get_contents requires the path to your pdf. And just don't forget to do this as overload class, instead of modifying the original one Link to comment Share on other sites More sharing options...
tomaszbednarek83 Posted February 23, 2015 Share Posted February 23, 2015 aaaa Link to comment Share on other sites More sharing options...
web-partners Posted October 15, 2015 Share Posted October 15, 2015 (edited) Ahoj, tento modul by nestacil? https://www.bellini-services.com/shop/modifications/38-mail-alerts-pdf-invoice.html Tady jeste dasli moduly, asi podobna funkcnost, jine provedeni: http://addons.prestashop.com/en/checkout-modules/16914-terms-on-invoice-hamon-law.html http://addons.prestashop.com/en/checkout-modules/16964-terms-send.html Edited October 15, 2015 by web-partners (see edit history) 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