TOPIC:

How to recover the data from the User Fields, from the Joomla component (3x)? 4 years 4 months ago #226649

  • galiciatv.es@gmail.com's Avatar Topic Author
  • galiciatv.es@gmail.com
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 10
  • Thanks: 0
So far I have managed to recover almost all user data, both the User Details and the User Profile, but not the new User Fields that can be created with the Joomla component.

JOOMLA USER
<?php return JFactory::getUser()->get('username',''); ?>
<?php return JFactory::getUser()->get('name',''); ?>
<?php return JFactory::getUser()->get('email'); ?>

USER PROFILE
<?php $oProfile = JUserHelper::getProfile(); return $oProfile->profile; ?>
<?php $oProfile = JUserHelper::getProfile(); return $oProfile->profile; ?>
<?php $oProfile = JUserHelper::getProfile(); return $oProfile->profile;?>
<?php $oProfile = JUserHelper::getProfile(); return $oProfile->profile;?>
<?php $oProfile = JUserHelper::getProfile(); return $oProfile->profile; ?>
<?php $oProfile = JUserHelper::getProfile(); return $oProfile->profile; ?>
<?php $oProfile = JUserHelper::getProfile(); return $oProfile->profile; ?>


What would be the formula to capture this data?

USER FIELDS
Business address: (text)
Professional email: (text)
Sex: -Masculine -Feminine (ratio group)

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

How to recover the data from the User Fields, from the Joomla component (3x)? 4 years 4 months ago #226744

  • DarkoCujic's Avatar
  • DarkoCujic
  • Offline
  • Developer
  • Developer
  • Posts: 2154
  • Karma: 67
  • Thanks: 265
Hey,

in your Before Form piece, paste the following:
$customFields = FieldsHelper::getFields('com_users.user', JFactory::getUser(), true);

That will give you the complete user fields. Then, you have to find out what index to output. You can do that by temporarily adding the following to your Before Form (after the code above):
echo '<pre>';
print_r($customFields);
echo '</pre>';

After you see what indexes you need, you simply do $customFields[x]->value;

Let me know how it goes.

Kind regards,
Darko
Satisfied with our support? PayPal tips
===========
Need to renew Pro Support? Buy Here!
===========
Satisfied? Consider a membership!
===========
Like us on Facebook
===========
Support Crosstec and get ALL EXTENSIONS and professional support for just $5. Here!

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

How to recover the data from the User Fields, from the Joomla component (3x)? 4 years 4 months ago #226770

  • galiciatv.es@gmail.com's Avatar Topic Author
  • galiciatv.es@gmail.com
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 10
  • Thanks: 0
Hello Darko, thank you very much for answering.

I have done what you told me, and it effectively throws me the complete list of fields that I have created for the user. But I should not have understood well how I should complete the formula, because as you say it should be like this:

$ customFields [professional-email] => value;

and I have placed it in the Value of a TextField of the form, but it does not work ... and obviously the code is shown and not the value, something I have done wrong!

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

How to recover the data from the User Fields, from the Joomla component (3x)? 4 years 4 months ago #226801

  • DarkoCujic's Avatar
  • DarkoCujic
  • Offline
  • Developer
  • Developer
  • Posts: 2154
  • Karma: 67
  • Thanks: 265
Hey,

you're going to have to code it out in the Before Form piece.

Would you mind providing backend access (super user) so I can check it out. This is not hard to do, but you do have to have some programming knowledge. You can send the info to darko.cujic@crosstec.org

Kind regards,
Darko
Satisfied with our support? PayPal tips
===========
Need to renew Pro Support? Buy Here!
===========
Satisfied? Consider a membership!
===========
Like us on Facebook
===========
Support Crosstec and get ALL EXTENSIONS and professional support for just $5. Here!

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.042 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!