| money filter not working on javascript

Jun_Kuan
New Member
26 0 0

Hi. So for some reason, I'm trying to subtract my variant prices. It's working but the money filter isnt.

 

 

 

<script>
console.log ( {{ product.variants[0].price | minus: product.variants[1].price }} );
</script>

 

 

80604

The number above is what I'm being able to get. Adding | money filter to the code returns nothing. For example:

 

 

<script>
console.log ( {{ product.variants[0].price | minus: product.variants[1].price | money }} );
</script>

 

Any workaround I can do please? Thanks!

0 Likes