Custom fields and Field Assignment

More
1 day 22 hours ago #171638 by Bouey
Custom fields and Field Assignment was created by Bouey
Hi,

I have a custom fields and it's assigne to "All selected plan" , i choose a plan (ex plan A)

i have a user who has 2 subscriptions
Plan A (active)
Plan B (Expired)

On the profile information of the user i don't see this custom fields, i can only see it if i select for the field "All plan"

It's the 4.2.0 version , i have just renew my subscription

Stéphane
 

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

More
1 day 21 hours ago #171639 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields and Field Assignment
Hi Stéphane

Unfortunately, that's how the extension is designed to work. For profile page, we can only show the fields which are assigned to all plans

I will think to see if I can update code in the future to show field from the latest active plan. But for the time being, It is not possible

Regards,

Tuan

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

More
1 day 21 hours ago #171640 by Bouey
Replied by Bouey on topic Custom fields and Field Assignment
Thanks Tuan for the quick reply

and in the profile page it's possible to display user custom fields (not depending of a plan in this case), i think it's a better way to make it

Stéphane

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

More
1 day 11 hours ago #171643 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields and Field Assignment
Mean you want to display fields from all plans you want?

It is quite hard, so I could not promise

Tuan

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

More
1 day 5 hours ago #171648 by Bouey
Replied by Bouey on topic Custom fields and Field Assignment
I will manage it ,
I will set the field for all plans
it can be good on the profile page to display Joomla default custom fields, it's perhaps possible but i haven't see it

Stéphane

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

More
1 day 5 hours ago #171649 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields and Field Assignment
No, Membership Pro can only display fields it manage, it cannot display fields managed by Joomla users management (no reason for it to do that)

So if you need it, I guess you will need to perform some customization to the code

Regards,

Tuan

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

More
1 day 4 hours ago #171650 by Bouey
Replied by Bouey on topic Custom fields and Field Assignment
Ok, i manage to make it with an override of the member profile template
my client need to display information of a user not depending of a specific subscription (the subscription are done manually)
Code:
$user = Factory::getUser($item->user_id); $customFields = FieldsHelper::getFields('com_users.user', $user, true); // Show User custom field foreach ($customFields as $customField) { ?> <tr> <td class="osm-profile-field-title"> <?php echo $customField->title; ?>: </td> <td class="osm-profile-field-value"> <?php echo $customField->value; ?> </td> </tr> <?php }

i put the code here for other

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

More
1 day 4 hours ago #171651 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom fields and Field Assignment
Thanks. Could you please also zip the modified file and upload it here? It would help saving time for users who need it to have to add the code manually

Regards,

Tuan

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

More
1 day 4 hours ago #171652 by Bouey
Replied by Bouey on topic Custom fields and Field Assignment
Here it is need to put in the template folder
\html\com_osmembership\member

this is the first version of the file but work

File Attachment:

File Name: default.zip
File Size:2 KB
  • Please Log in or Create an account to join the conversation.

    More
    1 day 3 hours ago #171653 by Tuan Pham Ngoc
    Replied by Tuan Pham Ngoc on topic Custom fields and Field Assignment
    Great. Thanks for sharing Bouey

    Tuan

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