Nickovitshj Posted April 27, 2021 Share Posted April 27, 2021 (edited) PrestaShop Version: 1.7.6.5 Hey all, my vat rate should be 21%. However it is displaying the following in the field: %VATr ate% % I've went throught the invoice.tpl files but I couldn't find this variable anywhere. Can anyone help me with this? Thanks in advance, Nick Edited April 27, 2021 by Nickovitshj (see edit history) Link to comment Share on other sites More sharing options...
Nickovitshj Posted April 27, 2021 Author Share Posted April 27, 2021 Solution: My solution isn't best practice but it actually works. Maybe someone with more knowledge can elaborate on this. In following file: classes/pdf/HTMLTemplateInvoice.php Go to line 180: // Set tax_code $taxes = OrderDetail::getTaxListStatic($id); $tax_temp = array(); foreach ($taxes as $tax) { $obj = new Tax($tax['id_tax']); $translator = Context::getContext()->getTranslator(); $tax_temp[] = $translator->trans( '%taxrate%%space%%', array( '%taxrate%' => ($obj->rate + 0), '%space%' => ' ', ), 'Shop.Pdf' ); } And replace this with: // Set tax_code $taxes = OrderDetail::getTaxListStatic($id); $tax_temp = array(); foreach ($taxes as $tax) { $obj = new Tax($tax['id_tax']); $translator = Context::getContext()->getTranslator(); $tax_temp[] = $translator->trans( '%taxrate%%nothing%%', array( '%taxrate%' => ($obj->rate + 0), '%nothing%' => '', ), 'Shop.Pdf' ); } The issue was that it translated the following variable: '%taxrate%%space%%' into '%Vatrate%%space%%' But the translated variable doesn't exist, thus in the invoice pdf it didn't show the value it's supposed to. With my "ugly" fix it now shows the actual vat rate % 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