onOffice-Web-Org / oo-wp-plugin

onOffice for WP-Websites
https://wp-plugin.onoffice.com
GNU General Public License v3.0
9 stars 9 forks source link

Filter similar properties by linked real estate agent #885

Open fredericalpers opened 3 months ago

fredericalpers commented 3 months ago

Filter similar properties by linked real estate agent

User Story

The onOffice for WP-Websites plugin currently offers the function of displaying “similar properties” on the property detail page. These properties can be filtered based on certain criteria such as same property type, same marketing type, same zip code and radius. The maximum number of similar properties to be displayed can also be defined.

To further improve the relevance and quality of the properties displayed for end users, a new filter option is to be implemented. This makes it possible to filter the similar properties according to the linked address data record of the responsible estate agent. If this option is active, only properties belonging to the same agent will be displayed on the detail page.

This function improves the relevance of the similar properties displayed and contributes to the user experience by providing more targeted results.

Task / Requirements

yeneastgate commented 2 months ago

@fredericalpers After investigating, I would like to suggest the following two solutions:

Solution 1: Can you contact the IT department and request to add a parameter to the read estate API? This will allow us to pass the filter parameter with the following structure: $filter['agentId'] []= ['op' => 'in', 'val' => array_unique($listContactPersonIds)]; In this case, $listContactPersonIds is taken from the estate details.

Solution 2: We attempted to implement a solution on the plugin side. However, this method requires calling the API twice: once to retrieve all estates and once to verify if the estate belongs to an agent. And this is my demo video: https://files.fm/f/qp7ubzg43a this pull request: https://github.com/onOffice-Web-Org/oo-wp-plugin/pull/896

Please check and let me know your opinion. Thanks! Note: Solution 2 is less optimal than solution 1 because in the second way, we need to call 1 more API => affecting performance.

fredericalpers commented 2 months ago

@yeneastgate I will send a ticket to the IT Department. I will let you know what they say, thank you :)