Page 1 of 1

Visa as default Billing Method, not Paypal ?

PostPosted: November 24th, 2010, 12:54 am
by toddz88
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

Re: Visa as default Billing Method, not Paypal ?

PostPosted: April 22nd, 2011, 4:43 am
by toddz88
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>

Re: Visa as default Billing Method, not Paypal ?

PostPosted: April 22nd, 2011, 12:38 pm
by Cristián Lávaque
Nice tip, Todd. :)

I changed your rank to "Experienced User".

Re: Visa as default Billing Method, not Paypal ?

PostPosted: April 22nd, 2011, 11:52 pm
by toddz88
By the way, thanks for the rank upgrade Cristian :) Very cool, and much appreciated.

Re: Visa as default Billing Method, not Paypal ?

PostPosted: April 23rd, 2011, 12:03 am
by Cristián Lávaque
:)