Product price html template: Available Tags and Examples
Show the product price by the template with the option Display price changes on the product page. The template applies only on the simple products and variations (not variable products). It’s possible to show the price by the template not only for the products in the cart from the version 4.10.0.
Here are some available tags for your templates:
{{price_html}} – standard price template;

{{regular_price_striked}} shows the striked regular price
{{discounted_price_inclTax}} and {{discounted_price_exclTax}} show the discounted price with and without taxes.
{{price_inclTax}} and {{price_exclTax}} show the striked original price only for the discounted products
For example, to show the price with and without taxes, you can insert this template into the textbox of the Product price html template option:
1 2 3 4 |
<span class="price-with-tax">{{price_inclTax}} {{discounted_price_inclTax}} inc VAT</span> <br> <span class="exclusive-vat">{{price_exclTax}} {{discounted_price_exclTax}} <strong>ex VAT</strong></span> |
And how it will be shown on the product page of the discounted product:

The tags below works only for the products that are already in the cart:
{{Nth_item}} shows the ordinal number of the product that will be in the cart. For example, if you have already had 1 cap in the cart, you’ll see, that the current ordinal number of this product is 2nd. The template like this “{{Nth_item}} with the price {{price_html}}” will show the price like on the screenshot below for the 1+1 with 50% rule:

{{qty_already_in_cart}} shows how many products have already added to the cart. For example, you additionally want to show the price of the product in the bulk discount.

There is an additional enrichment of the tags with the adp_default_formatter_replacements hook. Here’s another one example of the showing the price with and without tax, but using the hook.
Insert the code example into the functions.php file of your theme or as a new snippet using any code snippets plugin:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
add_filter('adp_default_formatter_replacements', function($replacements, $processedProduct, $formatter) { $product = $processedProduct->getProduct(); $regular_price_excl = wc_get_price_excluding_tax($product, ['price' => $product->get_regular_price()]); $sale_price_excl = $product->get_sale_price() ? wc_get_price_excluding_tax($product, ['price' => $product->get_sale_price()]) : 0; $regular_price_incl = wc_get_price_including_tax($product, ['price' => $product->get_regular_price()]); $sale_price_incl = $product->get_sale_price() ? wc_get_price_including_tax($product, ['price' => $product->get_sale_price()]) : 0; $formatted_price_excl = wc_price($regular_price_excl); $formatted_price_incl = wc_price($regular_price_incl); if ($product->is_on_sale() && $product->get_sale_price()) { $formatted_price_excl = '<del>' . wc_price($regular_price_excl) . '</del> <ins>' . wc_price($sale_price_excl) . '</ins>'; $formatted_price_incl = '<del>' . wc_price($regular_price_incl) . '</del> <ins>' . wc_price($sale_price_incl) . '</ins>'; } $replacements = array_merge($replacements, [ 'formatted_price_excl' => $formatted_price_excl, 'formatted_price_incl' => $formatted_price_incl, ]); return $replacements; }, 10, 3); |
And use the template with the Product price html template:
1 |
<span class="price-with-tax"> {{formatted_price_incl}} inc VAT </span> <br> <span class="exclusive-vat"> {{formatted_price_excl}} <strong>ex VAT</strong> </span> |
And you’ll get the result:
