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™

Visa as default Billing Method, not Paypal ?

s2Member Plugin. A Membership plugin for WordPress®.

Visa as default Billing Method, not Paypal ?

Postby toddz88 » November 24th, 2010, 12:54 am

On the s2Member PRO payment/checkout forms, how can I make Visa be the default / initially selected Billing Method, rather than PayPal ?

We need the credit-card related fields (card number, expiration, verif code, and billing address) to be displayed (rather than hidden) when the page loads, since the vast majority of our customers will use credit cards rather than Paypal, and they'll expect to see those fields.

It looks like those fields get an inline style='display:none' that is not present in the template source markup, but i can't seem to figure out where it's coming from. I can't seem to use css to override the inline style, unless I use !important, but then it would fail to be hidden when the Paypal option is selected.

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

Re: Visa as default Billing Method, not Paypal ?

Postby toddz88 » April 22nd, 2011, 4:43 am

In case anyone else has this issue, here is how I solved it.

In the s2mPro form template file "paypal-checkout-form.html", i added a new css class "creditcard-field" to all the credit-card related divs that i want displayed by default, but were otherwise hidden by an inline style=display:none (which i couldn't figure out where it was coming from). Then i have jquery (in header.php) to target these new .creditcard-field elements, and change the attribute of "style" to "display:block".


in paypal-checkout-form.html, "creditcard-field" is added to the class list"
Code: Select all
<div id="s2member-pro-paypal-checkout-form-card-number-div" class="s2member-pro-paypal-form-div s2member-pro-paypal-checkout-form-div s2member-pro-paypal-form-card-number-div s2member-pro-paypal-checkout-form-card-number-div creditcard-field">


in header.php (assuming jquery is already enabled):
Code: Select all
<script type="text/javascript">
      jQuery(document).ready(function() {
         jQuery('.creditcard-field').attr('style','display:block');
      });
</script>
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: Visa as default Billing Method, not Paypal ?

Postby Cristián Lávaque » April 22nd, 2011, 12:38 pm

Nice tip, Todd. :)

I changed your rank to "Experienced User".
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: Visa as default Billing Method, not Paypal ?

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

By the way, thanks for the rank upgrade Cristian :) Very cool, and much appreciated.
User avatar
toddz88
Experienced User
Experienced User
 
Posts: 61
Joined: November 19, 2010

Re: Visa as default Billing Method, not Paypal ?

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

:)
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