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™

html button

s2Member Plugin. A Membership plugin for WordPress®.

html button

Postby leonellfp » May 27th, 2011, 9:52 am

Hi,

Can I use the paypal Resulting PayPal® Button Code in an html page outside wordpress ?

Many thanks!
User avatar
leonellfp
Registered User
Registered User
 
Posts: 35
Joined: May 25, 2011

Re: html button

Postby Cristián Lávaque » May 28th, 2011, 12:56 am

The full code, yes; not the shortcode, though, that's WordPress'.
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: html button

Postby leonellfp » May 28th, 2011, 4:12 am

Hi Cristián,

I paste the full code, but when I click the button the paypal page shows some php code... :roll:

Please see the bellow image:
Image

Many thanks
User avatar
leonellfp
Registered User
Registered User
 
Posts: 35
Joined: May 25, 2011

Re: html button

Postby Cristián Lávaque » May 28th, 2011, 12:25 pm

I see. The full code has those two bits of PHP in it and you need to use the Exec PHP plugin for them to work, and not use the the visual editor or it causes what you get.

You can use shortcode for them instead of PHP, try replacing those with these, as long as you use them in the WordPress installation you have s2member in:

Code: Select all
[s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0" /]
[s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0" /]


Hmm... re-reading your first post, though, you're probably using the button in another website, right?
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: html button

Postby leonellfp » May 28th, 2011, 12:51 pm

Yes, the customer would like to have also a button on a html landing page outside wordpress...
Is this still possible ?
User avatar
leonellfp
Registered User
Registered User
 
Posts: 35
Joined: May 25, 2011

Re: html button

Postby Cristián Lávaque » May 28th, 2011, 3:12 pm

Maybe... If you're going to use those buttons to register new members only, then you can leave their values empty, in which case you will be able to use the buttons outside WordPress.

You can read the documentation for those fields at the bottom of WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API Constants.

S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0 ... This auto-fills the on0 value in PayPal® Button Codes. If a Button Code is presented to a logged-in Member, this will auto-fill the value for the on0 input variable, with the string: "Referencing Customer ID". Otherwise, it will be an empty string.

S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0 ... This auto-fills the os0 value in PayPal® Button Codes. If a Button Code is presented to a logged-in Member, this will auto-fill the value for the os0 input variable, with the value of S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID. Otherwise, it will be an empty string.

These two Constants are special. They are used by the PayPal® Button Generator for s2Member. This is how s2Member identifies an existing Member ( and/or a Free Subscriber ), who is already logged in when they click a PayPal® Modification Button that was generated for you by s2Member. Instead of forcing a Member ( and/or a Free Subscriber ) to re-register for a new account, s2Member can identify their existing account, and update it, according to the modified terms in your Button Code. These three Button Code parameters: on0, os0, modify, work together in harmony. If you're using the Shortcode Format for PayPal® Buttons, you won't even see these, because they're added internally by the Shortcode processor. Anyway, they're just documented here for clarity; you probably won't use these directly; the Button Generator pops them in.


I hope 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: html button

Postby leonellfp » May 28th, 2011, 3:38 pm

Yes that button will be on that landing page, and it's only for new members.
So if I understand correctly I can use the full code removing the 2 php lines ?

Code: Select all
[s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0" /]
[s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0" /]


Or do I have to put anything else ?

Many Thanks
User avatar
leonellfp
Registered User
Registered User
 
Posts: 35
Joined: May 25, 2011

Re: html button

Postby Cristián Lávaque » May 28th, 2011, 4:53 pm

You can remove the parts between <?php and ?>, so values will be empty for those fields value="".
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: html button

Postby leonellfp » May 28th, 2011, 5:35 pm

Ok,

That solve the html button issue...
How can I change the button full code to open the paypal page on a new window ?
(target="_blank")

Many thanks!
User avatar
leonellfp
Registered User
Registered User
 
Posts: 35
Joined: May 25, 2011

Re: html button

Postby leonellfp » May 28th, 2011, 5:43 pm

I think I find it myself...

On the first line of the code, I change this:
Code: Select all
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" >


to this
Code: Select all
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">


Am I right...?

Thanks
User avatar
leonellfp
Registered User
Registered User
 
Posts: 35
Joined: May 25, 2011

Re: html button

Postby Cristián Lávaque » May 28th, 2011, 6:06 pm

Yep, that's the way. :)
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: html button

Postby leonellfp » May 28th, 2011, 6:24 pm

Thank you Cristián, Great Support... !!!
User avatar
leonellfp
Registered User
Registered User
 
Posts: 35
Joined: May 25, 2011

Re: html button

Postby Cristián Lávaque » May 28th, 2011, 6:32 pm

You're welcome. I'm glad I could help you with that! :)
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: Google [Bot] and 1 guest

cron