I'm using the membership entity module, and the membership entity commerce module.
I am trying to create a membership using rules, without success yet.
There is one membership action available..to activate the membership but thats all.
EDIT: This is the rule I used for checking out a membership:
{ "rules_at_listing_import_create_user_and_membership" : {
"LABEL" : "At listing import create user and membership",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [
"rules",
"commerce_cart",
"commerce_checkout",
"membership_entity_commerce",
"feeds"
],
"ON" : { "feeds_import_listing_import" : [] },
"DO" : [
{ "entity_create" : {
"USING" : {
"type" : "user",
"param_name" : "[node:field-first-name][node:field-last-name]",
"param_mail" : [ "node:field-user-email" ]
},
"PROVIDE" : { "entity_created" : { "user_created" : "Created user" } }
}
},
{ "user_unblock" : { "account" : [ "user-created" ] } },
{ "entity_save" : { "data" : [ "user-created" ], "immediate" : "1" } },
{ "commerce_cart_product_add_by_sku" : {
"USING" : {
"user" : [ "user-created" ],
"sku" : "Listingmember-1y",
"quantity" : "1",
"combine" : "1"
},
"PROVIDE" : { "product_add_line_item" : { "product_add_line_item" : "Added product line item" } }
}
},
{ "commerce_checkout_complete" : { "commerce_order" : [ "product-add-line-item:order" ] } },
{ "membership_entity_commerce_activate_term" : { "commerce_order" : [ "product-add-line-item:order" ] } }
]
}
}
Using this rule, I assume that the membership is created automatically because of the membership product being checked out.
Alternatively, I tried the method without using the membership product, by straight away creating an entity of type membership using rules. That does not work, the membership is not created.