Default value for number on custom fields

This topic contains 8 replies, has 3 voices, and was last updated by  Stiofan O’Connor 8 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #261881

    David Walker
    Expired Member
    Post count: 15

    Hi

    Love the code and have been playing with it for the last few months. Just a couple of queries that i cannot solve

    (1) I add a new custom text field (number). Calling it ‘Max Venue Capacity’ for example and making it non required as some venues do not have this info. If the listing does not fill in this field it defaults and displays on the page (and database) as 0. But this is not correct as obviously the Max Venue Capacity is not 0. its strange because on the preview of the listing it does not show. But once they submit it and have not entered anything, it updates to 0 in the database and then displays as 0. I can go into the database and update all 0 to null. And then it will not show but that is not a permanent solution. Bascially if the customer adds nothing then nothing should be added to that field, but it seems to update it to 0 instead?

    You can see an example here (if you go to the capacities tab) http://whichweddingvenue.co.uk/venue/wolverhampton/connaught-hotel-wedding-venue/

    (2) How can i add the widget GD > Search to the Top Section of the Add Listings Page. So it shows here http://whichweddingvenue.co.uk/add-listing/?listing_type=gd_place . I can only see a GD > Add listings Right sidebar, not top

    (3) Would it be possible to add http://whichweddingvenue.co.uk to your showcase?

    Many Thanks

    David Walker

    (2)

    #262187

    Paolo
    Site Admin
    Post count: 31211

    1) do you have 0 as default value in the CF settings? If you provide admin credentials in a private reply we’ll have a look.

    2) There is no top widget in the add listings page, but you could add the shortcode in the add listing page content (it will show above the form) or via hooks.

    3) you can submit it from here: https://wpgeodirectory.com/submit/ Let us know when done and I’ll approve it.

    Thanks!

    #262543

    David Walker
    Expired Member
    Post count: 15
    This reply has been marked as private.
    #262638

    Paolo
    Site Admin
    Post count: 31211

    Must be something related to the new CF system we just released.

    I asked to the developers to have a look.

    Thanks for your patience.

    #262718

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi David,

    It’s for technical reasons that it happens, i’m happy to explain them if you wish?

    In your case it might be better if you add a multiselect and have options like, 0-10, 11-100, 500+ (or any options in between) or if you need exact numbers i can make up some code to hide it if it’s 0.

    Thanks,

    Stiofan

    #262876

    David Walker
    Expired Member
    Post count: 15
    This reply has been marked as private.
    #263094

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Here is the code to remove zero values:

    Thanks,

    Stiofan

    #264805

    David Walker
    Expired Member
    Post count: 15

    Thanks Stiofan

    Code works good

    Regards

    David

    #264806

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Glad to hear it 🙂

Viewing 9 posts - 1 through 9 (of 9 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount