Nitneuq5 Posted December 15, 2021 Share Posted December 15, 2021 Hello, I would like to display the invoice number (formatted) in the credit slip but I can't. I am able to display the invoice ID via {$order->invoice_number} but not the full invoice number. How can I do this? Thanks ! Link to comment Share on other sites More sharing options...
Nitneuq5 Posted December 23, 2021 Author Share Posted December 23, 2021 Any ideas? 😪 Link to comment Share on other sites More sharing options...
Amin Vatandoust Posted December 26, 2021 Share Posted December 26, 2021 what's your PrestaShop version? Link to comment Share on other sites More sharing options...
Nitneuq5 Posted December 27, 2021 Author Share Posted December 27, 2021 13 hours ago, Amin Vatandoust said: what's your PrestaShop version? @Amin Vatandoust : 1.7.7.7 ! Thanks Link to comment Share on other sites More sharing options...
abdamu Posted January 2, 2023 Share Posted January 2, 2023 (edited) I join the question, I need to add the invoice number to the "credit slip" to associate both @Amin Vatandoust Edited January 2, 2023 by abdamu (see edit history) Link to comment Share on other sites More sharing options...
astenoth Posted January 4, 2024 Share Posted January 4, 2024 If this can help my solution, I sure it's no perfect but work for me. Prestashop 8.1. In the file \classes\pdf\HTMLTemplateOrderSlip.php about the line 168 into the function "public function getContent()" add the below $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'; /* %1$s -->prefix 'LV' * %3$s -->year * %2$06d --> invoice */ } $prefix = Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id); $order_invoice = sprintf(HTMLTemplateOrderSlip::l($format), $prefix, (int) $this->order->invoice_number, date('y', strtotime($this->order->date_add))); After you need add the $order_invoice variable to smarty (same file about line 181) $this->smarty->assign([ 'order' => $this->order, 'order_slip' => $this->order_slip, 'order_details' => $order_details, 'cart_rules' => $this->order_slip->order_slip_type == 1 ? $this->order->getCartRules() : false, 'amount_choosen' => $this->order_slip->order_slip_type == 2 ? true : false, 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'addresses' => ['invoice' => $invoice_address, 'delivery' => $delivery_address], 'tax_excluded_display' => $tax_excluded_display, 'total_cart_rule' => $total_cart_rule, 'order_invoice' => $order_invoice, ]); With this you can call to the variable "$order_invoice" in the order-slip tpl's where you need. My example added to order-slip.summary-tab.tpl: <td class="center small white">{$order_invoice|escape:'html':'UTF-8'}</td> Regards Raul 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