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 Link Instead of Form/Button for Paypal Subscribe

s2Member Plugin. A Membership plugin for WordPress®.

HTML Link Instead of Form/Button for Paypal Subscribe

Postby Raam Dev » October 30th, 2011, 8:09 pm

I'd like to create an HTML subscription link that works with s2Member instead of using a <form> or WordPress shortcode. Is this possible?

I want to do something like this:

Code: Select all
<a href="<subscribe link">Subscribe to my Journal - $5/month</a>
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: HTML Link Instead of Form/Button for Paypal Subscribe

Postby Bruce C » October 31st, 2011, 11:17 am

Creating an link with <a> would not be possible, since s2member passes hidden variables in through the form, which cannot be passed in a link. However, you could create something similar by pointing to an image that doesn't exist and changing the alt="" in the form.
~Bruce ( a.k.a. Ace )

If you're interested in a Professional Installation, or Custom Coding Job, you can send your request here.

Proud Supporter of:
The Zeitgeist Movement
and Occupy Everything
User avatar
Bruce C
Experienced User
Experienced User
 
Posts: 337
Joined: July 20, 2011

Re: HTML Link Instead of Form/Button for Paypal Subscribe

Postby Raam Dev » October 31st, 2011, 12:04 pm

I fell asleep last night thinking about this problem and I realized that I could use JavaScript to achieve what I wanted: First, I hide the submit button using CSS, then I submit the form using JavaScript by adding onClick to the link HTML.

However, before I can do any of that, I need to give the s2Member form a name. Both the shortcode-generated form and the HTML provided by the button generator don't have a form a name.

How to Create an HTML link that submits Subscribe buttons

Update: As Cristián points out below, this can be achieved using the output="url" shortcode option (read more here: WP Admin -> s2Member -> PayPal Button -> Shortcode Attributes).

By changing the output option to 'url', the shortcode will return a raw URL that we can then use in an anchor tag to create a link:

Code: Select all
<a href="[s2Member-PayPal-Button level="1" ccaps="" desc="Raam's Journal ($5/month)" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="raamdev.com" ta="0" tp="0" tt="D" ra="5.00" rp="1" rt="M" rr="1" rrt="" rra="1" image="default" output="url" /]">Subscribe to the Journal ($5/month)</a>


When the post is published, that code turns into a link that allows my reader to subscribe to my journal:

Image
Last edited by Raam Dev on November 1st, 2011, 11:45 am, edited 1 time in total.
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: HTML Link Instead of Form/Button for Paypal Subscribe

Postby Cristián Lávaque » November 1st, 2011, 12:06 am

Raam, have you tried using the anchor or URL output for the shortcode? WP Admin -> s2Member -> PayPal Button -> Shortcode Attributes -> output
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 Link Instead of Form/Button for Paypal Subscribe

Postby Raam Dev » November 1st, 2011, 11:35 am

Cristián Lávaque wrote:Raam, have you tried using the anchor or URL output for the shortcode? WP Admin -> s2Member -> PayPal Button -> Shortcode Attributes -> output


Cristián, the URL output option is exactly what I was looking for -- thanks! I'll update my original post with the 'correct' solution to prevent confusion for others. :)

Cheers!
Raam Dev || Wherever you are, be there. || Please rate s2Member!
User avatar
Raam Dev
Developer
Developer
 
Posts: 810
Joined: October 26, 2011

Re: HTML Link Instead of Form/Button for Paypal Subscribe

Postby Cristián Lávaque » November 2nd, 2011, 2:10 am

Cool! Glad I could help. :)
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 8 guests

cron