My events search

  • Gerrit Deschuyteneer
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #134757 by Gerrit Deschuyteneer
My events search was created by Gerrit Deschuyteneer
Hello,

I have a question about the my events search function. Is there any way that I can search the event description?
Because now I can only search name and transaction id, but I would like to be able to search the event description also.

Is that possible? Can I modify some code so i can allow this?

Thank you,

Greetings,
Gerrit

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

More
5 years 10 months ago #134761 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic My events search
Hi Gerrit

What's my events page you are talking about? Is it Registration History page which display all registration records of the current user?

If so, the system does not allows you to search by description of event. The field you need to edit is components/com_eventbooking/model/history.php

Try to modify the code of __construct method, add:
Code:
$config['search_fields'] = [ 'tbl.first_name', 'tbl.last_name', 'tbl.organization', 'tbl.email', 'tbl.transaction_id', 'tbl.invoice_number', 'tbl.ticket_qrcode', 'tbl.ticket_code', 'ev.description', ];

Then check to see if it works?

Tuan

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

  • Gerrit Deschuyteneer
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #134775 by Gerrit Deschuyteneer
Replied by Gerrit Deschuyteneer on topic My events search
Hello Tuan,

Yes I meant Registration History. I edited the construct function in history.php like this:
Code:
public function __construct($config = []) { $config['remember_states'] = false; parent::__construct($config); $params = EventbookingHelper::getViewParams(JFactory::getApplication()->getMenu()->getActive(), ['history']); if ((int) $params->get('display_num')) { $this->setState('limit', (int) $params->get('display_num')); } $config['search_fields'] = [ 'tbl.first_name', 'tbl.last_name', 'tbl.organization', 'tbl.email', 'tbl.transaction_id', 'tbl.invoice_number', 'tbl.ticket_qrcode', 'tbl.ticket_code', 'ev.description', ]; }
But I still did not get any result, I tried changing ev.description to ev.title to be able to search the title field but still no result.
Must I change something else too?

Anyway thank you for your quick reply!
Greetings,
Gerrit

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

More
5 years 10 months ago #134776 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic My events search
The new code must be inserted before calling parent::__construct($config);

Tuan

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

  • Gerrit Deschuyteneer
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #134777 by Gerrit Deschuyteneer
Replied by Gerrit Deschuyteneer on topic My events search
Hi Tuan,

Wel yes I tried that but than i got this message:
1054 UNKNOWN COLUMN 'EV.DESCRIPTION' IN 'WHERE CLAUSE'

Greetings,
Gerrit

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

More
5 years 10 months ago #134778 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic My events search
Hmm

In this case, please submit a support ticket sending us super admin account of the site , an account which can be used to access to that page and link to that page

We will try to check it

Tuan

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

  • Gerrit Deschuyteneer
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 10 months ago #134779 by Gerrit Deschuyteneer
Replied by Gerrit Deschuyteneer on topic My events search
Thank you Tuan,

I just submitted it.

Greetings,
Gerrit

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

More
5 years 10 months ago #134781 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic My events search
Hello

If someone needs the same change, you can get this file, unzip it, upload to components/com_eventbooking/model/override folder on your site

Regard,s

Tuan

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

Moderators: Tuan Pham Ngoc