Skip to Content Skip to Menu

Printable Membership Card?

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 501
  • Thanks: 33
  • Karma: 6
3 years 10 months ago - 3 years 10 months ago #322741 by AlexRag
Replied by AlexRag on topic Printable Membership Card?
That is once again, awesome! CB is full of integrations!

I was wondering about were these two:
  • [cbsubs:subscriptions plan="PLAN_ID_HERE" output="expiry_date" /]
  • [cbsubs:plans plan="PLAN_ID_HERE" output="name" /]

1. Is there a way to instead indicate the PLAN_ID, have CBSubs know which one they are in to display ? The idea is I want to dynamically add the plan they are on in the article where the member card will be available.

2. I noticed the expiry date does not show up. Id it because the plan is set up with a specific expiry date annually? For example is set ups as $xx per one calendar year starting 1 July

I know I can just add the date in manually but I would have to remember to change it every year.
[hr]
For the avatar, what would be the best way to control the size it displays on the page?
[hr]
I also realized when creating the member card using HMTL that anyone can use the Inspect feature of browser to change the substituted info which means they can print cards with any name. This bring me back to seeing how to output an image file of the card so the data is baked in. For now the simple way will do.
Last edit: 3 years 10 months ago by AlexRag.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 10 months ago #322747 by krileon
Replied by krileon on topic Printable Membership Card?

1. Is there a way to instead indicate the PLAN_ID, have CBSubs know which one they are in to display ? The idea is I want to dynamically add the plan they are on in the article where the member card will be available.

No, you'd need to use the IF substitutions to check if they had the plan first and do this for each of your plans. Example as follows.

[cbsubs:if plan="PLAN_ID_HERE"]
[cbsubs:subscriptions plan="PLAN_ID_HERE" output="expiry_date" /]
[cbsubs:plans plan="PLAN_ID_HERE" output="name" /]
[/cbsubs:if]

That should only show the name and expiry date if they're actually actively subscribed to the specified plan id.

2. I noticed the expiry date does not show up. Id it because the plan is set up with a specific expiry date annually? For example is set ups as $xx per one calendar year starting 1 July

It should show up fine as it just shows whatever the expiry date is for their subscription row. Please be sure you're using "cbsubs:subscriptions" for expiry date output and not "cbsubs:plans".

For the avatar, what would be the best way to control the size it displays on the page?

CSS


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.

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 501
  • Thanks: 33
  • Karma: 6
3 years 10 months ago #322764 by AlexRag
Replied by AlexRag on topic Printable Membership Card?
Thanks again! I read up the link you sent and saw the elseif options. I wanted to nest the statements thinking it would helps with spacing of the output data. For example the 3rd plan appears lower on the page (in a Joomla article) for some reason. This is the nested code I put together

[cbsubs:if plan="2"]
[cbsubs:subscriptions plan="2" output="expiry_date" /]
[cbsubs:plans plan="2" output="name" /]
[/cbsubs:if]

[cbsubs:if plan="1"]
[cbsubs:subscriptions plan="1" output="expiry_date" /]
[cbsubs:plans plan="1" output="name" /]

[cbsubs:elseif plan="2"]
[cbsubs:subscriptions plan="2" output="expiry_date" /]
[cbsubs:plans plan="2" output="name" /]

cbsubs:elseif plan="3"]
[cbsubs:subscriptions plan="3" output="expiry_date" /]
[cbsubs:plans plan="3" output="name" /]

[/cb:elseif]
[/cbsubs:if]

But that still create blanks lines. The solution ended up being to just put the substitution code all on one line:

[cbsubs:if plan="1"] [cbsubs:subscriptions plan="1" output="expiry_date" /] [cbsubs:plans plan="1" output="name" /] [/cbsubs:if] [cbsubs:if plan="2"] [cbsubs:subscriptions plan="2" output="expiry_date" /] [cbsubs:plans plan="2" output="name" /] [/cbsubs:if] [cbsubs:if plan="3"] [cbsubs:subscriptions plan="1" output="expiry_date" /] [cbsubs:plans plan="3" output="name" /] [/cbsubs:if]

Not sure that's the best solutions, but it seems to work (unless I want to have the expiry date and plan name on separate lines). :huh:

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 10 months ago #322770 by krileon
Replied by krileon on topic Printable Membership Card?
Blank lines are probably due to the default behavior of the WYSIWYG editor using paragraph elements for blank lines. We don't have any control over that and would need to be adjusted in the WYSIWYG editors settings in Extensions > Plugins.


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.

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 501
  • Thanks: 33
  • Karma: 6
3 years 10 months ago #322786 by AlexRag
Replied by AlexRag on topic Printable Membership Card?
That makes sense. Putting the substitution code all one line worked as it was in one <p> tag.


Another thought just occurred to me as to a better place to put the membership card for users to print: At the bottom of the invoice since there is a print prompt there too.

I tested the code below but it doesn't work when I place it in the footer or even the "Terms and Conditions section". Is adding this something feasible, where more substitutions could be added to the list already there?

The substitutions that don't seem to be there are:
- Plan name, without the user name that the [ITEMS_NAME] adds. (Mind you it would need to cycle through which plan should display)
- Expiry date

The only thing that could cause a roadblock is if the user added other items like donation or products to the purchase besides a member plan. Hence, the earlier block of substitution code being useful.

Actually. even just the expiry date would work help.

Anyways, just a thought or two.

Thanks!

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

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 501
  • Thanks: 33
  • Karma: 6
3 years 10 months ago #322787 by AlexRag
Replied by AlexRag on topic Printable Membership Card?

Another thought just occurred to me as to a better place to put the membership card for users to print: At the bottom of the invoice since there is a print prompt there too.

I tested the code below but it doesn't work when I place it in the footer or even the "Terms and Conditions section". Is adding this something feasible, where more substitutions could be added to the list already there?

The substitutions that don't seem to be there are:
- Plan name, without the user name that the [ITEMS_NAME] adds. (Mind you it would need to cycle through which plan should display)
- Expiry date

The only thing that could cause a roadblock is if the user added other items like donation or products to the purchase besides a member plan. Hence, the earlier block of substitution code being useful.


Update: After some more testing, I have come to realize my suggestion won't help for users who were added as part of the family plan plugin. Those users do not have access to the printable invoice so adding a "membership card" to it doesn't make sense.

That said, I would like to add the "expiry date" to the invoice just the same. :)

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

Moderators: beatnantkrileon
Powered by Kunena Forum