CB Subs question

7 years 10 months ago #282458 by degierd
CB Subs question was created by degierd
Is it possible to change a field value when a certain subscription was paid for by the user? For example the following scenario:

Subscription plan 1 = set field picture = 1
Subscription plan 20 = set field picture = 20

Then display a different small picture on top of the canvas picture according to the field picture value (if field picture = 1 show picture1.jpg, if field picture = 20 show picture20.jpg etc)

Several questions to get me started:

1) How to set the field?
2) How to include that field (hidden) to the profile
3) How to use CSS (or javascript) to display a different picture according to the field value.

Hope my scenario is clear and easy to answer :-)

Please Log in to join the conversation.

7 years 10 months ago #282476 by krileon
Replied by krileon on topic CB Subs question

1) How to set the field?

You can use CBSubs Fields integration to do this or CB Auto Actions and its Field action.

2) How to include that field (hidden) to the profile

CBSubs Fields Tabs Protection can show/hide fields/tabs based off subscription.

3) How to use CSS (or javascript) to display a different picture according to the field value.

I wouldn't do it that way. I wouldn't even store a picture. I'd use the below substitution usage in a Custom HTML field with content prepare enabled under Parameters of the field. Note you should have latest CBSubs 4.x nightly installed for this to work best.


[cbsubs:if plan="1" status="A"]<img src="/images/picture1.png" />[/cbsubs:if]
[cbsubs:if plan="20" status="A"]<img src="/images/picture20.png" />[/cbsubs:if]

See the below for more usage information on CBSubs content prepare substitutions.

www.joomlapolis.com/news/18550-cbsubs-gpl-41-content-control-everywhere

What CSS you use to position the image output by the field is entirely up to you though as we do not provide specific custom coding like that here.


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: degierd

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.211 seconds