Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Joe Dolson

    (@joedolson)

    There’s a filter called mt_money_format which you can use to modify the display of pricing.

    Most plug-in text can also be filtered; here’s an example for one case:

    https://github.com/joedolson/plugin-extensions/blob/master/my-tickets/my-tickets-filter-text.php

    Thread Starter wexzone

    (@wexzone)

    Do you have a list of text filters available?

    I will play with it and see if I can get it to work.

    Plugin Author Joe Dolson

    (@joedolson)

    I don’t have a list of text filters, no – there are a lot of them, so I’d recommend identifying what text you want to change, then looking for that text in the code. I will eventually generate a list of filters, but I haven’t had time for that yet.

    Thread Starter wexzone

    (@wexzone)

    How would I set up a filter to trim adjust the decimal places of the mt_money_format? I am not very familiar with how to make WP filters work.

    Thread Starter wexzone

    (@wexzone)

    This is how I did it:

    add_filter( ‘mt_money_format’, ‘mt_money_format2’, 10, 1 );
    function mt_money_format2( $price ) {
    $price = str_replace(“.00”, “”, $price);
    return $price;
    }

    Plugin Author Joe Dolson

    (@joedolson)

    That should work. And, additionally, if you were to use a price that actually had cents, it would retain the value anytime it’s non-zero, which would be to your benefit.

    Thread Starter wexzone

    (@wexzone)

    For now, we just have 2 ticket options, both are whole numbers, so I think this will do what we need. Thanks for your help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Change decimal and button text?’ is closed to new replies.