Custom field SQL with Where clause

  • Evolution Ways - Robert Riou
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 5 months ago - 2 years 5 months ago #154508 by Evolution Ways - Robert Riou
Custom field SQL with Where clause was created by Evolution Ways - Robert Riou
Hi Tuan,

I wish to pre-set fields in the checkout forms when a registered user checkout for an event.
By the way, the first and last name and email are already pre-set (but i don't know how....)

Is there a way to create a SQL custom field with a WHERE clause to get information related to the logged user (a Where clause which use the userId)

Regard,
Robert
Last edit: 2 years 5 months ago by Evolution Ways - Robert Riou.

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

More
2 years 5 months ago #154511 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom field SQL with Where clause
Hello Robert

Where data for the registered user is stored? If you use Joomla core user profile or custom fields, or some of the supported third party extensions, then you can map the fields for the system to pre-fill the data. See eventbookingdoc.joomservices.com/basic-s...hronize-profile-data for more information

Tuan

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

  • Evolution Ways - Robert Riou
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 5 months ago #154515 by Evolution Ways - Robert Riou
Replied by Evolution Ways - Robert Riou on topic Custom field SQL with Where clause
Thanks Tuan for your quick and useful answer ! :)

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

More
2 years 5 months ago #154522 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom field SQL with Where clause
You're welcome :)

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

More
1 year 9 months ago #159284 by OTWD
Replied by OTWD on topic Custom field SQL with Where clause
Hi I'm trying to do the same thing whereby a registered user has a joomla custom field in their profile called "Location".
Using j!4.3.3 and EB 4.5.0
I'm using a Joomla Registration Field with the following sql:
Code:
SELECT id AS value, name AS text FROM #__eb_categories WHERE parent != 0
The mapping works in the Billing form but its not mapped in the Group member form. Is there any way to get the mapping to work here too?
Alternatively it would be great to have a plugin that would recognise the id of the logged in user using a shortcode.
Then we could use a EB sql field:
Code:
SELECT id AS value, name AS text FROM #__eb_categories WHERE parent != 0 AND id = {$my->id}
does this option exist?

Success consists of going from failure to failure without loss of enthusiasm.

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

More
1 year 9 months ago #159292 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom field SQL with Where clause
Hello

If I understand your question correctly, you can use [USER_ID] tag in the SQL to get Joomla User ID of the registrant. So the SQL becomes:
Code:
SELECT id AS value, name AS text FROM #__eb_categories WHERE parent != 0 AND id = [USER_ID]

Regards,

Tuan
The following user(s) said Thank You: OTWD

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

More
1 year 9 months ago #159324 by OTWD
Replied by OTWD on topic Custom field SQL with Where clause
Awesome - didnt know this was possible - this is a game changer!!

Success consists of going from failure to failure without loss of enthusiasm.

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

More
1 year 9 months ago #159328 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Custom field SQL with Where clause
That was supported from some time ago, I should have it better documented :)

Tuan

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

Moderators: Tuan Pham Ngoc