Put all listings into category by default

This topic contains 16 replies, has 4 voices, and was last updated by  Paolo 8 years, 6 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #54742

    alex5252
    Buyer
    Post count: 49

    Hi,

    I would like to make it so all listings get put into a category by default when a listing is submitted. I do not want the frontend user to have to see the category option, I just want it to put them in the 1 category that I have available by default.

    Here is a video explaining what I want done: https://youtu.be/pJ2-QR6X158

    How would I do this?

    #54750

    Guust
    Moderator
    Post count: 29970

    I don’t think that is possible, but I’ll get Paolo to look at your question too.

    #54876

    Paolo
    Site Admin
    Post count: 31206
    #54884

    alex5252
    Buyer
    Post count: 49

    Thank you for the reply. Where do I put the JS code? I tried placing it in my functions.php but that did not work.

    #54885

    Paolo
    Site Admin
    Post count: 31206

    It is javascript, it will not be executed in a PHP file. Please add it to GeoDirectory >> Design >> Scripts >> Footer Scripts.

    Also the script provided there is for his specific case. He’s using two variables. Price ID 1 and price ID 2 and assigning a different category for each.

    Category with ID 8 for price 1 and category with ID 7 for price 2.

    Make sure to adapt that script to your needs.

    Thanks

    #54891

    alex5252
    Buyer
    Post count: 49

    Thanks for the information. I adapted the code to fit my category ids and pasted the code in Footer Scripts, however it does not seem to be doing anything. Also I can see it under my footer on the frontend of the website. Is there a part of the code I am missing or should be removing before pasting it?

    Attached is what I see on the frontend of the site under the footer.

    #54898

    alex5252
    Buyer
    Post count: 49
    This reply has been marked as private.
    #54944

    Paolo
    Site Admin
    Post count: 31206

    HI,

    everything looked correct except for the script not being wrapped in tag.

    However it doesn’t appear to be working for some reason. I even tried to place it in the header, but no results.

    I’ve asked to the developers to have a look for us and let us know.

    Thanks for your patience,

    #55037

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    You were checking if the page was “/add-listing/” but it is actually “/nsjvma/add-listing/”

    Now it’s working

    Stiofan

    #55059

    alex5252
    Buyer
    Post count: 49

    Thank you for the reply and finding that. I just tested it and it is still not working on my end. Did you try submitting a listings, and did it work for you?

    Thanks!

    #55066

    alex5252
    Buyer
    Post count: 49

    Nevermind, I figured out what I was doing wrong.

    Thanks for all the help!

    #55067

    alex5252
    Buyer
    Post count: 49

    Hi again.

    It is working perfect for the default post type.

    However it is not working for my custom post type hospital

    This is the link I am using for the listing form: http://marckdesignconcepts.com/nsjvma/add-listing/?listing_type=gd_hospital&package_id=2

    Can you see something that is wrong with the JS code or something else as to why it is not adding people the the Hospital category when they submit this form?

    Thanks!

    #55125

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    one is “placecategory” and one is “hospitalcategory”, i have changed your code and it is now working.

    Stiofan

    #58702

    alex5252
    Buyer
    Post count: 49
    This reply has been marked as private.
    #58703

    alex5252
    Buyer
    Post count: 49

    After investigating a little further I think there is some issue with the category option being completely removed from my 2 listing custom post type forms.

    I had been using the below code to hide the category option from the form since it was being autofilled, but I tried removing the css code and the category option on the listing forms is still gone.

    Any idea why the category option would be completely gone now?

    CODE I WAS USING:

    #gd_placecategory_row{
    display: none;
    }

    #gd_hospitalcategory_row{
    display: none;
    }

    Thanks for the help!

Viewing 15 posts - 1 through 15 (of 17 total)

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

Open Support Ticket