PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Hook/Filter to change order of Card Type Options?

s2Member Plugin. A Membership plugin for WordPress®.

Hook/Filter to change order of Card Type Options?

Postby toddz88 » April 22nd, 2011, 3:11 am

Is there a Hook/Filter to change the array order of Card Type Options / Billing Methods, in s2member Pro?

GOAL: On the s2Member Pro checkout form (template: paypal-checkout-form.html), I need to change the order in which the Billing Methods are displayed (by %%card_type_options%%), making Paypal the last option, rather than the first (since we can't remove it entirely).

Apparently the ShortCode does not actually control the order of display. I was able to use CSS to float it to the right, but that's a bit hacky and the spacing between Paypal and the others isn't perfect.

Then I found the line of code that actually sets the order, in this file:
s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php
So I can edit the array, putting Paypal last. But i also know it's unwise to edit the plugin files like this, as my changes will be lost in future updates. Can this be done with a Hook or Filter instead?

Thanks,
Todd
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: Hook/Filter to change order of Card Type Options?

Postby Cristián Lávaque » April 22nd, 2011, 2:52 pm

Hmm... I'm looking at the file (s2member-pro/includes/classes/gateways/paypal/paypal-form-in.inc.php).

Try the hook "ws_plugin__s2member_pro_before_sc_paypal_form_after_shortcode_atts" (line 69).

Let me know if that helps. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Hook/Filter to change order of Card Type Options?

Postby toddz88 » April 22nd, 2011, 11:51 pm

I haven't gone back to this yet, but the hook you suggested was my inspiration for the dynamic shortcode idea. Thanks!!
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: Hook/Filter to change order of Card Type Options?

Postby Cristián Lávaque » April 23rd, 2011, 12:04 am

Very cool! I'm glad I was able to help you. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 3 guests

cron