#476 How to add a message to customer profile page?

Posted in ‘Technical Support / Bugs’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Olivier on Tuesday, 30 September 2025 14:30 UTC

Antonio Cornacchia

Hello

is it possibile to add a message to the customer profile page? I need to add a simple text editable by me as admin.

Regards

Olivier

Hi Antonio,

the best way, I think, is to create a custom html module that you can assign to the 'My profile' menu item that you have created. The position of the module will depend on what the template you are using allows you to do.

You can also create a template override of the page, but in my opinion, it is more maintenance down the road. 

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Antonio Cornacchia

Hi Olivier, thanks for the suggestion but I need to assign a (potentially) different message for every customers, without to create a module for every customers. I also thought about a user extra field that can only be edited by the admin, but I don't know if it's possible to display it on the customer information page.

Olivier

Ok, that sounds very manual intensive, no matter how it will be done...
I suppose one way to do this would be to create a user custom field, get that field in an override of the profile page and show it.

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Antonio Cornacchia

Okay Olivier, I'll try. Which file should I override?
There are no user or profile folders in administrator/components/com_j2store/views.

Antonio Cornacchia

I found it! I prefer to add the custom field in ordersummary.php

please Olivier, can you help me? what code should I add to show an "Example" custom field?

Thanks a lot.

Olivier

Ok, to get custom fields in the override, I would do something like:

$user = Factory::getApplication()->getIdentity();

$jFields = Joomla\Component\Fields\Administrator\Helper\FieldsHelper::getFields('com_users.user', $user, true); // Get all cutom fields of User context for the current user.

foreach($jFields as $jfield) { // make the fields easier to access
    $jFields[$jfield->name] = $jfield;
}

Then it is just a matter to do an echo $jFields['your-custom-field-name']->rawvalue; // or use ->value

to get the value.

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Antonio Cornacchia

Thanks Olivier, with your suggestion and Gemini's help, I managed to get what I needed. Now the user fields are visible on the MyProfile page after the order list.

Olivier

Super :-)

Olivier.

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Stay Updated

Subscribe for free and be the first to know about the latest features, updates, and new additions.