nasreddine hafidi Posted September 29, 2021 Share Posted September 29, 2021 Hello, I nedd to edit the invoice.tpl to add comments in to invoice pdf but when i modify all those fils nothing is changed, there is any help please ? Link to comment Share on other sites More sharing options...
ps8modules Posted September 29, 2021 Share Posted September 29, 2021 What comments do you have in mind? What is the version of Prestashop? Little information = no answer. Link to comment Share on other sites More sharing options...
nasreddine hafidi Posted September 29, 2021 Author Share Posted September 29, 2021 6 minutes ago, WebSoft said: What comments do you have in mind? What is the version of Prestashop? Little information = no answer. when a costumer buy a product, and make and order, he can add a comment/message, so i want that this message appear in the invoice Link to comment Share on other sites More sharing options...
ps8modules Posted September 29, 2021 Share Posted September 29, 2021 And will you write me where you want the comment placed in the template? You show it in the list of products. Link to comment Share on other sites More sharing options...
ps8modules Posted September 29, 2021 Share Posted September 29, 2021 ./classes/pdf/HTMLTemplateInvoice.php find $data = array( 'order' => $this->order, 'order_invoice' => $this->order_invoice, 'order_details' => $order_details, 'carrier' => $carrier, 'cart_rules' => $cart_rules, 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'addresses' => array('invoice' => $invoice_address, 'delivery' => $delivery_address), 'tax_excluded_display' => $tax_excluded_display, 'display_product_images' => $display_product_images, 'layout' => $layout, 'tax_tab' => $this->getTaxTabContent(), 'customer' => $customer, 'footer' => $footer, 'ps_price_compute_precision' => _PS_PRICE_COMPUTE_PRECISION_, 'round_type' => $round_type, 'legal_free_text' => $legal_free_text, ); replace to (added => 'customer_message' => nl2br($this->order->getFirstMessage()),) $data = array( 'order' => $this->order, 'order_invoice' => $this->order_invoice, 'order_details' => $order_details, 'carrier' => $carrier, 'cart_rules' => $cart_rules, 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, 'addresses' => array('invoice' => $invoice_address, 'delivery' => $delivery_address), 'tax_excluded_display' => $tax_excluded_display, 'display_product_images' => $display_product_images, 'layout' => $layout, 'tax_tab' => $this->getTaxTabContent(), 'customer' => $customer, 'footer' => $footer, 'ps_price_compute_precision' => _PS_PRICE_COMPUTE_PRECISION_, 'round_type' => $round_type, 'legal_free_text' => $legal_free_text, 'customer_message' => nl2br($this->order->getFirstMessage()), ); open your TPL file ./pdf/your tpl add: {if isset($customer_message) && $customer_message} <tr> <td colspan="12" height="10"> </td> </tr> <tr> <td colspan="6" class="left"> <table id="note-tab" style="width: 100%"> <tr> <td class="grey">{l s='Comment' d='Shop.Pdf' pdf='true'}</td> </tr> <tr> <td class="note">{$customer_message|nl2br}</td> </tr> </table> </td> <td colspan="1"> </td> </tr> {/if} Done 1 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