kinkibcn Posted January 21, 2015 Share Posted January 21, 2015 Hi, I'm using PS 1.6.0.11 and would like to change the name of the generated pdf file when printing invoices. In PS standard version, if I have the order #3567 with invoice #1578 and print the invoice, PS generates a pdf file with this name: 1578.pdf My idea is to get as file name (<invoice number> - <order number>.pdf, in above example would be: 1578-3567.pdf Does anyone know how to make these changes ?. Thanks and regards Link to comment Share on other sites More sharing options...
bellini13 Posted January 21, 2015 Share Posted January 21, 2015 You need to either create an override of the HTMLTemplateInvoice class, or just edit the HTMLTemplateInvoice class directly. The HTMLTemplateInvoice class has a function "getFilename". Either override this function to provide your filename logic, or just edit the core class to apply your logic public function getFilename() { return Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id, null, $this->order->id_shop).sprintf('%06d', $this->order_invoice->number).'.pdf'; } Link to comment Share on other sites More sharing options...
kinkibcn Posted January 25, 2015 Author Share Posted January 25, 2015 Hi, bellini13, many thanks for your help. I HAVE BEEN ABLE TO SOLVE IT !!! 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