latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Blank lines before Paypal Button

Home Forums Community Forum Blank lines before Paypal Button

This topic contains 4 replies, has 2 voices. Last updated by  Hamid 3 years, 11 months ago.

Topic Author Topic
Posted: Wednesday Jan 23rd, 2013 at 7:24 am #39151

When I put a Paypal button for a Specific Page restriction into a page, it displays about 20 blank lines before it – is this anything anyone has seen/solved before? It happens whether I use the shortcode or the full code.

Am I missing something? To get access to support I’m happy to upgrade to the paid version, but only if this isn’t a theme issue (using Startup from ThemeForest).

See http://thebusyfool.com/find-your-focus-ecourse-3

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Wednesday Jan 23rd, 2013 at 2:36 pm #39211
Hamid
Username: zawiyaprojects

Hello Andrew, it has to do with the hidden fields in the form. I remember having the same problem and I ended up using css to pull the button back up.

Hamid

Posted: Thursday Jan 24th, 2013 at 4:59 am #39333

Hi Hamid, thanks for that – can you explain how you used CSS to do that, I tried the advice here: http://www.s2member.com/forums/topic/huge-gap-before-paypal-button-issue/ but it didn’t work for my site.

Posted: Thursday Jan 24th, 2013 at 7:03 am #39385
Hamid
Username: zawiyaprojects

Andrew, my website has gone through so many custom modifications and themes that I can’t remember “exactly” what we ended up using. I cant remember if it was a theme issue or not, sorry for the vagueness, but if I remember correctly, we used something like this in the style.css stylesheet.

.movebtn { margin: -200px 0 0 0; }

then we found the page that was displaying the Paypal button and added this .movebtn class to Paypal button style. For example, if the Paypal button had

class="s2member-pro-paypal-submit s2member-pro-paypal-checkout-submit"

we added the movebtn class to the end it like so

class="s2member-pro-paypal-submit s2member-pro-paypal-checkout-submit movebtn"

Again, sorry for the vagueness but I hope I shed a little light on the problem.
Hamid

P.S. If I can dig up the css style I used, I will post it here. Or if you send me your url of the page in question, I will take a look at it.

Posted: Friday Jan 25th, 2013 at 2:40 pm #39530
Hamid
Username: zawiyaprojects

Andrew, I found it… please see code below.

In my member’s option page I have some conditions to qualify the user’s member level. In this example if a free member goes to the member’s option page, he/she is presented with a custom Paypal button to upgrade to Premier. Normally the button would appear under the browser window (making it non-visible to the user unless they scrolled down). The s2member generate code looked like this:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
 <input type="hidden" name="business" value="paypal@domain.com" />
 <input type="hidden" name="cmd" value="_xclick" />
 <!-- Instant Payment Notification & Return Page Details -->
 <input type="hidden" name="notify_url" value="http://www.domain.com/?s2member_paypal_notify=1" />
 <input type="hidden" name="cancel_return" value="http://www.domain.com/" />
 <input type="hidden" name="return" value="http://www.domain.com/?s2member_paypal_return=1" />
 <input type="hidden" name="rm" value="2" />
 <!-- Configures Basic Checkout Fields -->
 <input type="hidden" name="lc" value="" />
 <input type="hidden" name="no_shipping" value="1" />
 <input type="hidden" name="no_note" value="1" />
 <input type="hidden" name="custom" value="www.domain.com" />
 <input type="hidden" name="currency_code" value="USD" />
 <input type="hidden" name="page_style" value="paypal" />
 <input type="hidden" name="charset" value="utf-8" />
 <input type="hidden" name="item_name" value="Upgrade to Premier Member for only 79.95" />
 <input type="hidden" name="item_number" value="2::1 Y" />
 <!-- Configures s2Member's Unique Invoice ID/Code  -->
 <input type="hidden" name="invoice" value="<?php echo S2MEMBER_VALUE_FOR_PP_INV(); ?>" />
 <!-- Identifies/Updates An Existing User/Member ( when/if applicable )  -->
 <input type="hidden" name="on0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; ?>" />
 <input type="hidden" name="os0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; ?>" />
 <!-- Identifies The Customer's IP Address For Tracking -->
 <input type="hidden" name="on1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1; ?>" />
 <input type="hidden" name="os1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; ?>" />
 <!-- Controls Modify Behavior At PayPal® Checkout -->
 <input type="hidden" name="modify" value="1" />
 <!-- Customizes Prices, Payments & Billing Cycle -->
 <input type="hidden" name="amount" value="79.95" />
 <!--<input type="hidden" name="src" value="BN" />-->
 <!--<input type="hidden" name="srt" value="" />-->
 <!--<input type="hidden" name="sra" value="1" />-->
 <!--<input type="hidden" name="a1" value="0" />-->
 <!--<input type="hidden" name="p1" value="0" />-->
 <!--<input type="hidden" name="t1" value="D" />-->
 <!--<input type="hidden" name="a3" value="79.95" />-->
 <!--<input type="hidden" name="p3" value="1" />-->
 <!--<input type="hidden" name="t3" value="Y" />-->
 <!-- Displays The PayPal® Image Button -->
 <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" style="width:auto; height:auto; border:0;" alt="PayPal®" />
</form>

To fix this I did the following:

Step 1: I added the following style to my theme’s stylesheet (namely, style.css)

.movebtn { margin: -600px 0 0 0;}

Step 2: I edited the s2member’s Paypal button code as follows:

<p class="movebtn">
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
 <input type="hidden" name="business" value="paypal@domain.com" />
 <input type="hidden" name="cmd" value="_xclick" />
 <!-- Instant Payment Notification & Return Page Details -->
 <input type="hidden" name="notify_url" value="http://www.domain.com/?s2member_paypal_notify=1" />
 <input type="hidden" name="cancel_return" value="http://www.domain.com/" />
 <input type="hidden" name="return" value="http://www.domain.com/?s2member_paypal_return=1" />
 <input type="hidden" name="rm" value="2" />
 <!-- Configures Basic Checkout Fields -->
 <input type="hidden" name="lc" value="" />
 <input type="hidden" name="no_shipping" value="1" />
 <input type="hidden" name="no_note" value="1" />
 <input type="hidden" name="custom" value="www.domain.com" />
 <input type="hidden" name="currency_code" value="USD" />
 <input type="hidden" name="page_style" value="paypal" />
 <input type="hidden" name="charset" value="utf-8" />
 <input type="hidden" name="item_name" value="Upgrade to Premier Member for only 79.95" />
 <input type="hidden" name="item_number" value="2::1 Y" />
 <!-- Configures s2Member's Unique Invoice ID/Code  -->
 <input type="hidden" name="invoice" value="<?php echo S2MEMBER_VALUE_FOR_PP_INV(); ?>" />
 <!-- Identifies/Updates An Existing User/Member ( when/if applicable )  -->
 <input type="hidden" name="on0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; ?>" />
 <input type="hidden" name="os0" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; ?>" />
 <!-- Identifies The Customer's IP Address For Tracking -->
 <input type="hidden" name="on1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1; ?>" />
 <input type="hidden" name="os1" value="<?php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; ?>" />
 <!-- Controls Modify Behavior At PayPal® Checkout -->
 <input type="hidden" name="modify" value="1" />
 <!-- Customizes Prices, Payments & Billing Cycle -->
 <input type="hidden" name="amount" value="79.95" />
 <!--<input type="hidden" name="src" value="BN" />-->
 <!--<input type="hidden" name="srt" value="" />-->
 <!--<input type="hidden" name="sra" value="1" />-->
 <!--<input type="hidden" name="a1" value="0" />-->
 <!--<input type="hidden" name="p1" value="0" />-->
 <!--<input type="hidden" name="t1" value="D" />-->
 <!--<input type="hidden" name="a3" value="79.95" />-->
 <!--<input type="hidden" name="p3" value="1" />-->
 <!--<input type="hidden" name="t3" value="Y" />-->
 <!-- Displays The PayPal® Image Button -->
 <input type="image" src="/images/upgrade_to_prem_v2.gif" style="width:auto; height:auto; border:0;" alt="PayPal®" />
</form>
</p>

Notice I enclosed the button code in the

<p class="movebtn">

and I change the images src to a custom image instead of Paypal’s default button.

I hope this helps.
Hamid

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.