v:store:tag formatting
  • It's not explicitly stated in the docs, but do the fields which render prices (v:store:item:price, v:store:cart:total, etc) allow use of attributes you can use on v:text? If you don't use a currency selector, what is the recommended best practice for formatting prices properly? $2,000.99 is the ideal formatting. Does this work?

    <v:store:item:price number_format="2" />

  • 3 Answers sorted by
  • It should format that way by default, as that's the normal way the USD currency is displayed (without the number_format option).

  • UPDATE: Turns out my code had another issue, but I'm still curious about whether the code I pasted above is supported and whether v:text attributes can be used on those fields.

    That's not what I'm seeing. We have a couple pages where it's formatting as $0.0 by default.

  • You could also use normal string php manipulation functions for this:

    <v:text path="currency_format(price)" />

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership

In this Discussion