SmartyLo Posted October 19, 2016 Share Posted October 19, 2016 Hello, In my shop order reference consists of only numbers, and I need that order invoice number would be totaly same as order reference number. I found where invoice number generating, but it's complicated to replace it with other value. Here what I have in OrderInvoice.php file: public function getInvoiceNumberFormatted($id_lang, $id_shop = null) { $invoice_formatted_number = Hook::exec('actionInvoiceNumberFormatted', array( get_class($this) => $this, 'id_lang' => (int)$id_lang, 'id_shop' => (int)$id_shop, 'number' => (int)$this->number )); if (!empty($invoice_formatted_number)) { return $invoice_formatted_number; } $format = '%1$s%2$06d'; if (Configuration::get('PS_INVOICE_USE_YEAR')) { $format = Configuration::get('PS_INVOICE_YEAR_POS') ? '%1$s%3$s/%2$06d' : '%1$s%2$06d/%3$s'; } return sprintf($format, Configuration::get('PS_INVOICE_PREFIX', (int)$id_lang, null, (int)$id_shop), $this->number, date('Y', strtotime($this->date_add))); } Thanks. Link to comment Share on other sites More sharing options...
SmartyLo Posted October 19, 2016 Author Share Posted October 19, 2016 (edited) I tried to paste this code into return value like this: return sprintf($format, Configuration::get(.$order->id.'#'.$order->reference;); It doesnt work, but it caused other problem - I submitted new order, it returned 500 error page, but was done and I can see it on backoffice. And now I cant apply order state filters anymore (the state of this order was 0, in phpmyadmin I replaced it to 3 - normal value, but there is still no any filters. What I have to do? I am in panic, because it wasnt "testing: shop. I replaced back OrderInvoice.php, but filters are still unavailable. Please, help. Edited October 19, 2016 by SmartyLo (see edit history) Link to comment Share on other sites More sharing options...
SmartyLo Posted October 19, 2016 Author Share Posted October 19, 2016 No, you need to use one of them. return sprintf($format, $order->id); //or Or return sprintf($format,$order->reference); It's not configuration value and you have errors in your statement. Thank you for promt reply! Well, such code doesnt work - name of invoice file is still incrementing value(+1 to previous values, but reference number is much bigger now), and in invoice file it doenst display invoice number now, there is white space. Is the "$order->reference" global variable? 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