Price minus vat minus percentage

Solved
Highlighted
Excursionist
47 3 3

I'm building a order sheet for our wholesale customers. We have wholesale percentage discount tiers. I need to show product price excluding vat, minus discount %.

 

Example for wholesale-10 taged customer:

variant price × vat - 5%

 

{% if customer.tags contains "wholesale-5" %}
     {{ variant.price | times: 0.8 | minus: 5% | money }}
{% elsif customer.tags contains "wholesale-10" %}
     {{ variant.price | times: 0.8 | minus: 10% | money }}
{% elsif customer.tags contains "wholesale-20" %}
     {{ variant.price | times: 0.8 | minus: 20% | money }}
{% else %}
     {{ variant.price | money }}    
{% endif %}

How do i use liquid to remove X% ?

0 Likes
Highlighted
Excursionist
47 3 3

This is an accepted solution.

Solved it

 

{% assign percent = 5 %}
{% assign wholesale-5 = variant.price | divided_by: 100 | times: percent %}
{{ variant.price | minus: wholesale-5 | times: 0.8 | money }}
0 Likes