Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 25th)
🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

Donation plan image

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
7 months 1 day ago #338166 by galanopd
Donation plan image was created by galanopd
A donation plan is not equivalent to a membership plan with a defined duration, such as one year, which then expires. Instead, it is a one-time contribution, correct?

Even for a donation plan, there is typically an associated plan image that I can upload, presumably for a specific purpose, like to be visible somewhere. What I need is to display this plan image on the donor's profile for a certain period as a gesture of appreciation. This way, the user who made the donation will be recognized as a supporter to other users. But I don't have that option...

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
7 months 1 day ago #338173 by krileon
Replied by krileon on topic Donation plan image

A donation plan is not equivalent to a membership plan with a defined duration, such as one year, which then expires. Instead, it is a one-time contribution, correct?

Correct, donations have no subscription status or duration of any kind.

Even for a donation plan, there is typically an associated plan image that I can upload, presumably for a specific purpose, like to be visible somewhere. What I need is to display this plan image on the donor's profile for a certain period as a gesture of appreciation. This way, the user who made the donation will be recognized as a supporter to other users. But I don't have that option...

Only subscriptions can have plan images. As it's dependent on subscription status.

The best I can suggest is to set a field using CBSubs Fields when the user donates. Ideally you'd use a datetime field. So lets call it cb_lastdonation for example. You'd then set this field to the datetime they donated. Now you can display it like any datetime field on profile as well as use it in CB Conditional for conditioning, CB Auto Actions for conditioning, or even substitutions for displaying or conditioning additional content such as an image of some sort. Alternatively you could query for their donation datetime using CB Query Field if you don't need a stored field then use it similarly.


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 or Create an account to join the conversation.

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
6 months 4 weeks ago #338188 by galanopd
Replied by galanopd on topic Donation plan image

The best I can suggest is to set a field using CBSubs Fields when the user donates. Ideally you'd use a datetime field. So lets call it cb_lastdonation for example. You'd then set this field to the datetime they donated.

How can I set the datetime field to update when the donation plan activates? From within the Plan->Integrations->CB Fields somehow?

Alternatively you could query for their donation datetime using CB Query Field if you don't need a stored field then use it similarly.

I need this to be a stored field as it would give valuable information for the user, e.g. how many times a user has donated, etc.

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

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
6 months 3 weeks ago - 6 months 3 weeks ago #338190 by galanopd
Replied by galanopd on topic Donation plan image
I just realized that the donation plan image isn't showing up on the profile because I hadn't selected it in the Plan Image field! Once it's selected, the donation plan image appears as expected. Now, my question is: can I somehow set the field to display the donation plan image only for a certain period of time? Maybe condition the field somehow but only for the specific image? Just guessing...
Because, since the image is shown when the user donates and there is no specific period for the "donation subscription" to end, the image will remain visible for ever!

Thanks

Edit: Test it and it makes no sense to use something like this in the conditional as it hides the whole field:

Hide if
Code:
$planAlias = 'don_plan'; if ($planAlias === 'don_plan') {     $dateDiff = \CBLib\Application\Application::Date('now')->diff('[cbsubs:subscriptions user="#displayed" plan="49" output="signup_date" /]');     if (!$dateDiff) {         return 0;     }     return $dateDiff->days; }

>90
Last edit: 6 months 3 weeks ago by galanopd.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
6 months 3 weeks ago #338195 by krileon
Replied by krileon on topic Donation plan image
There's no duration for donations so yes the image will just show forever. Your condition approach is probably the best option, but you'll have to use more than 1 plan image field so the other plan images don't get hidden then under the Display tab you can select for the conditioned plan image field to only show that donation plan.

I suppose another possible option is to effectively create your own plan image field using HTML and substitutions. In a Custom HTML field you could use CBSubs IF substitutions to condition images to show/hide based off subscription status. Example as follows.
Code:
[cbsubs:if plan="1" status="A"] PLAN_1_IMAGE_HERE [/cbsubs:if] [cbsubs:if plan="2" status="A"] PLAN_2_IMAGE_HERE [/cbsubs:if]

See the description of the CBSubs Joomla system plugin for further CBSubs IF substitution usage information. Be sure your Custom HTML field has content plugins enabled under its parameters though or these won't work. This should give you more control over exactly what and when something displays.


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

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

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
6 months 3 weeks ago #338204 by galanopd
Replied by galanopd on topic Donation plan image
I have finally solved it using one more image_field and it seems to be working as expected now, thanks.
One more thing I noticed is that when hovering over the plan images, there is no alt text or title displayed. Is there a setting somewhere to change this behavior? I believe this is an important accessibility feature.

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

Moderators: beatnantkrileon
Powered by Kunena Forum