Page 1 of 1

Filter - for alternative landing page

PostPosted: April 7th, 2011, 6:05 pm
by peterhuk
Hi Jason,

I can't remember if I posted this question or emailed, anyway
I mentioned that I use S2Member for access to WP backend
publishing whilst all the front end is free for all.

This creates a dilema when all update buttons are located
in the use dashboard. So when an update is made currently
they are send back to the login page.

You mentioned that some new filters will be available to give
developers the option to return (paid via paypal) updated
customer back to a logged in menu page of the developers
choice.

I intented to look into the files that may contain the relevent
filters but when I saw how many files there were in the S2Member
class dir it made my eyes water.

Any chance of pointing me in the right direction for the required
file containing the relevent alternative landing page filter.

P.S this is only for members, non members still need to be
redirected to the registration page.

Many thanks

Pete..

Re: Filter - for alternative landing page

PostPosted: April 7th, 2011, 6:13 pm
by peterhuk
Additional point,

Lets say the customer want to purchase support as aposed to paying for a page access.
using the one off payment is there any S2Meber triggers that I can utilise i.e
when the customer is returned from paypal when S2Memer initiates it routines
is the a filter or action I can latch onto for example to auto generating a support ticket?

Many thanks

Pete..

Re: Filter - for alternative landing page

PostPosted: April 8th, 2011, 12:23 pm
by peterhuk
Hi Jason,

Ok I think I have sorted out my previous question. The filter for:
ws_plugin__s2member_redirection_url_after_modification
seem to orignate form paypal-return-in.inc.php.

Which seems to sugest that a filter can be created with a return
value of the location you want modified users to return to
(hope this is correct and not sure whether to include 'http://' prefix
in return value).

If this is correct then this is good but this is my second problem which
when I get to (including purchasing pro to deal with upgrading) will become
even more exciting.

My first problem which I am working on at present is to make use of the one
one off buy now buttons. Lets say a subscriber wants to purchase support
for seting up their first page (or what ever). Becuase subscribers will
have access to the backend, any subsequent purchase will be inside the
user admin panel.

To make a purchase and then be sent onto the frontend (public facing side)
does not make much sense with my setup.

is it possible to send subscribers who use buy now (specific post/page) to
be returned back to the admin panel. Or is there an alternative buy now
button that can be used?

In addition I would like to setup a user_meta entry for users who make a
buy now purchase. Is there a filter or action I can use to auto create
the meta tag on payment success?

Many thanks

Pete..

Re: Filter - for alternative landing page

PostPosted: April 9th, 2011, 12:11 am
by Cristián Lávaque
Hi Pete. :)

I hope I understood right what you want to do. Here are a couple of places I suggest you look at, that may have just what you need.

For the return URL after member's payment, in s2Member Pro:
WP Admin -> s2Member -> PayPal Pro-Forms -> PayPal Pro Billing Modification Forms
WP Admin -> s2Member -> PayPal Pro-Forms -> Custom Return URLs On Success


For the other things you mentioned, you could use the Notifications API:
WP Admin -> s2Member -> API / Notifications



I hope that helps you. :)

Re: Filter - for alternative landing page

PostPosted: April 9th, 2011, 5:39 am
by peterhuk
Hi Cristián,

Many thanks for the response. Very sorry for confusing the matter, I should
have just asked one question at a time.

My question should have been phase: using S2Member standard (have
not purchase S2Member pro yet, that will be for my next problem
an I will only be using S2Member Pro for user modification I'm
to addicted to the simplicity of the buttons.)

Like the new 'ws_plugin__s2member_redirection_url_after_modification'
filter introduced in S2Memebr 3.5.3 which allow developers to use a
filter to send returning cutomers (from paypal purchase) to an alternative
page other than wp-login.

Is there a simular filter for the 'PayPal® Specific Post/Page (Buy Now) Buttons'
to allow delevolpes to send customers to an internal page instead of the required
page id.

Or better still is there a way to speficy a (buy now) button on its own. Because I am
selling access to features within the WP admin panel if customers require support
in creating content or digital media I would like to offer them a simple buy now
button to pay for that support (or the work to create the content or digital media).

Because they will already be within the admin panel when they make a purchase
I would like them to return to the admin panel after the purchase.

If there is a way to manually create the standalone button that will be compatable
with S2Member that would be fantastic. If not then if the is a fliter / wp-hack
that could be used to divert users with a specific id (required by PayPal® Specific
Post/Page (Buy Now) Buttons) back to the admin panel.

The icing on the top would be if I would also be able to have access to some
of the transaction details to insert into a user meta as part of the same filter /wp-hack.

Many thanks

Pete..

Re: Filter - for alternative landing page

PostPosted: April 10th, 2011, 7:28 pm
by peterhuk
Please disregard this question.

After poking around with a few filters and actions I have finally got it exactly
how I want it.

Many thanks

Pete..

Re: Filter - for alternative landing page

PostPosted: April 10th, 2011, 11:14 pm
by Cristián Lávaque
Hi Pete. Great! I'm glad you figured it out. :)

Would you tell us how you did it? I'd love to know. Thanks! ;)

Re: Filter - for alternative landing page

PostPosted: April 11th, 2011, 2:53 am
by peterhuk
Hi Cristián,

To get the 'PayPal® Specific Post/Page (Buy Now) Buttons' to return to
the dashboard (or logged in page of developers choice) 2 things were
required.

First to collect data:
Code: Select all
add_action('ws_plugin__s2member_during_paypal_return_during_sp_access''some_function_sp_access'); 


By tapping into the above action I was able to grab transaction details and the user email address
then use get_user_by('email') to get user id (this part is heavily dependand on the user using the same email for wp registration and paypal but this can be confirmed by comparing current user with returned user id).

Using the user ID save data to user_meta which can then be used but an alerting process to inform admin
that a buy now (support request) has come in.

Next to change the returning url:
Code: Select all
add_filter('ws_plugin__s2member_sp_access_link_gen','some_return_url_sp_access_link_gen'); 

because I do not restrict any pages on the front end SP links are redundant therefore any
sp links are converted to dashboard (or prefered url) links.

If sp links were required then I guess this could be done for specific id querie the link
data and grab the id if it is one for redirection then send to required url else
return filter data unaltered and allow S2 to send to link based on post/page id.

Hope this helps

Pete..

Re: Filter - for alternative landing page

PostPosted: April 11th, 2011, 3:56 am
by peterhuk
P.S

If you don't use 'PayPal® Specific Post/Page (Buy Now) Buttons' for
restricting post/pages and you really want to guarantee you have
the right user id then you can replaced the post/page id with user id.

Pete..

Re: Filter - for alternative landing page

PostPosted: April 12th, 2011, 1:32 am
by Cristián Lávaque
Thanks Pete! :)