propertyhive / WP-Property-Hive

The complete estate agency software plugin for WordPress
Other
27 stars 27 forks source link

Accessing Descriptions Data - DezRez JSON Property import #130

Closed irishboy1976 closed 4 years ago

irishboy1976 commented 4 years ago

Hi there,

I'm loving working with Property Hive so far, but I am struggling a little, with trying to access/import some of the 'Deeper' property data, namely the Descriptions part of the property data.

This part stores extra property data, like whether pets are allowed, council tax bands etc.

I am more of a front end type of guy with some PHP skills, I have managed to create the custom fields in the properties, but no real clue how to get that extra data.

I would be very grateful if you could point me in the right direction. :)

propertyhive commented 4 years ago

@irishboy1976 Thanks for getting in touch. The Dezrez JSON feed when it comes to accessing certain fields is certainly a bit more difficult that other formats.

With other formats you'd normally just get a singular field for things like 'pets', but in Dezrez they seem to send an array of descriptions which you need to dig into.

As I don't have access to your exact Dezrez data it's hard to say, however I've put together a rough snippet you might be able to use to get started:

https://gist.github.com/propertyhive/74ac2e0fbc6337d9d33027f89e711bff

Like I say, without seeing the exact data and without knowing what you've called your custom fields it's hard to say. If you struggle with the above, if you can send your WP details through to info@wp-property-hive.com referencing this issue I'll take a closer look and get a more definitive snippet to you.

Thanks, Steve

irishboy1976 commented 4 years ago

Awesome, thank you, I am just about competent enough to deal with the data once I have it, it was really just how to iterate through that descriptions array, as you say it is a blend of predefined fields and free text boxes, so the Data isn't in any real logical order.

Again thank you for your support, much appreciated 👍