Home › Forums › Community Forum › Pay per Post Counter?
This topic contains 10 replies, has 2 voices. Last updated by Cristián Lávaque 3 years, 10 months ago.
| Topic Author | Topic |
|---|---|
| Posted: Monday Mar 4th, 2013 at 1:48 pm #43715 | |
|
|
|
|
Is there a custom field that is possibly generated that tracks the number of times a post is purchased using the pay-per-post option? I.e. everytime someone buys access to the post, a key such as s2_post_times_bought is +1, so it could then be displayed on the post to encourage other people to buy? So I can say “This post has been bought XYZ times already!” If not, this would be a great yet simple feature to add, really adding to the marketing value of the pay per post option. Who has been to the Envato marketplace and felt more confident buying an item after seeing it had 100+ (or even thousands) of sales already? I know I have. |
|
List Of Topic Replies
| Author | Replies |
|---|---|
| Author | Replies |
| Posted: Wednesday Mar 6th, 2013 at 6:36 am #43858 | |
|
|
|
|
No, s2Member doesn’t have that. You could probably track it with Google Analytics or similar, though. Knowledge Base » Google® Analytics ECommerce Tracking I hope that helps. :) |
|
| Posted: Wednesday Mar 6th, 2013 at 10:32 am #43878 | |
|
|
|
|
Can I request that as a feature? You see how awesome that would be right? Just like the envato marketplaces…. Imagine if you had a page that said it was purchased 4,000 times already… People would like it. I’m trying to think how else I could do this. Adding some php to add it into the protected content I suppose? |
|
| Posted: Friday Mar 8th, 2013 at 3:35 am #44033 | |
|
|
|
|
I had an idea for the above which is to add a URL to the post/page access that would update a custom field. Now, my new question regarding this: is there anyway to combine two ideas: – User must be registered, so a free member. Thanks for the assistance. |
|
| Posted: Friday Mar 8th, 2013 at 8:28 am #44076 | |
|
|
|
I wrote it down in the feature requests. :)
I’m not sure I understand what you’re asking. Could you explain it a bit more, please? Thanks. :) |
|
| Posted: Friday Mar 8th, 2013 at 6:34 pm #44131 | |
|
|
|
|
Sorry Cristian, that post was done late at night after a long day’s work…. I am basically trying to add tracking for the buy now posts and here’s what I’ve come up with. For the code to be triggered after someone is brought back to the post from PayPal, for a Pay-per-Post transaction, I have come up with this: – grab a post_purchase_count meta key from post purchased, add 1 to it, then resubmit to post data. Then, create a separate template page that will check for the logged in user, check the user_ppp_access key for any post_id values, then use those post_id values to populate a list of “Purchased Posts”. Then, on the template for displaying theses posts, I’ll add a conditional that checks a) if user is logged in and b) if user has the specific posts ID in their user_ppp_access key. If both are true, it will display content. I won’t need to rely on s2 hiding the content or protecting the whole URL (I wanted the URL accessible anyways), just using conditional and meta checks which is all part of WP core. Just using s2 for the ability to become a member and make the paypal purchase. I realize I am typing “how I’m thinking” but I thought I’d write this out as a sort of code idea for anyone who is wanting to accomplish the same thing. My other idea is to also incorporate, again via WP conditionals, a way for someone to have either a premium subscription or have purchased the post to view the content. Not so difficult as long as s2 properly writes the meta values after a successful purchase. |
|
| Posted: Tuesday Mar 12th, 2013 at 2:45 am #44331 | |
|
|
|
|
Ah, thanks for explaining it. Yeah, your approach seems good. :) I’d use custom capabilities for each post, and conditionals will work great to hide just the content. With a bit more work on the conditionals you can certainly sell the posts individually or packaged in a subscription. |
|
| Posted: Tuesday Mar 12th, 2013 at 3:18 am #44336 | |
|
|
|
|
Yes, but for custom capabilities in s2… Isn’t that going off of user role capabilities? So after 1,000 posts, I’d have 1,000 additional user role capabilities added to my WP database? Or are the custom capabilities you speak of built into S2 only and can be created on the fly on the create post screen? If they can be created on the fly via that box in the create post screen, that is also a good implementation. Please let me know if that’s the case. If that’s true, then you could write a custom capability like “post-123” the in field… then add some PHP into the template to buy the CC, and check user for CC to display. I suppose that’s true even the capability is created as part of WP-core.. it just seems like user role capabilities shouldn’t be added in the thousands and reserved for actual capabilities like posting in a forum, etc. Sorry, again my posts aren’t making sense. |
|
| Posted: Tuesday Mar 12th, 2013 at 10:21 am #44358 | |
|
|
|
You can add the ccap protection in the post with s2Member’s metabox. Or you can add conditionals to the content itself.
Right.
The custom capabilities are added to the user’s account, not to a role. This video should help: Video » s2Member (Custom Capabilities) |
|
| Posted: Tuesday Mar 12th, 2013 at 11:31 pm #44445 | |
|
|
|
|
Okay, I think i’ll integrate that with the Custom capabilities. Lastly, I think I think I can streamline this more with some custom fields. I think I will create a “Pay Per Post Settings” meta box where I can supply the price and a checkbox on whether or not to make it pay per post (still using custom cap). Then, in the template file, do a meta check for the checkbox, and if it’s true, then use the price I entered. Then, for the CC for the paypal button, I’ll simply make it unform soe something like “ppp_*post-id*”. Then, the user can purchase the CC through the PayPal button. The template will show content if current_user_can. Then for the tracking feature, write some PHP to remove “post-” from the meta field, and add that to a user meta comma delimited value. When the user checks a custom page for the purchased posts, it will grab all the IDs, then query the posts according to those IDs and display the titles with permalinks. Sweet. :) Hopefully it all runs smoothly. |
|
| Posted: Thursday Mar 14th, 2013 at 9:26 am #44605 | |
|
|
|
|
Cool. Let us know how it goes. :) |
|
This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.








Pre-Sale FAQs
Video Tutorials
Community Forum
Knowledge Base
News/Updates
s2 Codex / Docs
GPL v2 License
Contact A Human
About Us
Our Customers
Support Policy
Privacy Policy
