Skip to Content Skip to Menu

Prevent cb auto action execution depending on cb sub plan id

  • startup
  • startup
  • OFFLINE
  • Posts: 113
  • Thanks: 7
  • Karma: 1
  • Add-ons
8 years 2 months ago #284721 by startup
Hello!

We do have a CB auto action (onPrepareMenus) which adds a cb menu item to menu bar (Type: field)
Is it possible that this auto action gets only triggered if the user has a certain cb subs subscription plan?
We do not want to add this item for all users. Is this somehow possible by setting up the conditions tab or any other way?

Our dev-environment:
CB Subs 4.1.0
CB 2.0.14
Joomla 3.6.2
CB Auto Action 6.3.5

Best regards
Frank

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48424
  • Thanks: 8274
  • Karma: 1443
8 years 2 months ago - 8 years 2 months ago #284728 by krileon
Yup, ensure you've latest CB and CBSubs builds installed. Then within your action under Parameters set "Content Plugins" to "Yes". Now you can use the below new CBSubs content.prepare usage in your conditions for your action.

www.joomlapolis.com/news/18550-cbsubs-gpl-4-1-with-timed-content-taxes-inclusive-price-display-and-plan-substitutions-usable-anywhere

So for example you could have the below condition.

[cbsubs:if plan="1" status="A"]ACTIVE[/cbsubs:if] Equal To ACTIVE

This means if the plan with an id of 1 is actively subscribed the action should fire. However for that trigger the user object is most likely going to be the user displayed and not the user viewing the profile. If you need to condition against the viewer ensure you've set the User parameter to User under the Global tab of your action.


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.
Last edit: 8 years 2 months ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum