'Prestashop show tax rule name
I want to show the tax rule name (example: 21% Incl.) on the prestashop checkout page. Is there a way to do this?
I only found the following prefix:
{$display_tax_label|escape:'html':'UTF-8'}
But this is only showing active or not.
Also found another thing which is listed in the invoice templates but I cannot use it somewhere else.
Solution 1:[1]
Your question doesn't have a one answer. I'll try to explain.
Every product could have a tax rule different from each other. In the checkout PrestaShop shows the tax as a 'sum' of all taxes applied.
So for example:
Product 1 - 10$ VAT EXCL - Tax Rule A (10%) - 11$ VAT INCL Product 2 - 10$ VAT EXCL - Tax Rule B (20%) - 12$ VAT INCL
TOTAL TAXES 3$ (1$ is for 10% of product 1, 2$ is 20% of product 2)
If you want to display tax label you have to retrieve first all taxes applied to cart, then you can split and display every single tax applied.
Unfortunately it's more difficult than they appear :)
Solution 2:[2]
You can fetch the name of any tax rule if you have the $id_tax_rules_group for that tax rule using the following code:
$tg_obj = new TaxRulesGroup($id); $tax_rule_name = $tg_obj->name;
You can use this name to show on the checkout page to fulfill your requirement.
Solution 3:[3]
Additional to @marsaldev's answer today i found to use the tax_name of the first product in cart - while being aware that this shop only uses one tax rule.
{$cart.products[0].tax_name}
thanks to @wolfack's hint
you should add what you found in invoice templates. So that we can guide how to reuse it
i will post the results also to get a complete answer
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | marsaldev |
| Solution 2 | Knowband Plugins |
| Solution 3 | Thomas Fellinger |
