WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms eWAY
[resolved] Use eway filters only on specific forms (4 posts)

  1. tcsolutions
    Member
    Posted 1 year ago #

    I have a couple of payment forms with different gravity formid's used for different purposes on the same site.

    To modify the eway invoice description I am using the gfeway_invoice_desc filter but this modifies the description of all forms

    It doesn't seem possible to add a filter with a special name like gfeway_invoice_desc_12 so it will only apply to formid 12

    I can put some logic in to check for the formid within the filter function but before doing so wanted to check if I am not doing it right or if there is another elegant solution (maybe wrap in a gravity form pre-submission filter.

    This is a great plugin!

    http://wordpress.org/extend/plugins/gravityforms-eway/

  2. webaware
    Member
    Plugin Author

    Posted 1 year ago #

    G'day,

    There are no form-specific filters in this plugin, so you'll need to add some logic. Here's a Gist showing how.

    https://gist.github.com/3808642

    It has logic for picking the description by the form ID, or by the value of a hidden field called "Invoice Description". If you use the latter, you can populate the invoice description dynamically and reuse the same form across multiple pages.

    cheers,
    Ross

  3. tcsolutions
    Member
    Posted 1 year ago #

    Thanks Ross - the example was very useful and I have setup different descriptions depending on what form they are filling out.

    I am putting all sorts of dynamic goodies into the description depending on what the user puts in the from and so as to not get them into a mysterious error situation they cannot correct I am truncating any description that exceeds the eway limit.

    return substr($desc, 0, 255);

    Thanks for the quick response.
    Steve

  4. webaware
    Member
    Plugin Author

    Posted 1 year ago #

    G'day Steve, good stuff. It sounds like you're on top of it!

    cheers,
    Ross

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.