Hi there,

I want to create a site which has premium membership (Gold, silver and bronze) and want users to pay for those memberships.
I have installed commerce_sp on my site but I dont know how to configure it and use it.

I am not getting any subscription product on my product types. :(

Someone please help.

CommentFileSizeAuthor
#16 subscription_end.jpg100.39 KBbeatriz77
#11 SubscriptionRule.jpg186.72 KBedboost
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

huah’s picture

Same question.

kerios83’s picture

mofdi2’s picture

No solution in this link !!

mediapal’s picture

Thats the problem with so many modules here. No documentation or at least a how to get start. Its frustrating

ohthehugemanatee’s picture

Component: Code » Documentation

Install the module. You should get a new product type in Drupal Commerce, called "Subscription". Each Subscription has an SKU, title, and duration. Check that out and maybe create a couple of Subscription products for sale in your store.

With Rules UI module enabled, go to Admin > Config > System > Workflow > Rules > Rules Components . 90% of what this module does is in Rules configurations, so you can get in and tweak whatever behavior you want... but normally all you want to do is change what happens when a subscription starts or ends. This could be anything at all, but the default is nothing. In Rules components, look for the Rulesets called "Subscription Start" and "Subscription End". Edit those rulesets and customize what should happen when subscriptions start and end.... in my case, I set "add a role" and "remove a role", respectively.

nigelw’s picture

ohthehugemanatee, what Data selector did you use to apply the role to?

site:current-cart-order:owner

or

site:current-user

bmx269’s picture

Where does the interaction with Paypal recurring payments take place, ie, they cancel the payment on paypal?

marcoka’s picture

RaphaelBriskie’s picture

@nigelwaters when you're typing the data selector select 'User' (only). Selecting anything else does nothing, at least for me anyway.

nigelw’s picture

I am absolutely confused and I am going to cry if i can't get this to work. :(

Can someone please give me a step by step on how I would add a role to a user when subscription starts and remove a role when a subscription ends (for the sake of the example, just use the administrator role)?

I really need my hand held on this. :(

edboost’s picture

FileSize
186.72 KB

I don't fully understand how everything is working (so I can't say that this is the BEST way to configure) -- and until I can test more, I'm not sure that subscriptions are expiring properly BUT I have finally gotten this to work on our site.

  1. Create new products (using Subscription Products).
  2. Create product displays for those products.
  3. Go to Configuration>Rules
  4. Find the Rule called "Subscription Started (update)" and clone it.
  5. Rename the new rule "Subscription Started (purchased)".
  6. Make the Event "Completing the Checkout Process"
  7. Make the Elements "Order contains a particular product" and specify the SKUs of your subscription products.
  8. For Actions, I left "rule set: Subscription start" with parameter as "User:[commerce-order:owener] and "Schedule component evaluation" as is and added "Add user role" with Parameter: User:[commerce-order:owener] and Roles: my subscriber role.

Screenshot of details attached.

None of this worked until I changed the weight of this rule (by opening the settings option set at the bottom of the rule), so that it's evaluated first (in my case that just meant making the weight -1). I think that rule order has been one of my big problems all along. Now it seems to be working.

Hopefully if this doesn't solve your problems, it at least gives you a start.

Good luck!

likewhoa’s picture

Title: How to use Comerce SP? :( Newbie here » How to use Commerce SP? :( Newbie here
Status: Active » Fixed

@edboost why over complicate things with a clone of "Subscription Started (update)" when all you need to do is:

  1. Edit both "Subscription started (insert)" & "Subscription started (update)" and In both under "Actions" add "Add user role" then select the user role to assign to new orders. i.e subscribers
  2. Edit "End subscription when validity is unset" and add "Remove user role" and select the role to remove when a subscription ends.

TIP: in "End subscription when validity is unset" add a new action that sends an email to the user notifying him/her that their subscription has expire and link them back to the website to buy more subscription ;)

I think this issue should be closed as there are several guides here already explaining the whole process. Good luck to all. PM me if you need further assistance.

edboost’s picture

@likewhoa: not trying to make anything too complicated. I just wasn't sure what the intended use case was for "insert" and "update" and didn't want to override them if I might want them later. When I'm unsure I tend to err on the conservative side.

Thanks for the tip on the email notification - I hadn't thought of that.

And, I'm wondering if I missed whatever guide(s) you're referring to. I've spent a lot of time on this, poring over e-amina's flowcharts and everyone else's info and have really struggled to get this to work (although I am by no means a Drupal expert, I did have this functionality working with Ubercart and have several other Rules actions working).

I feel like I'm feeling my way blindly through an excellent but undocumented module. Do you mind linking to the guide you recommend?

Thanks!

likewhoa’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

beatriz77’s picture

FileSize
100.39 KB

@likewhoa
Hello,
i did exactly what you're writting, but subscriptions end doesn't work(the role is still on and the date of the validity subscription is always visible).

here a copy of my rule, thanks so much in advance

Outdoor Ed’s picture

I have commerce_sp up and running and have applied the rule. I actually have 3 membership levels basic, standard and premium granting Role Basic, Standard or Premium. What's the best way to do this in Rules? With my limited experience in Rules I would just create one Rule for each SKU-->Role.

Or is it possible to create a Loop in a Component that looks at each SKU and then somehow apply the result to the correct Role?

Here's my 1 SKU--> 1 Role rule

{ "rules_commerce_sp_subscription_started_insert" : {
"LABEL" : "Subscription started (insert)",
"PLUGIN" : "reaction rule",
"TAGS" : [ "commerce_sp" ],
"REQUIRES" : [ "rules", "commerce_order" ],
"ON" : [ "user_insert" ],
"IF" : [
{ "NOT data_is_empty" : { "data" : [ "account:field-commerce-sp-validity" ] } },
{ "commerce_order_contains_product" : {
"commerce_order" : [ "site:current-cart-order" ],
"product_id" : "SUB-CompanyProfile-Premium",
"operator" : "\u003E=",
"value" : "1"
}
}
],
"DO" : [
{ "component_rules_commerce_sp_subscription_start" : { "user" : [ "account" ] } },
{ "component_rules_commerce_sp_schedule_subscription_expiration" : { "account" : [ "account" ] } },
{ "user_add_role" : {
"account" : [ "site:current-user" ],
"roles" : { "value" : { "323" : "323" } }
}
}
]
}
}

likewhoa’s picture

Version: 7.x-1.1 » 7.x-2.x-dev

sorry guys but if you can't get working my basic howto, i can only provide paid support as my time is money these days.

mrconnerton’s picture

Title: How to use Commerce SP? :( Newbie here » How to use Commerce SP?
Assigned: mrcool03988 » Unassigned
Status: Closed (fixed) » Closed (duplicate)

The problem with a module like this is that it provides a lot less "functionality" and a heck of a lot more default configuration that the end user will have to change on their own.

The first thing I suggest anyone trying to get this to work, especially with this post being as old as it is, is to first backup your site, then completely disable and uninstall commerce_sp module and download the latest 2.x-dev version and required modules/versions. There have been some rules updates and weight changes that were causing people issues. Once you do this, the basics outlined in #12 pretty much apply. Edit the start/insert/update rules and have it do what you want. If you are not familer with the rules module then you must stop and watch a video on rules such as http://dev.nodeone.se/node/634 as the expected functionality of this module is driven by rules. You cannot use this module if you can't use rules.

I am working on this module a lot at the moment and trying to figure out the best way to accomodate some of the major feature requests (role subscriptions, multiple teirs, etc) while still keeping the module maintainble and upgradeable. I am working on a basic patch right now that lets you pick the role to add/remove via role reference on the subscription product. That way for the very basic usage you can just turn it on and run with it.

Finally marking this a duplicate of #1372450: Please provide a basic HOWTO for this

Hadi Farnoud’s picture

thank you. #5 was enough for me to learn how it works :)

pinkonomy’s picture

Issue summary: View changes

@Hadi Fardnoud: I followed instructions of #5 but still cannot make it work.
I added a role when Subscriptions starts but the role is not assigned after buying a subscription.
Also the Subscription date on user account is not updated.
Am I missing something?
Sokratis

Hadi Farnoud’s picture

not sure pinkonomy. might have done a few more steps. but, for the most part #5 was what I did.