Skip to Content Skip to Menu

CBSubs & CB Auto Action issue

10 years 7 months ago #244256 by webweaver.be
CBSubs & CB Auto Action issue was created by webweaver.be
We have defined an Auto Action to redirect the user to the profile page before selecting a membership plan if a certain field is not filled in.

Triggers used: onCPayAfterPlanSelected,onCPayAfterPlanRenewalSelected,onCPayBeforeStorePaymentBasketUpdated
User field is set to automatic

This works nicely on the frontend. However, when an administrator selects the plan for a user in the backoffice (because they paid outside of the system), they are always redirected, even though the specified field is filled in. It is therefor impossible for the administrators to subscribe the user to the selected membership plan.

CBSubs 3.0.0
Joomla 3.2.3
CB 1.9.1

Could you please investigate this?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
10 years 7 months ago #244266 by krileon
Replied by krileon on topic CBSubs & CB Auto Action issue
You're using the triggers and the action too globally. Those triggers all fire on frontend and backend. They also may or may not have a user object at the time they fire. You need to be more specific with your action usage so there won't be issues. Action usage needs to be carefully configured based off specific needs and tested thoroughly so it only applies to the scope you want it to. It helps to also search source code for where a trigger is located so its usage can be observed further.

The onCPayAfterPlanSelected trigger has no user object. So it's always trying to check against an empty user object or it somehow is pulling one from an ID found in one of the variables, but it won't be accurate. I suggest setting "User" parameter to "User" so it always uses the viewing users user object for substitutions and your conditionals will always apply to the viewing user. Aside from that it's trial and error until you've the desired usage. There's no bug or anything of the sort in CB Auto Actions or CBSubs regarding this though.


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.
The following user(s) said Thank You: webweaver.be

Please Log in or Create an account to join the conversation.

10 years 7 months ago #244275 by webweaver.be
Replied by webweaver.be on topic CBSubs & CB Auto Action issue
OK, thank you for your feedback. We'll investigate this further.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum