I tried adding a little text “excl. tax” next to the price. Ideally it would be only on the product page and not on pages with lists of products. Is there a way?
@pepeeth the Dawn Theme already includes Code for this.
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}
{%- if shop.taxes_included -%}
{{ 'products.product.include_taxes' | t }}
{%- endif -%}
{% assign current_variant = product.selected_or_first_available_variant %}
{% if current_variant.requires_shipping %}
{%- if shop.shipping_policy.body != blank -%}
{{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- endif -%}
{% endif %}
{%- endif -%}
Translated this means:
If you’re in your Store Settings you have selected that your product prices include taxes, then this “Taxes included” will be displayed. Additionally, if you have filled the shipping policies field with text, it will show the text “Taxes included but shipping at checkout”.
@Finer I have found the code but I like to have the opposite, I do not want the tax included on the product page and I want a little note pointing that out (e.g. “excluding tax”). How do I best change the code to archieve that?
@Finer It didn’t work. I implemented the code but nothing changed.
Maybe I explained it wrong there is still tax applied to the products but not until checkout. But even when I deactivated taxes completly it still didnt give my the text, while I had the code saved.
When I select to include taxes in product prices in the store settings, I see the little note and I want exactly that just the opposite
Could you think of another way or why it doesn’t work?
Just for my understanding: You are applying taxes (in the checkout), but you want to show the price on the product page excluding the taxes?
In the above code, a condition is missing, but we can also remove the first condition. So, you could try this:
{%- if shop.taxes_included -%}
{{ 'products.product.include_taxes' | t }}
{%- else -%}
excluding taxes <---- you can also set create a translation key in the locales files
{%- endif -%}
{% assign current_variant = product.selected_or_first_available_variant %}
{% if current_variant.requires_shipping %}
{%- if shop.shipping_policy.body != blank -%}
{%- if shop.taxes_included -%}
{{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- else -%}
excluding taxes, shipping will be calculated at checkout.
{%- endif -%}
{%- endif -%}
{% endif %}
You could go to the language settings of the theme and look for the string “Taxes included” and replace it with “Taxes excluded”. But this would also apply to products that are supposed to display the price, including taxes. If you don’t show prices incl. the taxes, that’s fine.
I am just not sure about if the checkout also uses this string.