Created
April 13, 2026 12:11
-
-
Save propertyhive/2eaab1f85aa52960e46adc4a9d0f480b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // OLD SNIPPET: | |
| add_filter( "houzez_property_feed_properties_due_import_expertagent", 'correct_department', 10, 2 ); | |
| function correct_department( $properties, $import_id ) | |
| { | |
| foreach ( $properties as $i => $property ) | |
| { | |
| if ( | |
| isset($property->numeric_price) && | |
| !empty((int)$property->numeric_price) && | |
| (int)$property->numeric_price < 10000 | |
| ) | |
| { | |
| $properties[$i]->department = (string)$property->department . ' lettings'; | |
| } | |
| } | |
| return $properties; | |
| } | |
| // NEW SNIPPET TO REPLACE THE ABOVE IF NOT WANTING IT TO BE BASED ON PRICE ANY MORE | |
| add_filter( "houzez_property_feed_properties_due_import_expertagent", 'correct_department_2', 10, 2 ); | |
| function correct_department_2( $properties, $import_id ) | |
| { | |
| foreach ( $properties as $i => $property ) | |
| { | |
| if ( isset($property->status4) ) | |
| { | |
| $attributes = $property->status4->attributes(); | |
| if ( isset($attributes['name']) && strtolower((string)$attributes['name']) == 'to let' ) | |
| { | |
| $properties[$i]->department = (string)$property->department . ' lettings'; | |
| } | |
| } | |
| } | |
| return $properties; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment