I think this can be done by creating a view block with an argument from the URL. But if a user can easily attach a block with "Purchase subscription to this group" button to the group of concern, that will increase the usability a lot, I think.
I think this can be done by creating a view block with an argument from the URL. But if a user can easily attach a block with "Purchase subscription to this group" button to the group of concern, that will increase the usability a lot, I think.
Comments
Comment #1
aiwata55 commentedMaybe impossible even by manipulating Views?
I am not a Views expert, so I may be wrong, but I couldn't figure out how to show a "Buy subscription now" button in a block for the current group when a user doesn't have a membership for the current group. Maybe Ubercart Organic Group Subscrive module needs to provide argument(s) in order to interact with Views?
If there is a proper way to achieve this, please kindly let me know.
Comment #2
aiwata55 commentedI think I found a maneuver. Just in case there are those who face the same needs, I would like to share my solution.
global $account; $node = node_load(arg(1)); if (!og_is_group_member($node, FALSE, $account->uid)) { return $node->nid; }The PHP code checks if the user has already subscribed to the current group, and if not then passes the node ID as an argument. Views filters nodes whose SKU field matches the argument (which is the node ID). Therefore only the corresponding subscription product will be presented in the block.
Hope this is useful.