Mapping Lettings and Sales
-
Hi all,
As you can see from the link attached. There is a page on this site which has Lettings that the company are letting, they also have sales. This is being imported to PropertyHive through the import from Jupix.I have attempted to use this code here:
add_action( "propertyhive_property_imported_jupix_xml", "correct_property_availability", 10, 2 ); function correct_property_availability($post_id, $property) { if ( (string)$property->department == 'Residential Lettings' ) { // It's a lettings property wp_suspend_cache_invalidation( false ); wp_defer_term_counting( false ); wp_defer_comment_counting( false ); if ( (string)$property->availability == '2' ) // To Let { wp_delete_object_term_relationships( $post_id, 'availability' ); wp_set_post_terms( $post_id, 1, 'availability' ); // CHANGE 6 TO BE YOUR 'TO LET' TERM ID } if ( (string)$property->availability == '4' ) // References Pending / Let Agreed { wp_delete_object_term_relationships( $post_id, 'availability' ); wp_set_post_terms( $post_id, 7, 'availability' ); // CHANGE 7 TO BE YOUR 'LET AGREED' TERM ID } if ( (string)$property->availability == '5' ) // Let { wp_delete_object_term_relationships( $post_id, 'availability' ); wp_set_post_terms( $post_id, 6, 'availability' ); // CHANGE 8 TO BE YOUR 'LET' TERM ID } wp_suspend_cache_invalidation( true ); wp_defer_term_counting( true ); wp_defer_comment_counting( true ); } }
I have changed the correct fields within the import settings but I can’t seem to get it to display the Let Agreed/To Let and Let options instead of the For Sale/Sale STC/Under Offer. I’m not sure what i’m doing wrong.
Does anyone have any tips?
Thanks in advance ??
Chris
The page I need help with: [log in to see the link]
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Mapping Lettings and Sales’ is closed to new replies.