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.

Email on ccap purchase by existing member?

Home Forums Community Forum Email on ccap purchase by existing member?

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

Topic Author Topic
Posted: Sunday Mar 18th, 2012 at 9:50 pm #8508

Hey guys,

I really hate to nag with support queries so I apologize if I’ve missed any existing tutorials or forum threads on this subject.

I have just about completed building a system based on top of s2Member that works a lot like a full e-comm / shopping system. It’s pretty cool and I’m looking forward to sharing some info on how it works when I’m done. :-)

So, I have a “Products” custom post type, and each new post generates an associated ccap. A buy button is also automatically generated that allows people to purchase that ccap for a once off amount.

However, people are required to be registered (free) and logged in before they can purchase.

After the ccap is purchased, when the person then goes back to the same “Product” post (while logged in) the theme uses conditional checks to replace the sales copy with an s2Member protected download link for that product.

The system is also setup so that after the first purchase the person can continue buying additional products through the site, all also working with the same method of adding ccaps that grant access to specific items.

So the question I have is, is it possible for me to set up an email notification that goes out when an existing user purchases a new ccap?

It can be a stock standard message that doesn’t have to change from purchase to purchase, but is this something I can do?

And secondly, just to double check, when a person hits a buy now button for new ccaps will it add to their existing ccaps rather than overwriting? If not, can you give any advice on ensuring new ccaps are added to the existing ones?

Thanks very much for any help and feedback!

P.S. Loving the new site and forum!!

  • This topic was modified 4 years, 9 months ago by  Kezz Bracey.

List Of Topic Replies

Viewing 7 replies - 1 through 7 (of 7 total)
Author Replies
Author Replies
Posted: Tuesday Mar 20th, 2012 at 1:52 am #8573
Staff Member

Hi Kezz. Thanks for your inquiry.
~ and for the KUDOS!

So the question I have is, is it possible for me to set up an email notification that goes out when an existing user purchases a new ccap?

If you’ve integrated with s2Member’s Independent Custom Capability Buttons, where the Level number in your Shortcode is set to level="*" and ccaps="something,something", an email notification is already processed for this by s2Member :-)

You can learn more about Independent Custom Capabilities here:
Dashboard -› s2Member® -› PayPal® Buttons -› Capability (Buy Now) Buttons

If you’re running s2Member Pro Forms, try this instead please:
Dashboard -› s2Member® -› PayPal® Pro Forms -› Capability (Buy Now) Forms

When an existing User/Member purchases a new Custom Capability, s2Member will just shoot them a quick email that reads something simple like this:

Thank you! You now have access to: Watch Videos

(where “Watch Videos” is what your shortcode desc="" attribute was set to).


This email could be further configured through Filters made available to advanced site owners.

Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )

<?php
add_filter("ws_plugin__s2member_capabilities_email_sbj", "my_capabilities_email_sbj", 10, 2);
function my_capabilities_email_sbj($sbj, $vars = array())
	{
		return "Thank you! Your account has been updated.";
	}

add_filter("ws_plugin__s2member_capabilities_email_msg", "my_capabilities_email_msg", 10, 2);
function my_capabilities_email_msg($msg, $vars = array())
	{
		return "Thank you! You now have access to: ".$vars&#91;"paypal"&#93;&#91;"item_name"&#93;;
	}
?>

I’ll answer your other question momentarily.

Posted: Tuesday Mar 20th, 2012 at 1:55 am #8574
Staff Member

And secondly, just to double check, when a person hits a buy now button for new ccaps will it add to their existing ccaps rather than overwriting? If not, can you give any advice on ensuring new ccaps are added to the existing ones?

Right. s2Member “adds” to any that already exist, by default.

If you wanted to change that, you can tell s2Member to remove any that already exist, and then add new ones that you specify. This is accomplished with ccaps="-all,music,videos", where upon purchase, all existing Custom Capabilities are first removed, and then s2Member will add music & videos.

By default though, this would just add music & videos to any that existing already.

ccaps="music,videos"

See also: Dashboard -› s2Member® -› PayPal® Buttons -› Capability (Buy Now) Buttons
See also: Dashboard -› s2Member® -› PayPal® Pro Forms -› Capability (Buy Now) Forms

Posted: Tuesday Mar 20th, 2012 at 3:26 am #8581

That’s brilliant, thanks Jason!

I’ll add in the filters and that will be my s2Member based shopping system complete.

By the way, I looked at all sorts of shopping cart standalone systems, WP plugins and so on when I first set out to create this online store.

What I found was that I could never create the system I wanted using any of the dedicated shopping apps / plugins out there, and that using the s2Member ccaps system would give me way more power and flexibility with what I could achieve.

You talk in your docs about how powerful ccaps can be, and I’m looking forward to posting in a couple of weeks to show a live example of just how powerful.

Thanks again for an awesome system!

Posted: Tuesday Mar 20th, 2012 at 6:23 am #8595

Great! Looking forward to it. :)

Posted: Tuesday Mar 20th, 2012 at 7:51 pm #8659

Sorry, one more quick question if I may.

Will anything prevent the filters from working if they are included in the theme rather than the must use plugins area?

Thanks!

Posted: Tuesday Mar 20th, 2012 at 8:24 pm #8668

Jason will be able to give a more definitive answer, but although they’ll come later in the script, they may still be in time for the emails. Best thing would be to test it and see if they still work there.

Posted: Tuesday Mar 27th, 2012 at 7:26 am #9203
Staff Member

Hi Kezz. Thanks for the follow-up! You’re VERY welcome :-)
~ and thanks again for the KUDOS.

Using Hooks/Filters in your theme is just fine. No problem with that. The only time an MU plugin implementation is *required*, is for s2Member’s JS/CSS Filters, as described here:
http://www.s2member.com/faqs/#s2-faqs-stop-loading-css

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