WordPress.org

Ready to get started?Download WordPress

Forums

myCRED
[resolved] Button under form (9 posts)

  1. dambacher
    Member
    Posted 11 months ago #

    Hi Gabriel,

    When using shortcode like this:

    [mycred_buy_form amount="1,5,10,20" gateway="paypal-standard"]

    The "buy now" button displays above the "Select Amount:" dropdown.

    Is there a simple way to change this to have the button appear below the form?

    Thanks

    http://wordpress.org/extend/plugins/mycred/

  2. Gabriel
    Member
    Plugin Author

    Posted 11 months ago #

    Hey dambacher

    The Buy Now button comes after amount and receiver but before the optional balance and limit box. It has the CSS styling float: right, you could change this and apply more CSS rules to move it around.

    If the default CSS styling is "in the way" for you, you could always disable styling completely and set your own CSS styling.

  3. dambacher
    Member
    Posted 11 months ago #

    Thanks, so this is expected behavior here:

    http://imgur.com/MiZSvUv

  4. dambacher
    Member
    Posted 11 months ago #

    It seems like it should come after

  5. Gabriel
    Member
    Plugin Author

    Posted 11 months ago #

    The button is floated right, but when the form is not wide enough, it floats above the amount. Add CSS styling to your theme where you remove the float for the button and it should jump below.

  6. dambacher
    Member
    Posted 11 months ago #

    Cool, thank you.

  7. dambacher
    Member
    Posted 11 months ago #

    Hi Gabriel, would it make sense to just remove this:
    <input type="submit" name="submit" value="' . $button . '" class="mycred-buy button large" />';

    From line 574

    And change lines 680 and 681 to this:

    <input type="hidden" name="token" value="' . wp_create_nonce( 'mycred-buy-creds' ) . '" />
    <input type="submit" name="submit" value="' . $button . '" class="mycred-buy button large" />

    Seems to work for me then no styling is needed as the button will show up under all form choices.

    Make sense?

  8. dambacher
    Member
    Posted 11 months ago #

    I'll try to make that a little clearer.

    in myCRED-addon-buy-creds.php

    I changed line 573 from this:
    <form method="post" action="" class="' . implode( ' ', $classes ) . '">

    To this:
    <form method="post" action="" class="' . implode( ' ', $classes ) . '">';

    I moved line 574 to line 681 just after this:
    <input type="hidden" name="token" value="' . wp_create_nonce( 'mycred-buy-creds' ) . '" />

    So line 680 and 681 now look like this:
    <input type="hidden" name="token" value="' . wp_create_nonce( 'mycred-buy-creds' ) . '" />
    <input type="submit" name="submit" value="' . $button . '" class="mycred-buy button large" />

    Is that a decent way to do this do you think?

    Thanks

  9. Gabriel
    Member
    Plugin Author

    Posted 11 months ago #

    Hey

    It makes sense, Ill have a look at it.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.