Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Forked from g-maclean/snippet.php
Last active June 10, 2026 09:57
Show Gist options
  • Select an option

  • Save propertyhive/bc79d5416c936503f63a4c1190dc2f7a to your computer and use it in GitHub Desktop.

Select an option

Save propertyhive/bc79d5416c936503f63a4c1190dc2f7a to your computer and use it in GitHub Desktop.
Property Hive - Real time feed - override To Rent price qualifier
add_filter( 'ph_rtdf_send_request_data', 'set_price_qualifier_for_commercial_rent_rtdf', 10, 2 );
function set_price_qualifier_for_commercial_rent_rtdf( $request_data, $post_id )
{
$property = new PH_Property( $post_id );
if ( ! $property )
{
return $request_data;
}
$original_department = $property->department;
// Check if department is commercial
if (
$original_department === 'commercial' ||
ph_get_custom_department_based_on( $original_department ) === 'commercial'
) {
// Check if property is to rent AND for sale
if (
$property->to_rent === 'yes' &&
$property->for_sale === 'yes'
) {
if (
isset($request_data['branch']['channel']) &&
$request_data['branch']['channel'] === 2 &&
$property->rent_from == '1' &&
$property->rent_to == '1'
) {
$request_data['property']['price_information']['price_qualifier'] = 1; // Set to POA
}
if (
isset($request_data['branch']['channel']) &&
$request_data['branch']['channel'] === 1 &&
$property->price_from == '1' &&
$property->price_to == '1'
) {
$request_data['property']['price_information']['price_qualifier'] = 1; // Set to POA
}
}
}
return $request_data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment