Uneditable calculated custom field in Member Profile & On Membership Card

  • Gary Bartlett
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
3 months 3 weeks ago #136692 by Gary Bartlett
(This is related to Unique Code based on User Id (68628) ).

I have added a custom field (IP Licence - ip_licence) to the Field Manager and made it invisible on the subscription form, but visible (uneditable) on the Profile. I would like it to be:
  1. Caculated against Membership No & Plan on Plan Subscription (and have the PHP code for doing that).
  2. Displayed on the Member Profile Page and on the Membership Card

What's the best way of doing this?

I am able to generate the IP LIcence code in a K2 Item, using Regular Labs Sourcerer within a K2 Item which generates something like this: P-DW: P001006 dd.2020-08-03.

I have, so far, been unsuccessful in either (a) generating this code as the default value of a custom field or by adding it into a card layout design.

Any ideas on how I can do this elegantly?

My next step would be to investigate putting the code into the registration override file.

Thanks, Tuan!

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

More
3 months 3 weeks ago #136697 by Tuan Pham Ngoc
Hi Gary

I think the easiest way would be using this plugin membershipprodoc.joomservices.com/plugins/script-plugin . That allows you to run PHP code when subscription is stored, or active

The idea is you can put the PHP code (which is used to generate the data you want) there and have it executed

The data for custom fields in Membership Pro is stored in #__osmembership_field_value table. You would have to insert that generated data into that table

Please try to look at it to see if it could work

Tuan

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

  • Gary Bartlett
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
3 months 3 weeks ago #136724 by Gary Bartlett
Thanks, Tuan!

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

More
3 months 3 weeks ago #136729 by Tuan Pham Ngoc
You're welcome. Hope you could come up with a solution for this requirement

Tuan

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