Sharing field values when sharing a family subscription

2 years 4 months ago #327488 by MarlonFungai
Ok on the functionality of sharing the field values from the parent subscriber there are 2 values I want the child subscriber to share with the parent subscriber.

The first is the parent subscribers user group. Parent subscribers are from 1 of 6 user groups (they have other user groups that don't have anything to do with this) and I need the child subscriber to join the parent subscriber's user group. I have created a user group Auto Action that is triggered on familyplans_onBeforeAcceptSharedSub with the intention of creating 1 Auto Action for each of the 6 user groups. I am stuck on getting the parent subscriber's user groups from var1 and adding them as a condition for the Auto Action.

The second is a single select drop down field where I need the child subscriber to share the same value for this drop down. Here I have created a Field Auto Action also triggered on familyplans_onBeforeAcceptSharedSub where I set the value of the drop down. I am struggling with the syntax of getting the value of the parent subscribers drop down.

Please Log in to join the conversation.

2 years 4 months ago #327490 by krileon

I am stuck on getting the parent subscriber's user groups from var1 and adding them as a condition for the Auto Action.

The below should work.

Global
Triggers: familyplans_onAfterAcceptSharedSub
Type: Usergroup
User: Specific
User IDs: [var1_user_id]
Conditions
Field: Usergroups
User: Action User
Operator: Has
Usergroups: SELECT_USERGROUP_HERE
Action
Mode: Add Usergroups
Usergroups: SELECT_USERGROUP_HERE
User: [var2_id]

That should let you condition against the usergroups of the user who owns the subscription and add usergroups to the user who is accepting the subscription.

The second is a single select drop down field where I need the child subscriber to share the same value for this drop down. Here I have created a Field Auto Action also triggered on familyplans_onBeforeAcceptSharedSub where I set the value of the drop down. I am struggling with the syntax of getting the value of the parent subscribers drop down.

So you want to copy the field value of the subscription owner to the person accepting the subscription? Ok, the above should work for that as well with some adjustments as follows.

Global
Triggers: familyplans_onAfterAcceptSharedSub
Type: Field
User: Specific
User IDs: [var1_user_id]
Action
Field: SELECT_FIELD_HERE
Operator: Set
Value: [cb:userdata field="FIELD_NAME" user="[var1_user_id]" /]
User: [var2_id]

Replace FIELD_NAME with the name of the field you want to copy to SELECT_FIELD_HERE of the user accepting the shared subscription.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 4 months ago #327503 by MarlonFungai
I configured both and they didn't work but I think there is a deeper problem. The actions didn't even fire. I checked the System Auto Actions Plugin it is public and enabled. There are no conditions on one of the auto actions so at the very least it should have fired and have 1 use but it is still on 0. I don't know what I am doing wrong.

Please Log in to join the conversation.

2 years 4 months ago #327509 by krileon
Uses do not tick up unless it's configured to have use limits.

Enable debug mode and maximum error reporting in Joomla global configuration then under Parameters of your auto action enable debug mode. Next retry and see if any errors output.

The above is just an example. I did not test it, but assuming the configuration was followed exactly it should work based off the available trigger variables.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 4 months ago #327524 by MarlonFungai
I can't see any auto actions activity in the debug what am I looking for? I have attached a copy of the output.

File Attachment:

File Name: index.php.txt
File Size:42 KB
Attachments:

Please Log in to join the conversation.

2 years 4 months ago #327526 by MarlonFungai
I managed to get this

Error

:: Action 100 :: Layout code failed. Error: syntax error, unexpected ''

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.258 seconds

Facebook Twitter LinkedIn