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.

Users track their purchases

Home Forums Community Forum Users track their purchases

This topic contains 12 replies, has 4 voices. Last updated by  Jason (Lead Developer) 3 years, 10 months ago.

Topic Author Topic
Posted: Friday Feb 15th, 2013 at 1:58 pm #41893

I’d appreciate hearing if I can do this:

We are selling lessons, each lesson a WP page. Users need to be able to purchase as many different lessons as they wish (no groupings of these = gold…). After they register they are granted access to pages as they pay for them individually

Students need to be able to see the lessons they have purchased – presumably this would be on their user profile page? And ideally they could access their purchased lessons/pages from their list of purchased lessons.

Thanks so much for your help.

List Of Topic Replies

Viewing 12 replies - 1 through 12 (of 12 total)
Author Replies
Author Replies
Posted: Saturday Feb 16th, 2013 at 4:15 pm #41968
Eduan
Username: Eduan
Moderator

Hello Stuart,

I’m afraid currently s2Member has no real way of listing what the user has access to. The only easy way for the user to know (pretty sure it’s not obvious though) is for the user to look at his role. That is if you are using levels, otherwise they would have to check their emails.

Perhaps you can do a little bit of voodoo with the code in order to output what the user has access to. :)

I imagine you’re going to accomplish this using custom capabilities correct?

– Eduan

Posted: Saturday Feb 16th, 2013 at 5:13 pm #41983

Thanks Eduan

A deal breaker for me – an essential requirement of my client. He is selling lessons – people must be able to log in and see what they purchased.

Alas I do not have the voodoo powers necessary to figure this out

FYI I have looked as an app/script called Sitelok that is incredibly easy to use including entering user data on any page. But it’s not built for WordPress!

Posted: Saturday Feb 16th, 2013 at 6:09 pm #41997
Eduan
Username: Eduan
Moderator

Hmm, I’m sorry then. :(

Although you don’t have to code it in yourself. You could hire a freelancer to do this for you. If you’re interested check in jobs.wordpress.net or elance.com. :)

– Eduan

Posted: Monday Feb 18th, 2013 at 5:42 pm #42350
Staff Member

Thanks for the heads up on this thread :-)

This IS possible in most cases.

Students need to be able to see the lessons they have purchased – presumably this would be on their user profile page? And ideally they could access their purchased lessons/pages from their list of purchased lessons.

What are you selling them exactly? s2Member® has many different functionalities, and the instructions will be different depending on whether you sold them Specific Post/Page Access, a Membership Level, or Custom Capabilties? Thanks!
Posted: Monday Feb 18th, 2013 at 6:42 pm #42359

I am selling access to pages.

Thanks Jason

Stuart

Posted: Monday Feb 18th, 2013 at 9:01 pm #42385
Staff Member

Access to Pages through s2Member® Specific Post/Page Buy Now Buttons? Is that correct?
Do these customers have accounts with your site? Or just buy and gain access to a Post/Page and that’s it?

Posted: Monday Feb 18th, 2013 at 9:33 pm #42389

They will register and have an account/membership on the site before they can purchase

thanks

Posted: Monday Feb 18th, 2013 at 11:23 pm #42409
Staff Member

Thanks for the follow-up :-)

OK. Well the short answer is that s2Member® does not have a Shortcode or anything that will produce a list of past purchases. However, because s2Member® tracks these details for existing Users/Members; you can still gain access to this information. Here is a quick plugin that will do the job.

This makes it possible to insert this Shortcode which will produce a list of past purchases; with links to URLs they purchased; based on Post or Page title. Pop this into a Post or Page in WordPress®.

[s2_sp_purchase_history /]

Now, please create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
(NOTE: these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins)
(See also: http://www.s2member.com/kb/hacking-s2member/)

<?php
function s2_sp_purchase_history()
	{
		$purchase_history = array();
		$references = get_user_option('s2member_sp_references');
		
		if(is_array($references) && !empty($references))
			{
				foreach($references as $reference)
					{
						$date_time = date('Y-m-d H:i:s', $reference&#91;'time'&#93;);
						$date_time = get_date_from_gmt($date_time, 'F j, Y')
						$purchase_history&#91;&#93; = '<a href="'.esc_attr($reference&#91;'url'&#93;).'">'.esc_html(get_the_title((int)$reference['ids'])).'</a> — purchased on: '.esc_html($date_time);
					}
			}
		return implode('<br />', $purchase_history);
	}
add_shortcode('s2_sp_purchase_history', 's2_sp_purchase_history');
Posted: Tuesday Feb 19th, 2013 at 2:19 pm #42502

Much appreciated Jason. I will give it a shot. Thanks for your assistance

Posted: Wednesday Feb 20th, 2013 at 9:11 am #42578

Ooops – a little off topic but not really
We are creating a membership site and selling access to lessons which are in actually pages The documentation says

“Specific Post/Page Access works independently from Member Level Access. That is, you can sell an unlimited number of Posts/Pages using “Buy Now” Buttons, and your Customers will NOT be required to have a Membership Account with your site in order to receive access. If they are already a Member, that’s fine, but they won’t need to be. In other words, Customers will NOT need to login…”

Does this mean that the purchases you sent shortcode for tracking will not be included? That is, that these specific Post/Page Access purchases are not associated with the user/member in the database?

Posted: Wednesday Feb 20th, 2013 at 11:55 pm #42640
Bruce
Username: Bruce
Staff Member

Does this mean that the purchases you sent shortcode for tracking will not be included? That is, that these specific Post/Page Access purchases are not associated with the user/member in the database?

That’s correct. Specific Post/Page Access is completely separate form s2Member Level/Capability restrictions. You do not need a User account for these.

Posted: Thursday Feb 21st, 2013 at 2:28 am #42660
Staff Member

What Bruce just said is correct. However, if an existing User/Member makes a Specific Post/Page purchase; s2Member® will keep a record of that on file. This is how the Shortcode example that I posted previously is possible. s2Member keeps a list of references of here.

$references = get_user_option('s2member_sp_references');
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.