cancel
Showing results for
Did you mean:

## Calculate the percentage value from the total cart - price [Debut Theme]

Solved
Highlighted
New Member
2 0 1

Hey everyone,

I would like to calculate the percentage value from the total, calculate out of here:

{{ cart.total_price | money_with_currency }}

For example, if the total value of the shopping cart is 100 €, 5% (always the same) should be calculated. So the answer is: 5 €

I have only slight knowledge but it did not work with cart.total_price * 5/100.

Mike

Highlighted
Excursionist
80 19 19

This is an accepted solution.

Hi Mike

I'd imagine it'd be something like:

{{ cart.total_price | divided_by: 100 | times: 5 | money_with_currency }}

The divided_by 100 will get you 1%.

You then times: by 5 to get 5%.

Then the money_with_currency filter displays it in the monetary format you'd expect?

Highlighted
New Member
2 0 1

Hi,

thanks for your help and anser.

It works like you described it, great. Exactly for money_with_currency is the corresponding currency (EURO, USD and others)

Best regards,

Mike

Latest Topics

Latest Posts

• ## How to increase Button Label size in "Image with text overlay" in debut theme?

Most Liked Authors