PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Merge tag problem: How to display price without currency?

  1. tedulrik
    Member

    The merge tag for the total pricing field displays the total amount including the currency. Is there a way to get the amount only? I need it to create a payment URL in the email notification to the user.

    Posted 12 years ago on Friday December 2, 2011 | Permalink
  2. Hi Ted,

    Because the pricing fields automatically add on the currency indicator, you can use the "gform_pre_submission_filter" hook to get around this. You can add a hidden text field to your form and then update that field to the contents of the total field. For your notification merge tags, you will use the hidden field instead of the total field. Because the text field is not considered to be a pricing field, the data will not be converted to currency. Keep in mind that leading/trailing zeroes may not be in the string. Below is a link to sample code I used to accomplish this:

    http://pastie.org/3008056

    Take a look and let me know if you have questions.

    Posted 12 years ago on Tuesday December 13, 2011 | Permalink
  3. tedulrik
    Member

    Works great, thanks for the solution!

    Posted 12 years ago on Thursday December 29, 2011 | Permalink
  4. Thank you for the update. Happy New Year.

    Posted 12 years ago on Thursday December 29, 2011 | Permalink

This topic has been resolved and has been closed to new replies.