propertyhive / WP-Property-Hive

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

In commercial properties range from £0 is rendered #55

Closed RemarkLima closed 6 years ago

RemarkLima commented 6 years ago

Hi,

In commercial properties, both rental and sales if the price range is from 0 to 1000 the format price function shows, for example "£0 - £1000 pcm".

Can https://github.com/propertyhive/WP-Property-Hive/blob/master/includes/class-ph-property.php be updated to not only exclude empty values, but also exclude "0" please?

I've made this change locally but conscious it'll be overwritten with the next update.

RemarkLima commented 6 years ago

Is anyone monitoring the issues raised here? Just had the update and see that this still happens. If someone could say if it'll be changed or not that would be appreciated.

propertyhive commented 6 years ago

Hi Mark,

I believe there are cases when commercial properties need to be listed as £0-£1000, for example when office or warehouse space is being sold with a square footage of 0-10,000 sq ft and people can rent varying space. I can't find an example right now but I've definitely seen it in the past.

As such, overwriting it when someone enters 0 we feel might have an adverse effect. Would you agree?

I feel if someone intentionally puts zero into the box, they probably want it to be zero. Otherwise they would leave it blank or enter the same price in both boxes.

I'm open to input on this by the way. I could always ask around a few agents and get their thoughts on it.

Thanks, Steve

RemarkLima commented 6 years ago

Hi Steve,

Thanks for the commentary - I guess this then becomes an issue where you have all the various feeds supported.

We're using the Jupix feed, which clearly defaults to using 0 as the lower value rather than a null. So the team is putting in a single price in Jupix which is then being rendered as £0 - £1000.

It may be more appropriate to alter the Jupix processing code rather than this... Or an option not to parse 0's in the settings??

I'm open to anything - but having to change the code each time is a bit of a pain ;)

Cheers, Mark

propertyhive commented 6 years ago

Hi Mark,

If the feed from Jupix is the issue, something like the below might work in your scenario. Try adding this to your functions.php and then, when the next import runs, it should've resolved it:

https://gist.github.com/propertyhive/f8e43cabe784360c0179c9f726b0791d

Give it a go and let me know how you get on. I haven't tested it but should work.

Thanks, Steve

RemarkLima commented 6 years ago

Hi Steve,

Just tested this and it works perfectly, I've added the same for Floor Area and everything is as expected.

Thanks for the steer with this, Thanks, Mark