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.

Adding options to paypal button

Home Forums Community Forum Adding options to paypal button

This topic contains 12 replies, has 4 voices. Last updated by  eve lurie 3 years, 8 months ago.

Topic Author Topic
Posted: Sunday Sep 2nd, 2012 at 9:23 pm #23884
Mike Capps
Username: emike09

My clients register on my website using the S2 member registration, and extend their membership using the s2 Paypal button function. As a perk for registering, they get a free T-Shirt. I want the button to also have an option that allows the clients to specify the T-Shirt size either before clicking the button or after. What’s the best way to go about this?

List Of Topic Replies

Viewing 12 replies - 1 through 12 (of 12 total)
Author Replies
Author Replies
Posted: Tuesday Sep 11th, 2012 at 4:34 pm #24931
Mike Capps
Username: emike09

Bump any ideas?

Posted: Tuesday Sep 11th, 2012 at 4:51 pm #24932
Eduan
Username: Eduan
Moderator

Hello Mike,

You can check under Dashboard -› s2Member® -› General Options -› Registration/Profile Fields and add a radio button as an options, maybe.

Hope this helps. :)

Posted: Tuesday Sep 11th, 2012 at 4:55 pm #24934
Mike Capps
Username: emike09

Hi Eduan,
Thanks for the reply. That’s certainly an option, but i’m afraid it would confuse those who are registering in general for the site vs those who are actually paying for membership as only the paying members get the T-Shirt.

Posted: Saturday Sep 15th, 2012 at 12:40 am #25391
Dan Martinez
Username: njitc

Mike,

This is pretty easy, however, it’s not done using the s2Member system. PayPal buttons are generated based on passed HTML variables.

I don’t know if you can try to add these vars to the s2Member generated shortcode version (haven’t tried it..). Though, I know it WILL work if you use the HTML version of the button code from s2Members button generator. Of course, this means the button is not encrypted, so you’ll have to turn off required button encryption in your paypal settings.

So, use the s2m button generator and then add this code to the bottom of it right ABOVE the

</form>

line:

<input type="hidden" name="on1" value="Size">Size<select name="os1"> 
  <option value="Small">Small</option>
  <option value="Large">Large</option>
</select>

You can create as many option values as needed to add more sizes. This creates a required option that does not change the price, but you’ll see it when your paypal orders are processed.

[Edited to fix missing closing tags]

  • This reply was modified 4 years, 3 months ago by  Dan Martinez.
Posted: Saturday Sep 15th, 2012 at 8:54 am #25420
Eduan
Username: Eduan
Moderator

Thanks for the tip Dan!

Just wanted to fix a little error (you didn’t put the closing option tag):

<input type="hidden" name="on1" value="Size">Size<select name="os1"> 
	<option value="Small">Small</option>
	<option value="Large">Large</option>
</select>

– Eduan

Posted: Sunday Sep 16th, 2012 at 3:05 am #25460
Dan Martinez
Username: njitc

Eduan,

Good catch, my typing wasn’t in sync with my thoughts and I left them out unintentionally. I corrected my previous post!

Posted: Sunday Sep 16th, 2012 at 1:01 pm #25495
Eduan
Username: Eduan
Moderator

No problem Dan. :)

@Mike, does this work for you?

Posted: Thursday Oct 4th, 2012 at 5:23 pm #27477
Mike Capps
Username: emike09

Sorry it’s taken me so long to get back. It’s not quite working, and now I’ve not got a huge chunk of empty space above the button when I use the HTML version. When clicking on the button, I’m getting some paypal errors too. Any tips on this?

http://www.goldrushexpeditions.com/paypaltest/

  • This reply was modified 4 years, 3 months ago by  Mike Capps.
Posted: Thursday Oct 4th, 2012 at 5:47 pm #27483
Eduan
Username: Eduan
Moderator

Hello Mike,

Do you still have this problem if you use the default WordPress theme? (TwentyEleven.)

Posted: Thursday Oct 4th, 2012 at 6:00 pm #27489
Mike Capps
Username: emike09

Hi Eduan,
Yes, the same thing happens with the default 2011 theme.

Here is the HTML being used:

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="xxxx@xxxx.com" />
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<!-- Instant Payment Notification & Return Page Details -->
<input type="hidden" name="notify_url" value="http://www.goldrushexpeditions.com/?s2member_paypal_notify=1" />
<input type="hidden" name="cancel_return" value="http://www.goldrushexpeditions.com/" />
<input type="hidden" name="return" value="http://www.goldrushexpeditions.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.goldrushexpeditions.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="Gold Rush Member / description and pricing details here." />
<input type="hidden" name="item_number" value="1" />
<!-- 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="0" />
<!-- Customizes Prices, Payments & Billing Cycle -->
<!--<input type="hidden" name="amount" value="12.00" />-->
<input type="hidden" name="src" value="1" />
<input type="hidden" name="srt" value="" />
<input type="hidden" name="sra" value="1" />
<input type="hidden" name="a1" value="12.00" />
<input type="hidden" name="p1" value="1" />
<input type="hidden" name="t1" value="Y" />
<input type="hidden" name="a3" value="12.00" />
<input type="hidden" name="p3" value="1" />
<input type="hidden" name="t3" value="Y" />
<!-- Displays The PayPal® Image Button -->
<input type="hidden" name="on2" value="Size">Size<select name="os1"> 
<option value="Small">Small</option>
<option value="Medium">Medium</option>
<option value="Large">Large</option>
<option value="XLarge">X-Large</option>
<option value="XXLarge">XX-Large</option>
</select>
<input type="hidden" name="on3" value="Size">Size<select name="os1"> 
<option value="Mens">Mens</option>
<option value="Womens">Womens</option>
</select>
<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>
  • This reply was modified 4 years, 3 months ago by  Mike Capps.
  • This reply was modified 4 years, 3 months ago by  Mike Capps.
Posted: Thursday Oct 4th, 2012 at 6:51 pm #27500
Eduan
Username: Eduan
Moderator

Well I can’t figure out right away what the problem is.

I think it may be that all your custom select fields have the same name:

<input type="hidden" name="on2" value="Size">Size<select name="os1"> 
<option value="Small">Small</option>
<option value="Medium">Medium</option>
<option value="Large">Large</option>
<option value="XLarge">X-Large</option>
<option value="XXLarge">XX-Large</option>
</select>
<input type="hidden" name="on3" value="Size">Size<select name="os1"> 
<option value="Mens">Mens</option>
<option value="Womens">Womens</option>
</select>

So instead do it like:

<input type="hidden" name="on2" value="Size">Size<select name="os2"> 
<option value="Small">Small</option>
<option value="Medium">Medium</option>
<option value="Large">Large</option>
<option value="XLarge">X-Large</option>
<option value="XXLarge">XX-Large</option>
</select>
<input type="hidden" name="on3" value="Size">Size<select name="os3"> 
<option value="Mens">Mens</option>
<option value="Womens">Womens</option>
</select>

– Eduan

Posted: Thursday Apr 18th, 2013 at 4:42 pm #47802
eve lurie
Username: elurie

hi there,
Playing with s2Member pre sale, I tried pasting the long form into Membership Options Page and also got a huge chunk of space before button.
many thanks,
eve lurie
elurie@gmail.com

Viewing 12 replies - 1 through 12 (of 12 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.