Need help with Joomla? We are available for hire to help with Joomla customization, upgrades, maintenance, and custom development.
Explore our services

Creating online form with fields filled up with membership details

  • bumble
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 1 month ago #137267 by bumble
Hi can please help?
I need to launch the site soon.
Waiting for your soonest reply.
Thank you!

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

More
6 years 1 month ago #137268 by Tuan Pham Ngoc
Your code is not enough. You did not include the original code which I answered on your first message. Here is the full code:
Code:
$this->execPieceByName('ff_InitLib'); $db = JFactory::getDbo(); $db->setQuery("Select * From #__osmembership_subscribers Where user_id = " . $db->quote(JFactory::getUser()->get('id'))); $subscriber = $db->loadObject(); ff_setValue('last_name', $subscriber->last_name); ff_setValue('first_name', $subscriber->first_name); ff_setValue('membership_id', $subscriber->membership_id); $query = $db->getQuery(true) ->select('a.name, b.field_value') ->from('#__osmembership_fields AS a') ->innerJoin('#__osmembership_field_value AS b ON a.id = b.field_id') ->where('b.subscriber_id = ' . $subscriber->id); $db->setQuery($query); $fieldValues = $db->loadObjectList('name'); if (isset($fieldValues['test_field_1'])) { $testField1Value = $fieldValues['test_field_1']->field_value; } else { $testField1Value = ''; } if (isset($fieldValues['test_field_2'])) { $testField2Value = $fieldValues['test_field_2']->field_value; } else { $testField2Value = ''; }

Try that, and let me know if it works

Regards,

Tuan

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

  • bumble
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 1 month ago #137269 by bumble
The code did not generate any error. But it also didn't display the idnumber. What am I doing wrong? Here is my full code (pls see attached images).
First image shows it in the BreezingForms window, the other is in a code editor. Please reply soon. Thank you!

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

More
6 years 1 month ago #137296 by Tuan Pham Ngoc
Hello

Look like you haven't called ff_setValue to set the received value to your form field?

Something like this should be added to the end:
Code:
ff_setValue('idnumber', $idnumberValue);

Could you please try that?

Tuan

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

  • bumble
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
6 years 1 month ago #137301 by bumble
Yes it works now!
Thank you!

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

More
6 years 1 month ago #137310 by Tuan Pham Ngoc
Great. Thanks for confirming

Tuan

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